de.uka.algo.algovis3d.quanten
Class ChangeVertexLocationAbsolutely

java.lang.Object
  extended by de.uka.algo.algovis3d.quanten.ChangeVertexLocationAbsolutely
All Implemented Interfaces:
VisualizationQuantum

public class ChangeVertexLocationAbsolutely
extends java.lang.Object
implements VisualizationQuantum

This quantum changes the location of one vertex or a set of vertices to the given absolute location. A translation of one vertex can also be animated by setting the animate flag in the fitting constructor.

Author:
ITI, Universitaet Karlsruhe (TH) - Florian Boehl
See Also:
VisualizationQuantum, Graph

Constructor Summary
ChangeVertexLocationAbsolutely(java.util.Set<edu.uci.ics.jung.graph.Vertex> vertices, javax.vecmath.Vector3f location)
          Translates all vertices to location.
ChangeVertexLocationAbsolutely(edu.uci.ics.jung.graph.Vertex vertex, javax.vecmath.Vector3f location)
          Translates the vertex immediatly to location.
ChangeVertexLocationAbsolutely(edu.uci.ics.jung.graph.Vertex vertex, javax.vecmath.Vector3f location, boolean animate)
          Translates the vertex to location.
 
Method Summary
 void apply(Visualizer visualizer)
          Applies the quantum on the given visualizer and remembers the state of the objects, that were changed.
 void reset()
           
 java.lang.String toString()
           
 void undo(Visualizer visualizer)
          Undoes the changes on the given visualizer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChangeVertexLocationAbsolutely

public ChangeVertexLocationAbsolutely(edu.uci.ics.jung.graph.Vertex vertex,
                                      javax.vecmath.Vector3f location)
Translates the vertex immediatly to location.

Parameters:
vertex - The target
location - The new location

ChangeVertexLocationAbsolutely

public ChangeVertexLocationAbsolutely(edu.uci.ics.jung.graph.Vertex vertex,
                                      javax.vecmath.Vector3f location,
                                      boolean animate)
Translates the vertex to location. If animate is true, the vertex will not be translated to its new location immediately but slide into position.

Parameters:
vertex - The target
location - The new location
animate - Shall it be an animated translation?

ChangeVertexLocationAbsolutely

public ChangeVertexLocationAbsolutely(java.util.Set<edu.uci.ics.jung.graph.Vertex> vertices,
                                      javax.vecmath.Vector3f location)
Translates all vertices to location. (If undo() is called on this object, the location of every target vertex will be set to its old one). Unfortunately, animation is not possible because only one vertex can animated at the same time.

Parameters:
vertices - The targets
location - The new location
Method Detail

apply

public void apply(Visualizer visualizer)
Description copied from interface: VisualizationQuantum
Applies the quantum on the given visualizer and remembers the state of the objects, that were changed.

Specified by:
apply in interface VisualizationQuantum
Parameters:
visualizer - The visualizer object the quantum is applied on.

undo

public void undo(Visualizer visualizer)
Description copied from interface: VisualizationQuantum
Undoes the changes on the given visualizer. That means the during the apply() call remembered state will be restored.

Specified by:
undo in interface VisualizationQuantum
Parameters:
visualizer - The visualizer object the quantum is undone on.

reset

public void reset()
Specified by:
reset in interface VisualizationQuantum

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object