public class CreateConnectionCommand extends AbstractCommand
Constructor and Description |
---|
CreateConnectionCommand(IConfigurationProvider configurationProvider,
PictogramElement pe,
java.util.List<IFeature> features)
Instantiate a command that can create a connection between two anchors.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canExecute() |
boolean |
canStartConnection() |
boolean |
canUndo() |
void |
connectionStarted() |
void |
deactivate() |
void |
execute() |
IFeatureAndContext[] |
getFeaturesAndContexts() |
PictogramElement |
getSourceObject() |
void |
redo() |
void |
setLocation(org.eclipse.draw2d.geometry.Point location)
sets the location for the command when connection is dropped into nowhere
|
void |
setTarget(PictogramElement pe)
Set the target endpoint for the connection.
|
void |
undo() |
getConfigurationProvider
public CreateConnectionCommand(IConfigurationProvider configurationProvider, PictogramElement pe, java.util.List<IFeature> features)
source
- the source endpoint (a non-null Shape instance)lineStyle
- the desired line style. See Connection#setLineStyle(int) for
detailsjava.lang.IllegalArgumentException
- if source is nullConnection#setLineStyle(int)
public boolean canExecute()
canExecute
in class org.eclipse.gef.commands.Command
public void execute()
execute
in class org.eclipse.gef.commands.Command
public boolean canStartConnection()
public void redo()
redo
in class org.eclipse.gef.commands.Command
public void setTarget(PictogramElement pe)
target
- that target endpoint (a non-null Shape instance)java.lang.IllegalArgumentException
- if target is nullpublic boolean canUndo()
canUndo
in class org.eclipse.gef.commands.Command
public void undo()
undo
in class org.eclipse.gef.commands.Command
public PictogramElement getSourceObject()
public void setLocation(org.eclipse.draw2d.geometry.Point location)
location
- public IFeatureAndContext[] getFeaturesAndContexts()
public void connectionStarted()
public void deactivate()