info.aduna.clustermap.panel.anim
Class FrameRenderer

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

public class FrameRenderer
extends Object

A FrameRenderer is responsible for drawing single animation frames when requested by an AnimationHandler.


Nested Class Summary
static class FrameRenderer.AlphaImageKey
           
 
Constructor Summary
FrameRenderer(RenderingProperties properties)
           
 
Method Summary
 void cleanUp()
          Instructs the FrameRenderer to clean up any intermediate results resulting from the prepareFor method.
 Rectangle getCurrentBounds()
          Returns the current bounding box of the graph.
 long getNeededDuration()
          Returns how long the animation will take, in milliseconds.
 void paint(Graphics2D g)
          Paints a single animation frame using the specified Graphics2D context.
 void prepareFor(Graph oldGraph, Graph newGraph, long allowedDuration)
          Prepare the FrameRenderer for rendering an animated transition between the two Graphs, with the specified maximum duration in milliseconds.
 void prepareForFrame(long timeProgressed)
          Prepares the FrameRenderer for painting the frame corresponding with the specified timestamp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrameRenderer

public FrameRenderer(RenderingProperties properties)
Method Detail

prepareFor

public void prepareFor(Graph oldGraph,
                       Graph newGraph,
                       long allowedDuration)
Prepare the FrameRenderer for rendering an animated transition between the two Graphs, with the specified maximum duration in milliseconds.


cleanUp

public void cleanUp()
Instructs the FrameRenderer to clean up any intermediate results resulting from the prepareFor method.


prepareForFrame

public void prepareForFrame(long timeProgressed)
Prepares the FrameRenderer for painting the frame corresponding with the specified timestamp. This timestamp indicates how many milliseconds have passes since the beginning of the animation.


getCurrentBounds

public Rectangle getCurrentBounds()
Returns the current bounding box of the graph. During the first and last phase this equals the bounding box of the old or the new graph respectively. During the second phase it is a scaled instance of these bounding boxes.


paint

public void paint(Graphics2D g)
Paints a single animation frame using the specified Graphics2D context. This requires that the prepareForFrame method has been invoked with the correct timestamp.


getNeededDuration

public long getNeededDuration()
Returns how long the animation will take, in milliseconds. This should be a number less than or equal to the allowed duration specified in the prepareFor method.



Copyright © 1997-2008 Aduna. All Rights Reserved.