com.dlsc.flexgantt.command.layer
Class DefaultCreateRelationshipCommand

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

public class DefaultCreateRelationshipCommand
extends AbstractCommand

A command that will add a relationship to the Gantt chart model.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
IRelationshipPolicy.getCreateRelationshipCommand(com.dlsc.flexgantt.model.gantt.TimelineObjectPath, com.dlsc.flexgantt.model.gantt.TimelineObjectPath, com.dlsc.flexgantt.model.gantt.IGanttChartModel), Serialized Form

Constructor Summary
DefaultCreateRelationshipCommand(TimelineObjectPath sourcePath, TimelineObjectPath targetPath, DefaultGanttChartModel model)
          Constructs a new command.
 
Method Summary
 void executeCommand(IProgressMonitor monitor)
          Executes the command.
 DefaultGanttChartModel getModel()
          Returns the model for which the command creates / created a new relationship object.
 DefaultRelationship getRelationship()
          The relationship that was created by the command.
 TimelineObjectPath getSourcePath()
          The path to the timeline object that will be used as the source of the relationship.
 TimelineObjectPath getTargetPath()
          The path to the timeline object that will be used as the target of the relationship.
 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

DefaultCreateRelationshipCommand

public DefaultCreateRelationshipCommand(TimelineObjectPath sourcePath,
                                        TimelineObjectPath targetPath,
                                        DefaultGanttChartModel model)
Constructs a new command.

Parameters:
sourcePath - the path to the source timeline object
targetPath - the path to the target timeline object
model - the model for which to create the relationship object
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

getModel

public DefaultGanttChartModel getModel()
Returns the model for which the command creates / created a new relationship object.

Returns:
the model for which a relationship object was created
Since:
1.0

getRelationship

public DefaultRelationship getRelationship()
The relationship that was created by the command.

Returns:
the new relationship object
Since:
1.0

getSourcePath

public TimelineObjectPath getSourcePath()
The path to the timeline object that will be used as the source of the relationship.

Returns:
the path to the source timeline object
Since:
1.0

getTargetPath

public TimelineObjectPath getTargetPath()
The path to the timeline object that will be used as the target of the relationship.

Returns:
the path to the target timeline object
Since:
1.0