com.dlsc.flexgantt.policy.layer
Interface IEditTimelineObjectPolicy

All Superinterfaces:
IPolicy
All Known Implementing Classes:
DefaultEditTimelineObjectPolicy

public interface IEditTimelineObjectPolicy
extends IPolicy

A policy that is used for making various decisions regarding the editing behaviour of timeline objects.

Since:
1.0
Author:
Dirk Lemmermann

Method Summary
 ICommand getChangeTimeSpanCommand(java.lang.Object node, java.lang.Object timelineObject, IGanttChartModel model, ILayer layer, ITimeSpan span, int dropAction)
          Returns a command object that will perform the actual change of the timeline object's time span.
 ICommand getCreateCommand(java.lang.Object node, IGanttChartModel model, ILayer layer, ITimeSpan span, int lineIndex)
          Returns a command object that will perform the creation of a new timeline object.
 ICommand getDeleteCommand(java.lang.Object node, ILayer layer, java.lang.Object timelineObject, IGanttChartModel model)
          Returns a command object that will perform the deletion of the timeline object.
 boolean isCreatable(java.lang.Object node, IGanttChartModel model, ITimeSpan span)
          Decides whether the timeline object may be deleted.
 boolean isDeletable(java.lang.Object node, java.lang.Object timelineObject, IGanttChartModel model)
          Decides whether the timeline object may be deleted.
 boolean isDurationChangeable(java.lang.Object node, java.lang.Object timelineObject, IGanttChartModel model)
          Decides whether the duration of a timeline object may be edited / changed.
 boolean isInPlaceEditable(java.lang.Object node, java.lang.Object timelineObject, IGanttChartModel model)
          Decides whether a timeline object can be edited with an editor where the editor is usually an instance of ITimelineObjectEditor.
 boolean isStartTimeChangeable(java.lang.Object node, java.lang.Object timelineObject, IGanttChartModel model)
          Decides whether the start time of a timeline object may be edited / changed.
 

Method Detail

isInPlaceEditable

boolean isInPlaceEditable(java.lang.Object node,
                          java.lang.Object timelineObject,
                          IGanttChartModel model)
Decides whether a timeline object can be edited with an editor where the editor is usually an instance of ITimelineObjectEditor.

Parameters:
node - the tree node that owns the timeline object
timelineObject - the timeline object that gets checked for its editing ability
model - the data source of the tree node and the timeline object
Returns:
TRUE if the timeline object may be edited by the user
Since:
1.0

isStartTimeChangeable

boolean isStartTimeChangeable(java.lang.Object node,
                              java.lang.Object timelineObject,
                              IGanttChartModel model)
Decides whether the start time of a timeline object may be edited / changed.

Parameters:
node - the tree node that owns the timeline object
timelineObject - the timeline object that gets checked for its time span editing ability
model - the data source of the tree node and the timeline object
Returns:
TRUE if the start time of the timeline object may be edited
Since:
1.0

isDurationChangeable

boolean isDurationChangeable(java.lang.Object node,
                             java.lang.Object timelineObject,
                             IGanttChartModel model)
Decides whether the duration of a timeline object may be edited / changed.

Parameters:
node - the tree node that owns the timeline object
timelineObject - the timeline object that gets checked for its time span editing ability
model - the data source of the tree node and the timeline object
Returns:
TRUE if the duration of the timeline object may be edited
Since:
1.0

isDeletable

boolean isDeletable(java.lang.Object node,
                    java.lang.Object timelineObject,
                    IGanttChartModel model)
Decides whether the timeline object may be deleted.

Parameters:
node - the tree node that owns the timeline object
timelineObject - the eventline object that gets checked
model - the data source of the timeline object
Returns:
TRUE if the eventline object may be deleted
Since:
1.0

isCreatable

boolean isCreatable(java.lang.Object node,
                    IGanttChartModel model,
                    ITimeSpan span)
Decides whether the timeline object may be deleted.

Parameters:
node - the tree node that will own the new timeline object
model - the data source of the timeline object
span - the time span where the new timeline object shall be created
Returns:
TRUE if the eventline object may be deleted
Since:
1.0

getChangeTimeSpanCommand

ICommand getChangeTimeSpanCommand(java.lang.Object node,
                                  java.lang.Object timelineObject,
                                  IGanttChartModel model,
                                  ILayer layer,
                                  ITimeSpan span,
                                  int dropAction)
Returns a command object that will perform the actual change of the timeline object's time span.

Parameters:
node - the tree node that owns the timeline object
timelineObject - the timeline object that receives a new time span
model - the data source of the tree node and the timeline object
layer - the layer on which the timeline object is located
span - the new time span for the timeline object
dropAction - the type of drag that was executed by the user (COPY or MOVE, the possible values are listed in DnDConstants).
Returns:
a command that will modify the timeline object's time span
Since:
1.0

getCreateCommand

ICommand getCreateCommand(java.lang.Object node,
                          IGanttChartModel model,
                          ILayer layer,
                          ITimeSpan span,
                          int lineIndex)
Returns a command object that will perform the creation of a new timeline object.

Parameters:
node - the tree node that will own the new timeline object
model - the data source of the tree node
layer - the layer to which the newly created timeline object will be added
span - the time span where the new timeline object will be placed
lineIndex - the index of the line (see ILinePolicy) where the new timeline object gets created (-1 if no specific inner line is used)
Returns:
a command that will modify the timeline object's time span
Since:
1.0

getDeleteCommand

ICommand getDeleteCommand(java.lang.Object node,
                          ILayer layer,
                          java.lang.Object timelineObject,
                          IGanttChartModel model)
Returns a command object that will perform the deletion of the timeline object.

Parameters:
node - the tree node that owns the timeline object
layer - the layer on which the timeline object is displayed
timelineObject - the timeline object that gets deleted
model - the data source of the tree node and the timeline object
Returns:
a command that will modify the timeline object's time span
Since:
1.0