com.dlsc.flexgantt.command.layer
Class DefaultDeleteTimelineObjectCommand

java.lang.Object
  extended by com.dlsc.flexgantt.command.AbstractCommand
      extended by com.dlsc.flexgantt.command.layer.DefaultDeleteTimelineObjectCommand
All Implemented Interfaces:
ICommand, java.io.Serializable

public class DefaultDeleteTimelineObjectCommand
extends AbstractCommand

A command that deletes a timeline object from a Gantt chart model. This command will only work in situations where the model is an instance of DefaultGanttChartModel, the timeline object implements the ITimelineObject interface, and the tree node implements the IGanttChartNode interface.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
IEditTimelineObjectPolicy.getDeleteCommand(Object, ILayer, Object, com.dlsc.flexgantt.model.gantt.IGanttChartModel), DefaultGanttChartModel.removeTimelineObject(IGanttChartNode, ILayer, ITimelineObject), Serialized Form

Constructor Summary
DefaultDeleteTimelineObjectCommand(IGanttChartNode node, ILayer layer, ITimelineObject object, DefaultGanttChartModel model)
          Constructs a new command.
 
Method Summary
 void executeCommand(IProgressMonitor monitor)
          Executes the command.
 ILayer getLayer()
          Returns the layer on which the timeline object gets displayed.
 DefaultGanttChartModel getModel()
          Returns the model in which the tree node and the deleted timeline object are stored.
 IGanttChartNode getNode()
          Returns the tree node that owns the timeline object (the object gets shown in the row of that node).
 ITimelineObject getTimelineObject()
          Returns the timeline object that will / was deleted.
 void undoCommand(IProgressMonitor monitor)
          Undos the command.
 
Methods inherited from class com.dlsc.flexgantt.command.AbstractCommand
getName, isRedoable, isRelevant, isUndoable, redoCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDeleteTimelineObjectCommand

public DefaultDeleteTimelineObjectCommand(IGanttChartNode node,
                                          ILayer layer,
                                          ITimelineObject object,
                                          DefaultGanttChartModel model)
Constructs a new command.

Parameters:
node - the tree node that owns the timeline object (the object is displayed in the row of that node)
layer - the layer on which the timeline object gets displayed
object - the timeline object that will be deleted
model - the model in which the node and the timeline object are stored
Since:
1.0
Method Detail

executeCommand

public void executeCommand(IProgressMonitor monitor)
Description copied from interface: ICommand
Executes the command.

Parameters:
monitor - a progress monitor

undoCommand

public void undoCommand(IProgressMonitor monitor)
Description copied from interface: ICommand
Undos the command.

Parameters:
monitor - a progress monitor

getTimelineObject

public ITimelineObject getTimelineObject()
Returns the timeline object that will / was deleted.

Returns:
the deleted timeline object
Since:
1.0

getModel

public DefaultGanttChartModel getModel()
Returns the model in which the tree node and the deleted timeline object are stored.

Returns:
the Gantt chart to which the tree node and the timeline object belong
Since:
1.0

getLayer

public ILayer getLayer()
Returns the layer on which the timeline object gets displayed.

Returns:
the layer on which the timeline object gets displayed
Since:
1.0

getNode

public IGanttChartNode getNode()
Returns the tree node that owns the timeline object (the object gets shown in the row of that node).

Returns:
the timeline object's node
Since:
1.0