com.uppaal.model.core2
Class TranslationCommand

java.lang.Object
  extended by com.uppaal.model.core2.AbstractCommand
      extended by com.uppaal.model.core2.AbstractTransaction
          extended by com.uppaal.model.core2.TranslationCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
TranslationMessageLabelCommand, TranslationXCommand, TranslationYCommand

public class TranslationCommand
extends AbstractTransaction

Translates (in the geometrical meaning) a set of elements.


Field Summary
protected  ArrayList<Element> elements
           
protected  int xd
           
protected  int yd
           
 
Fields inherited from class com.uppaal.model.core2.AbstractTransaction
committed, document
 
Fields inherited from class com.uppaal.model.core2.AbstractCommand
version
 
Constructor Summary
TranslationCommand(Document document, ArrayList<Element> elements)
           
 
Method Summary
protected  void doCancel()
          Undo the translation.
protected  void doExecute()
           
protected  void doUndo()
           
 Element getModifiedElement()
           
 void move(int x, int y)
          Move elements by (x, y).
protected  void moveElements(int x, int y)
           
 
Methods inherited from class com.uppaal.model.core2.AbstractTransaction
cancel, commit, execute, undo
 
Methods inherited from class com.uppaal.model.core2.AbstractCommand
getVersion, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elements

protected ArrayList<Element> elements

xd

protected int xd

yd

protected int yd
Constructor Detail

TranslationCommand

public TranslationCommand(Document document,
                          ArrayList<Element> elements)
Method Detail

moveElements

protected void moveElements(int x,
                            int y)

move

public void move(int x,
                 int y)
Move elements by (x, y). This method can be called repeatedly as long as the translation has not been committed. The elements are actually moved, so change events are propagated.

Overrides:
move in class AbstractTransaction

doCancel

protected void doCancel()
Undo the translation. All elements are moved back to their original position. The translation can only be cancelled as long as it has not been committed.

Specified by:
doCancel in class AbstractTransaction

doExecute

protected void doExecute()
Specified by:
doExecute in class AbstractTransaction

doUndo

protected void doUndo()
Specified by:
doUndo in class AbstractTransaction

getModifiedElement

public Element getModifiedElement()
Returns:
the modified element or its closest relative (sibling or parent) if the element is not displayed.


Copyright © 2012 Uppsala University and Aalborg University. All Rights Reserved.