com.dlsc.flexgantt.swing.layer.system
Class ActivityObjectEditModeController

java.lang.Object
  extended by com.dlsc.flexgantt.swing.layer.system.DefaultEditModeController
      extended by com.dlsc.flexgantt.swing.layer.system.ActivityObjectEditModeController
All Implemented Interfaces:
IEditModeController

public class ActivityObjectEditModeController
extends DefaultEditModeController

A specialized edit mode controller for use with timeline objects of type IActivityObject. This kind of timeline object supports an attribute called 'percentage complete'. The activity object edit mode controller triggers an edit mode of type CHANGE_PERCENTAGE_COMPLETE when the mouse hovers over the current percentage complete position while the user holds down the SHIFT key.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
DefaultActivityObject, IEditActivityObjectPolicy.isPercentageChangeable(Object, Object, IGanttChartModel), DragLayer.setEditModeController(Class, IEditModeController)

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.dlsc.flexgantt.swing.layer.system.IEditModeController
IEditModeController.EditMode
 
Constructor Summary
ActivityObjectEditModeController()
           
 
Method Summary
 IEditModeController.EditMode getEditMode(DragLayer layer, ObjectBounds bounds, java.awt.event.MouseEvent evt)
          Returns an edit mode based on the given bounds and mouse event.
protected  boolean isChangePercentageLocation(ObjectBounds bounds, java.awt.event.MouseEvent evt)
          Returns TRUE if the given location is valid for changing the percentage complete value of the timeline object.
 
Methods inherited from class com.dlsc.flexgantt.swing.layer.system.DefaultEditModeController
isChangeEndTimeLocation, isChangeStartTimeLocation, isDragLocation, isUsingDragOverrideModifiers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivityObjectEditModeController

public ActivityObjectEditModeController()
Method Detail

getEditMode

public IEditModeController.EditMode getEditMode(DragLayer layer,
                                                ObjectBounds bounds,
                                                java.awt.event.MouseEvent evt)
Description copied from interface: IEditModeController
Returns an edit mode based on the given bounds and mouse event. The method can evaluate the location and the modifiers of the event in order to determine what kind of editing operation will be supported.

Specified by:
getEditMode in interface IEditModeController
Overrides:
getEditMode in class DefaultEditModeController
Parameters:
layer - the drag layer requesting the edit mode
bounds - the object bounds over which the mouse cursor currently hovers
evt - the mouse event that triggered the request
Returns:
the edit mode that is appropriate for the given location and key modifiers

isChangePercentageLocation

protected boolean isChangePercentageLocation(ObjectBounds bounds,
                                             java.awt.event.MouseEvent evt)
Returns TRUE if the given location is valid for changing the percentage complete value of the timeline object.

Parameters:
bounds - the object bounds to check
evt - the mouse event causing the location check
Returns:
TRUE if the specified location is valid for changing the percentage complete value of the timeline object
Since:
1.0