uk.ac.kcl.cch.jb.pliny.commands
Class AddLinkableObjectsCommand

java.lang.Object
  extended byorg.eclipse.gef.commands.Command
      extended byuk.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)

Constructor Summary
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.
 
Method Summary
 void execute()
           
 void redo()
           
 void undo()
           
 
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
 

Constructor Detail

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 object
resource - the new parent objects 'suffogateFor' resource
draggedObject - the LinkableObject being dragged
rect - position for new linkable object
Method Detail

execute

public void execute()

undo

public void undo()

redo

public void redo()