|
SAM | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gef.commands.Command
org.topcased.modeler.sam.commands.MovePortCommand
public class MovePortCommand
The Command used to move a Port contained by MultiPort to the container of the MultiPort or move a Port to a MultiPort in the same hierarchy of the Port Creation : 21 dec 2005
Constructor Summary | |
---|---|
MovePortCommand(GraphNode parent,
GraphNode child,
org.eclipse.draw2d.geometry.Point position,
int attach)
Constructor |
Method Summary | |
---|---|
protected int |
calculateChildAttachment(org.eclipse.draw2d.geometry.Point loc,
org.eclipse.draw2d.geometry.Rectangle container)
Calculate the nearest border where the graphNode should be attached at the creation depending on its location ( Point ) and
its container (Rectangle ) |
boolean |
canExecute()
|
void |
execute()
|
void |
redo()
Add a new DataPort object to the SynchronisationGate model object |
protected void |
redoModel()
Update the model |
void |
undo()
Remove the last added DataPort |
protected void |
undoModel()
Undo the model modifications |
Methods inherited from class org.eclipse.gef.commands.Command |
---|
canUndo, chain, dispose, getDebugLabel, getLabel, setDebugLabel, setLabel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MovePortCommand(GraphNode parent, GraphNode child, org.eclipse.draw2d.geometry.Point position, int attach)
parent
- the parentEditPart that will contain the PortEditPartchild
- the PortEditPart that is movedposition
- the new positionattach
- the new attachmentMethod Detail |
---|
public boolean canExecute()
canExecute
in class org.eclipse.gef.commands.Command
Command.canExecute()
public void execute()
execute
in class org.eclipse.gef.commands.Command
Command.execute()
public void redo()
redo
in class org.eclipse.gef.commands.Command
Command.redo()
protected void redoModel()
public void undo()
undo
in class org.eclipse.gef.commands.Command
Command.undo()
protected void undoModel()
protected int calculateChildAttachment(org.eclipse.draw2d.geometry.Point loc, org.eclipse.draw2d.geometry.Rectangle container)
Point
) and
its container (Rectangle
)
loc
- the location where the user has clicked in the container
coordinates.container
- the container Figure
PositionConstant
|
SAM | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.