se.liu.ida.critiquer.gui
Class ActivityDraggedAdapter

java.lang.Object
  extended by java.awt.event.MouseMotionAdapter
      extended by se.liu.ida.critiquer.gui.ActivityDraggedAdapter
All Implemented Interfaces:
MouseMotionListener, EventListener

final class ActivityDraggedAdapter
extends MouseMotionAdapter

Move the activities in the time line by dragging them. If you start the drag close to either end of the activity (where close is defined as the 15% of the activity rectangle closest to the ends), the duration is changed instead. If you start your drag operation close to the beginning of the activity, it will change the start time. If you begin the drag operation close to the end, it will change the end time. Drag anywhere else and both start and end are affected equally. There is currently some jerkiness, probably due to constraints that fire when activities are moved.

The jerkiness comes from the fact that activities fire update events when both the start time parameter as well as the end time parameter are updated. We want to treat that as an atomic update however, so that the task graphical representation in the timeline view is only updated once both parameters have their new values.

Author:
olale

Constructor Summary
ActivityDraggedAdapter(TimeView view, JFreeChart chart)
           
 
Method Summary
 void mouseDragged(MouseEvent e)
          Change start and/or the end time of an activity as part of the drag operation
 void mouseMoved(MouseEvent e)
          Change the cursor so the user knows what a drag operation will do in the current context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivityDraggedAdapter

ActivityDraggedAdapter(TimeView view,
                       JFreeChart chart)
Method Detail

mouseMoved

public void mouseMoved(MouseEvent e)
Change the cursor so the user knows what a drag operation will do in the current context

Specified by:
mouseMoved in interface MouseMotionListener
Overrides:
mouseMoved in class MouseMotionAdapter
See Also:
MouseMotionAdapter.mouseMoved(java.awt.event.MouseEvent)

mouseDragged

public void mouseDragged(MouseEvent e)
Change start and/or the end time of an activity as part of the drag operation

Specified by:
mouseDragged in interface MouseMotionListener
Overrides:
mouseDragged in class MouseMotionAdapter
See Also:
MouseMotionAdapter.mouseDragged(java.awt.event.MouseEvent)