public class DefaultChangeTimelineObjectTimeSpanCommand extends AbstractCommand
DefaultGanttChartModel
and the object implements the
ITimelineObject
interface.IEditTimelineObjectPolicy
,
IEditTimelineObjectPolicy.getChangeTimeSpanCommand(com.dlsc.flexgantt.model.gantt.TimelineObjectPath,
com.dlsc.flexgantt.model.gantt.IGanttChartModel, ITimeSpan, int)
,
ITimelineObject.setTimeSpan(ITimeSpan)
,
DefaultGanttChartModel.setTimeSpan(ITimelineObject, ITimeSpan)
,
Serialized FormConstructor and Description |
---|
DefaultChangeTimelineObjectTimeSpanCommand(DefaultGanttChartNode node,
ILayer layer,
ITimelineObject object,
DefaultGanttChartModel model,
ITimeSpan span,
int dropAction)
Constructs a new command.
|
Modifier and Type | Method and Description |
---|---|
void |
executeCommand(IProgressMonitor monitor)
Executes the command.
|
int |
getDropAction()
Returns the type of drop that was used by the user to change the time
span.
|
ILayer |
getLayer()
Returns the layer where the timeline object is located.
|
DefaultGanttChartModel |
getModel()
Returns the model to which the timeline object belongs.
|
ITimeSpan |
getNewTimeSpan()
Returns the time span that will be / was assigned to the timeline object
by the command.
|
DefaultGanttChartNode |
getNode()
Returns the tree node to which the timeline object belongs.
|
ITimeSpan |
getOldTimeSpan()
Returns the time span that was assigned to the timeline object before the
command was executed.
|
ITimelineObject |
getTimelineObject()
Returns the timeline object that was modified by the command.
|
void |
undoCommand(IProgressMonitor monitor)
Undos the command.
|
getName, isRedoable, isRelevant, isUndoable, redoCommand, setName
public DefaultChangeTimelineObjectTimeSpanCommand(DefaultGanttChartNode node, ILayer layer, ITimelineObject object, DefaultGanttChartModel model, ITimeSpan span, int dropAction)
node
- the hierarchy / tree node on which the timeline object is
locatedlayer
- the layer where the timeline object gets displayedobject
- the timeline object that will be modified by the commandmodel
- the model from which the timeline object originatedspan
- the new time span that will be assgined to the timeline objectdropAction
- the type of drop performed by the user (possible values are
defined in DnDConstants
)public 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
wrongpublic DefaultGanttChartModel getModel()
public ITimeSpan getNewTimeSpan()
public ITimeSpan getOldTimeSpan()
public ITimelineObject getTimelineObject()
public ILayer getLayer()
public DefaultGanttChartNode getNode()
public int getDropAction()
DnDConstants
.DnDConstants
)Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.