uk.ac.kcl.cch.jb.pliny.commands
Class AddLinkableObjectsCommand
java.lang.Object
org.eclipse.gef.commands.Command
uk.ac.kcl.cch.jb.pliny.commands.AddLinkableObjectsCommand
- public class AddLinkableObjectsCommand
- extends org.eclipse.gef.commands.Command
This command provides the mechanism for the adding of LinkableObjects
that have been moved from one container to another (what GEF calls
're-parenting'). Re-parenting in GEF involves two commands -- one
to remove the item from its old parent (called 'orphaning') and then a second
to reconnect the item to its new parent. It is this second operation that
is defined here.
These commands are invoked from GEF policy objects method
createAddCommand
in GEF's XYLayoutEditPolicy
or ContainerEditPolicy
.
- Author:
- John Bradley
- See Also:
LinkableObjectContainerEditPolicy.createAddCommand(org.eclipse.gef.Request, org.eclipse.gef.EditPart, java.lang.Object)
,
ResourceObjectsXYLayoutPolicy.createAddCommand(org.eclipse.gef.Request, org.eclipse.gef.EditPart, java.lang.Object)
Methods inherited from class org.eclipse.gef.commands.Command |
canExecute, 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 |
AddLinkableObjectsCommand
public AddLinkableObjectsCommand(LinkableObject newContainer,
Resource resource,
LinkableObject draggedObject,
org.eclipse.draw2d.geometry.Rectangle rect)
- the constructor used in the policy code to set up this command.
- Parameters:
newContainer
- the new parent objectresource
- the new parent objects 'suffogateFor' resourcedraggedObject
- the LinkableObject being draggedrect
- position for new linkable object
execute
public void execute()
undo
public void undo()
redo
public void redo()