|
JGraphpad Pro
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jgraph.pad.util.JGraphpadMorphingManager
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.
| Field Summary | |
protected Shape |
clip
Holds the clipping shape to be used for repainting the graph. |
protected org.jgraph.graph.CellView[] |
context
Holds the context cells, eg the edges connected to the animated cells or one of their parents. |
protected int |
delay
Specifies the delay between morphing steps in milliseconds. |
protected org.jgraph.JGraph |
graph
References the graph to be morphed. |
protected Map |
nestedMap
Holds the original nested map for the final execute step. |
protected Map |
newBounds
Holds the current and final bounds of the animation. |
protected Map |
oldBounds
Holds the current and final bounds of the animation. |
protected int |
step
Holds the current morhing step. |
protected int |
steps
Specifies the number of animation steps. |
| Constructor Summary | |
JGraphpadMorphingManager()
|
|
| Method Summary | |
void |
actionPerformed(ActionEvent event)
Invoked to perform an animation step and stop the timer if all animation steps have been performed. |
protected void |
execute()
Executes the actual change on the graph layout cache. |
protected void |
initialize()
Initializes the datastructures required for the animation. |
protected boolean |
isAnimatable(Object cell)
Hook for subclassers to determine whether the specified cell should be animated. |
void |
morph(org.jgraph.JGraph graph,
Map nestedMap)
Animates the graph so that all vertices move from their current location to the new location stored in the nested map. |
protected void |
setCellBounds(Object cell,
Rectangle2D bounds)
Sets the bounds for the specified cell. |
protected void |
updateCell(Object cell)
Updates the specified cell for step. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int delay
protected int steps
protected org.jgraph.JGraph graph
protected transient int step
protected transient Map oldBounds
protected transient Map newBounds
protected transient org.jgraph.graph.CellView[] context
protected transient Shape clip
protected transient Map nestedMap
| Constructor Detail |
public JGraphpadMorphingManager()
| Method Detail |
public void morph(org.jgraph.JGraph graph,
Map nestedMap)
nestedMap and graph variable and spawns a timer
process. While the timer is running, further method calls are ignored.
The call will return immediately.
nestedMap - The nested map that defines the new locations.protected boolean isAnimatable(Object cell)
cell - The cells to be checked.
protected void initialize()
isAnimatable(Object) returns false
then the cell is moved to it's final location in the first animation
step.
public void actionPerformed(ActionEvent event)
actionPerformed in interface ActionListenerevent - The object that describes the event.protected void execute()
protected void updateCell(Object cell)
step. This implementation moves
the cell by a single increment towards it's final location using
setCellBounds(Object, Rectangle2D) to update the cell's bounds.
cell - The cell to be updated.
protected void setCellBounds(Object cell,
Rectangle2D bounds)
cell - The cell whose bounds to set.bounds - The new bounds of the cell.
|
JGraphpad Pro
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||