org.newdawn.slick.svg
Class SVGMorph

java.lang.Object
  extended by org.newdawn.slick.svg.Diagram
      extended by org.newdawn.slick.svg.SVGMorph

public class SVGMorph
extends Diagram

A utility to allow morphing between a set of similar SVG diagrams

Author:
kevin

Constructor Summary
SVGMorph(Diagram diagram)
          Create a new morph with a first diagram base
 
Method Summary
 void addStep(Diagram diagram)
          Add a subsquent step to the morphing
 Figure getFigure(int index)
          Get the figure at a given index
 int getFigureCount()
          Get the number of figures in the diagram
 void setExternalDiagram(Diagram diagram)
          Set the current diagram we should morph from.
 void setMorphTime(float time)
          Set the "time" index for this morph.
 void updateMorphTime(float delta)
          Update the morph time index by the amount specified
 
Methods inherited from class org.newdawn.slick.svg.Diagram
addFigure, addGradient, addPatternDef, getFigureByID, getGradient, getHeight, getPatternDef, getPatternDefNames, getWidth, removeFigure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVGMorph

public SVGMorph(Diagram diagram)
Create a new morph with a first diagram base

Parameters:
diagram - The base diagram which provides the first step of the morph
Method Detail

addStep

public void addStep(Diagram diagram)
Add a subsquent step to the morphing

Parameters:
diagram - The diagram to add as the next step in the morph

setExternalDiagram

public void setExternalDiagram(Diagram diagram)
Set the current diagram we should morph from. This only really works with updateMorphTime() but can be used for smooth transitions between morphs.

Parameters:
diagram - The diagram to use as the base of the morph

updateMorphTime

public void updateMorphTime(float delta)
Update the morph time index by the amount specified

Parameters:
delta - The amount to update the morph by

setMorphTime

public void setMorphTime(float time)
Set the "time" index for this morph. This is given in terms of diagrams, so 0.5f would give you the position half way between the first and second diagrams.

Parameters:
time - The time index to represent on this diagrams

getFigureCount

public int getFigureCount()
Description copied from class: Diagram
Get the number of figures in the diagram

Overrides:
getFigureCount in class Diagram
Returns:
The number of figures in the diagram
See Also:
Diagram.getFigureCount()

getFigure

public Figure getFigure(int index)
Description copied from class: Diagram
Get the figure at a given index

Overrides:
getFigure in class Diagram
Parameters:
index - The index of the figure to retrieve
Returns:
The figure at the given index
See Also:
Diagram.getFigure(int)


Copyright © 2006 New Dawn Software. All Rights Reserved.