org.grinvin.gred.undoable
Class ChangeCoordinates
- UndoableChange
public class ChangeCoordinates
Undoable change for moving elements in a graph.
void | addMovement(Vertex v, double[] oldCoordinates, double[] newCoordinates) - Add a movement of the given vertex form old to new coordinates.
|
void | redo() - Revertes an undo by moving all vertices to their new positions.
|
void | undo() - Undoes the effect of this change by moving all vertices back to their
original position.
|
ChangeCoordinates
public ChangeCoordinates(Embedding embedding,
String key)
embedding
- Corresponding embeddingkey
- Resource key for the undo/redo captions for this move
addMovement
public void addMovement(Vertex v,
double[] oldCoordinates,
double[] newCoordinates)
Add a movement of the given vertex form old to new coordinates. If boths sets
of coordinates are exactly the same, then no operation is performed.