public class DefaultEditModeController extends Object implements IEditModeController
DefaultTimelineObject
. The editor lets the
user change the start and end times when the mouse cursor hovers over the
left or right edige of the timeline object. The user can drag and drop the
timeline object when the cursor is placed in its center region.
The controller makes heavy use of the IDragAndDropPolicy
and the
IEditTimelineObjectPolicy
. These policies define, which kind of
editing behaviour is supported by the timeline object.
IDragAndDropPolicy.getDragActions(com.dlsc.flexgantt.model.gantt.TimelineObjectPath,
IGanttChartModel)
,
IEditTimelineObjectPolicy.isStartTimeChangeable(com.dlsc.flexgantt.model.gantt.TimelineObjectPath,
IGanttChartModel)
,
IEditTimelineObjectPolicy.isDurationChangeable(com.dlsc.flexgantt.model.gantt.TimelineObjectPath,
IGanttChartModel)
IEditModeController.EditMode
Constructor and Description |
---|
DefaultEditModeController() |
Modifier and Type | Method and Description |
---|---|
IEditModeController.EditMode |
getEditMode(DragLayer layer,
ObjectBounds bounds,
MouseEvent e)
Returns an edit mode based on the given bounds and mouse event.
|
protected boolean |
isChangeEndTimeLocation(ObjectBounds bounds,
MouseEvent evt,
IEditTimelineObjectPolicy editPolicy)
Returns TRUE if the given location is valid for changing the end time of
the timeline object.
|
protected boolean |
isChangeStartTimeLocation(ObjectBounds bounds,
MouseEvent evt,
IEditTimelineObjectPolicy editPolicy)
Returns TRUE if the given location is valid for changing the start time
of the timeline object.
|
protected boolean |
isDragLocation(ObjectBounds bounds,
MouseEvent evt,
IEditTimelineObjectPolicy editPolicy)
Returns TRUE if the given location is a valid location within the
object's bounds for initiating a drag operation.
|
protected boolean |
isUsingDragOverrideModifiers(MouseEvent evt)
Determines whether the modifiers of the mouse event override the standard
editing behaviour so that the controller will return
EditMode.CHANGE_TIME_SPAN even when the cursor is on the
locations that usually trigger an EditMode.CHANGE_START_TIME
or an EditMode.CHANGE_END_TIME . |
public IEditModeController.EditMode getEditMode(DragLayer layer, ObjectBounds bounds, MouseEvent e)
IEditModeController
getEditMode
in interface IEditModeController
layer
- the drag layer requesting the edit modebounds
- the object bounds over which the mouse cursor currently hoverse
- the mouse event that triggered the requestprotected boolean isDragLocation(ObjectBounds bounds, MouseEvent evt, IEditTimelineObjectPolicy editPolicy)
bounds
- the object bounds to checkevt
- the mouse event causing the location checkeditPolicy
- the timeline object editing policyprotected boolean isChangeEndTimeLocation(ObjectBounds bounds, MouseEvent evt, IEditTimelineObjectPolicy editPolicy)
bounds
- the object bounds to checkevt
- the mouse event causing the location checkeditPolicy
- the timeline object editing policyprotected boolean isChangeStartTimeLocation(ObjectBounds bounds, MouseEvent evt, IEditTimelineObjectPolicy editPolicy)
bounds
- the object bounds to checkevt
- the mouse event causing the location checkeditPolicy
- the timeline object editing policyprotected boolean isUsingDragOverrideModifiers(MouseEvent evt)
EditMode.CHANGE_TIME_SPAN
even when the cursor is on the
locations that usually trigger an EditMode.CHANGE_START_TIME
or an EditMode.CHANGE_END_TIME
. An override can be useful
when the timeline object is too small for all edit modes. The default
implementation of this method returns TRUE when the user is pressing the
ALT key.evt
- the mouse event to check for override modifiersCopyright © 2006–2016 Dirk Lemmermann Software & Consulting. All rights reserved.