com.jgraph.layout.demo
Class JGraphLayoutMorphingManager

java.lang.Object
  extended by com.jgraph.layout.demo.JGraphLayoutMorphingManager
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class JGraphLayoutMorphingManager
extends java.lang.Object
implements java.awt.event.ActionListener

Animation for simple graph changes (moves). This takes a nested map and animates the change visually so the vertices appear to float to their new locations. This implementation only takes into account new positions of vertices, sizes, colors etc are changed after the animation in a single step.
Note: This class is not thread-safe.


Constructor Summary
JGraphLayoutMorphingManager()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Invoked to perform an animation step and stop the timer if all animation steps have been performed.
static void fitViewport(org.jgraph.JGraph graph)
           
 void morph(org.jgraph.JGraph graph, java.util.Map nestedMap)
          Animates the graph so that all vertices move from their current location to the new location stored in the nested map.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGraphLayoutMorphingManager

public JGraphLayoutMorphingManager()
Method Detail

morph

public void morph(org.jgraph.JGraph graph,
                  java.util.Map nestedMap)
Animates the graph so that all vertices move from their current location to the new location stored in the nested map. This sets the nestedMap and graph variable and spawns a timer process. While the timer is running, further method calls are ignored. The call will return immediately.

Parameters:
nestedMap - The nested map that defines the new locations.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Invoked to perform an animation step and stop the timer if all animation steps have been performed.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
event - The object that describes the event.

fitViewport

public static void fitViewport(org.jgraph.JGraph graph)