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

java.lang.Object
  extended byorg.eclipse.gef.commands.Command
      extended byuk.ac.kcl.cch.jb.pliny.commands.MoveLinkEndCommand

public class MoveLinkEndCommand
extends org.eclipse.gef.commands.Command

changes either end (source or target) of a Link from one LinkableObject to another. At least one of setToEnd or setFromEnd must be used before the command is execuated to specify an end to change.

Author:
John Bradley

Constructor Summary
MoveLinkEndCommand(Link link)
          creates an instance of this command, and provides the Link to which it is to apply.
 
Method Summary
 void execute()
           
 LinkableObject getFromEnd()
           
 LinkableObject getToEnd()
           
 void setFromEnd(LinkableObject object)
          specify the new source LinkableObject for the link.
 void setToEnd(LinkableObject object)
          specify the new target LinkableObject for the link.
 void undo()
           
 
Methods inherited from class org.eclipse.gef.commands.Command
canExecute, canUndo, chain, dispose, getDebugLabel, getLabel, redo, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoveLinkEndCommand

public MoveLinkEndCommand(Link link)
creates an instance of this command, and provides the Link to which it is to apply.

Parameters:
link - the link for which an end is to change.
Method Detail

setToEnd

public void setToEnd(LinkableObject object)
specify the new target LinkableObject for the link.

Parameters:
object - target end

getToEnd

public LinkableObject getToEnd()

getFromEnd

public LinkableObject getFromEnd()

setFromEnd

public void setFromEnd(LinkableObject object)
specify the new source LinkableObject for the link.

Parameters:
object - target end

execute

public void execute()

undo

public void undo()