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

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

public class CapacityObjectEditModeController
extends DefaultEditModeController

A specialized edit mode controller for use with timeline objects of type ICapacityObject. This kind of timeline object supports an attribute called 'capacity'. The capacity object edit mode controller triggers an edit mode of type CHANGE_CAPACITY when the mouse hovers over the capacity change position while the user holds down the SHIFT key. The capcity change position is the top edge of the capacity object.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
DefaultCapacityObject, IEditCapacityObjectPolicy.isCapacityChangeable(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
CapacityObjectEditModeController()
           
 
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 isChangeCapacityLocation(ObjectBounds bounds, java.awt.event.MouseEvent evt)
          Returns TRUE if the given location is valid for changing the capacity 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

CapacityObjectEditModeController

public CapacityObjectEditModeController()
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

isChangeCapacityLocation

protected boolean isChangeCapacityLocation(ObjectBounds bounds,
                                           java.awt.event.MouseEvent evt)
Returns TRUE if the given location is valid for changing the capacity 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