info.aduna.clustermap.panel.anim
Class AnimationHandler

java.lang.Object
  extended by info.aduna.clustermap.panel.anim.AnimationHandler

public class AnimationHandler
extends Object

AnimationHandler is responsible for rendering an animation showing the transition between two Graphs. The actual rendering of the individual frames that make up the animation is delegated to the FrameRenderer.


Constructor Summary
AnimationHandler(GraphPanel panel, ClusterMap map)
          Create a new AnimationHandler that uses the specified GraphPanel for rendering the animation frames.
 
Method Summary
 void dispose()
           
 void drawAnimationFrame(Graphics2D g, boolean determineProgress)
          Calculates the time progressed so far since the animation started and lets the FrameRenderer render the frame.
 Thread getAnimationThread()
           
 GraphPanel getGraphPanel()
           
 FrameRenderer getTransitionAnimator()
           
 boolean isAnimationInProgress()
           
 void startAnimation(Graph oldGraph, Graph newGraph)
          Starts an animation that will show the transition from an old Graph to a new Graph.
 void stopAnimation()
          Removes the timer Thread and cleans up any intermediate data structures.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnimationHandler

public AnimationHandler(GraphPanel panel,
                        ClusterMap map)
Create a new AnimationHandler that uses the specified GraphPanel for rendering the animation frames.

Method Detail

dispose

public void dispose()

getAnimationThread

public Thread getAnimationThread()

isAnimationInProgress

public boolean isAnimationInProgress()

getTransitionAnimator

public FrameRenderer getTransitionAnimator()

getGraphPanel

public GraphPanel getGraphPanel()

startAnimation

public void startAnimation(Graph oldGraph,
                           Graph newGraph)
Starts an animation that will show the transition from an old Graph to a new Graph. If this method is invoked while an animation is currently going on, then the invocation will be neglected.


stopAnimation

public void stopAnimation()
Removes the timer Thread and cleans up any intermediate data structures. This method sets a flag so that the timer Thread terminates, just in case someone else than the timer Thread invoked this method. Finally this method revalidates and repaints the GraphPanel, to make it render the Graph normally and make sure any viewports have the right size. This method will do nothing when this method is invoked when no animation is currently going on.


drawAnimationFrame

public void drawAnimationFrame(Graphics2D g,
                               boolean determineProgress)
Calculates the time progressed so far since the animation started and lets the FrameRenderer render the frame.



Copyright © 1997-2008 Aduna. All Rights Reserved.