Activate animation during a graph layout with JViews Diagrammer

Article ID: 2282
Last updated: 29 May, 2018
Article ID: 2282
Last updated: 29 May, 2018
Revision: 3
Views: 570
Posted: 15 Jul, 2005
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

How do I implement animation during a graph layout with JViews Diagrammer?

Answer

The IlvAnimationRenderer is designed to display an animation showing how the nodes of the graph have moved during the last rendering step. When this renderer is used with an IlvGraphLayoutRenderer, the animation shows how the nodes have been placed by the graph layout algorithm.

You can add the IlvAnimationRenderer to the engine of the IlvDiagrammer component by using the following code:

IlvSDMEngine engine = diagrammer.getEngine();
IlvAnimationRenderer animationRenderer = new IlvAnimationRenderer(engine.getRenderer());
animationRenderer.setResizingObjects(false);
engine.setRenderer(animationRenderer);

This can also be done in a CSS file as follows:

SDM { 
... 
GraphLayout : "true" ;
Animation : "true"; 
} 
Animation {
enabled : "true"; 
animationRate : "20"; 
animationDelay : "20"; 
resizingObjects : "false"; 
} 
GraphLayout { ... }  

Note: The parameter resizingObjects can be true or false. However, when composites (IlvSDMCompositeNode) are used, the parameter must be true.

The webviewer sample in the distribution demonstrates how you can further customize the animation renderer.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2282
Last updated: 29 May, 2018
Revision: 3
Views: 570
Posted: 15 Jul, 2005 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category