diva.graph.layout
Class RandomLayout

java.lang.Object
  extended by diva.graph.layout.AbstractGlobalLayout
      extended by diva.graph.layout.RandomLayout
All Implemented Interfaces:
GlobalLayout

public class RandomLayout
extends AbstractGlobalLayout

A static random layout engine. This class tries to be smart by not placing nodes on top of one another if possible, but doesn't guarantee anything about the layout except that it will fall into the required viewport.

Version:
$Id: RandomLayout.java 38798 2005-07-08 20:00:01Z cxh $
Author:
Michael Shilman
Accepted Rating:
Red

Field Summary
private static int NUM_ITER
          The number of iterations that it will try to place a node not on top of other nodes before it gives up.
 
Fields inherited from class diva.graph.layout.AbstractGlobalLayout
_layoutTarget
 
Constructor Summary
RandomLayout(LayoutTarget target)
          Simple constructor.
 
Method Summary
 void layout(java.lang.Object composite)
          Layout the graph model and viewport specified by the given target environment.
 
Methods inherited from class diva.graph.layout.AbstractGlobalLayout
getLayoutTarget, setLayoutTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_ITER

private static final int NUM_ITER
The number of iterations that it will try to place a node not on top of other nodes before it gives up.

See Also:
Constant Field Values
Constructor Detail

RandomLayout

public RandomLayout(LayoutTarget target)
Simple constructor.

Method Detail

layout

public void layout(java.lang.Object composite)
Layout the graph model and viewport specified by the given target environment. Tries to be smart by not placing nodes on top of one another if possible, but doesn't guarantee anything about the layout except that it will fall into the required viewport.

Specified by:
layout in interface GlobalLayout
Specified by:
layout in class AbstractGlobalLayout