edu.stanford.hci.dtools.statechart.model.commands
Class ComponentConnectionCreateCommand
java.lang.Object
org.eclipse.gef.commands.Command
edu.stanford.hci.dtools.statechart.model.commands.ComponentConnectionCreateCommand
public class ComponentConnectionCreateCommand
- extends org.eclipse.gef.commands.Command
This software is distributed under the
BSD License.
This code is partially based on code that is copyright (c) 2004 Elias Volanakis. See License.txt
- Author:
- Elias Volanakis, Michael Bernstein ( mbernst(AT)stanford.edu ), Bjoern Hartmann ( bjoern(AT)stanford.edu )
The command can be undone or redone.
This command is designed to be used together with a GraphicalNodeEditPolicy.
To use this command properly, following steps are necessary:
- Create a subclass of GraphicalNodeEditPolicy.
- Override the getConnectionCreateCommand(...) method,
to create a new instance of this class and put it into the CreateConnectionRequest.
- Override the getConnectionCompleteCommand(...) method,
to obtain the Command from the ConnectionRequest, call setTarget(...) to set the
target endpoint of the connection and return this command instance.
, Elias Volanakis
- See Also:
for an
example of the above procedure.
,
GraphicalNodeEditPolicy
Methods inherited from class org.eclipse.gef.commands.Command |
canUndo, chain, dispose, getDebugLabel, getLabel, setDebugLabel, setLabel |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ComponentConnectionCreateCommand
public ComponentConnectionCreateCommand(IOModel source,
int lineStyle)
- Instantiate a command that can create a connection between two shapes.
- Parameters:
source
- the source endpoint (a non-null ShapeModel instance)lineStyle
- the desired line style. See ConnectionModel#setLineStyle(int) for details
- Throws:
java.lang.IllegalArgumentException
- if source is null- See Also:
ConnectionModel.setLineStyle(int)
canExecute
public boolean canExecute()
- Overrides:
canExecute
in class org.eclipse.gef.commands.Command
execute
public void execute()
- Overrides:
execute
in class org.eclipse.gef.commands.Command
redo
public void redo()
- Overrides:
redo
in class org.eclipse.gef.commands.Command
setTarget
public void setTarget(IOModel target)
- Set the target endpoint for the connection.
- Parameters:
target
- that target endpoint (a non-null ShapeModel instance)
- Throws:
java.lang.IllegalArgumentException
- if target is null
undo
public void undo()
- Overrides:
undo
in class org.eclipse.gef.commands.Command