public class DefaultCreateTimelineObjectCommand extends AbstractCommand
IEditTimelineObjectPolicy.getCreateCommand(Object,
com.dlsc.flexgantt.model.gantt.IGanttChartModel, ILayer, ITimeSpan, int)
,
Serialized FormConstructor and Description |
---|
DefaultCreateTimelineObjectCommand(DefaultGanttChartNode node,
DefaultGanttChartModel model,
ILayer layer,
ITimeSpan timeSpan,
int lineIndex)
Constructs a new command.
|
Modifier and Type | Method and Description |
---|---|
protected DefaultTimelineObject |
createTimelineObject()
Creates the actual timeline object instance, which is of type
DefaultTimelineObject . |
void |
executeCommand(IProgressMonitor monitor)
Executes the command.
|
ILayer |
getLayer()
Returns the layer on which the timeline object will be displayed.
|
int |
getLineIndex()
Returns the line index used for placing the timeline object on an inner
line.
|
DefaultGanttChartModel |
getModel()
Returns the model that will be modified by the command.
|
DefaultTimelineObject |
getNewTimelineObject()
Returns the newly created timeline object.
|
DefaultGanttChartNode |
getNode()
Returns the node for which the timeline object gets created.
|
ITimeSpan |
getTimeSpan()
Returns the time span where the newly created timeline object will be
placed.
|
void |
setLayer(ILayer layer)
Sets the layer on which the timeline object will be displayed.
|
void |
setModel(DefaultGanttChartModel model)
Sets the model that gets modified by the command.
|
void |
setNode(DefaultGanttChartNode node)
Sets the node for which the timeline object gets created.
|
void |
setTimeSpan(ITimeSpan span)
Sets the time span where the newly created timeline object will be
placed.
|
void |
undoCommand(IProgressMonitor monitor)
Undos the command.
|
getName, isRedoable, isRelevant, isUndoable, redoCommand, setName
public DefaultCreateTimelineObjectCommand(DefaultGanttChartNode node, DefaultGanttChartModel model, ILayer layer, ITimeSpan timeSpan, int lineIndex)
node
- the node to which the new timeline object will be addedmodel
- the model that gets modified by the commandlayer
- the layer on which the new timeline object will be placedtimeSpan
- the time span where the new timeline object will be locatedlineIndex
- the index of the inner line where the timeline object will be
locatedpublic void executeCommand(IProgressMonitor monitor) throws CommandException
ICommand
monitor
- a progress monitorCommandException
- if anything during the execution of the command has gone
wrongpublic void undoCommand(IProgressMonitor monitor) throws CommandException
ICommand
monitor
- a progress monitorCommandException
- if anything during the execution of the command has gone
wrongprotected DefaultTimelineObject createTimelineObject()
DefaultTimelineObject
. Subclasses can override this method to
create a timeline object of a different type. This method should only be
called once during the executeCommand(IProgressMonitor)
method
invocation. After that only the created instance should be used.public ILayer getLayer()
public void setLayer(ILayer layer)
layer
- the layer on which the timeline object will be displayedpublic ITimeSpan getTimeSpan()
public void setTimeSpan(ITimeSpan span)
span
- the time span of the new timeline objectpublic DefaultGanttChartNode getNode()
public void setNode(DefaultGanttChartNode node)
node
- the node for which the timeline object gets createdpublic DefaultGanttChartModel getModel()
public void setModel(DefaultGanttChartModel model)
model
- the model that gets modified by the commandpublic DefaultTimelineObject getNewTimelineObject()
public int getLineIndex()
Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.