org.jgraph.layout
Class RadialTreeLayoutAlgorithm

java.lang.Object
  extended byorg.jgraph.layout.JGraphLayoutAlgorithm
      extended byorg.jgraph.layout.RadialTreeLayoutAlgorithm

public class RadialTreeLayoutAlgorithm
extends JGraphLayoutAlgorithm

Lays out the nodes in a graph as a radial tree (root at the centre, children in concentric ovals).

The layout algorithm is similar to that described in the paper "Radial Tree Graph Drawing Algorithm for Representing Large Hierarchies" by Greg Book and Neeta Keshary.

The algorithm is modified from that in the above paper since it contains bugs and the sample code contains major inefficiencies.

Since this algorithm needs to be applied to a tree but we have a directed graph, a spanning tree is first constructed then the algorithm is applied to it.

Since:
3.1

Field Summary
protected  double HEIGHT
           
static java.lang.String KEY_CENTRE_X
          Property key for specifying the X-axis coordinate of the centre of the layout.
static java.lang.String KEY_CENTRE_Y
          Property key for specifying the Y-axis coordinate of the centre of the layout.
static java.lang.String KEY_HEIGHT
          Property key for specifying maximum height of layout area.
static java.lang.String KEY_RADIUS_X
          Property key for specifying the maximum horizontal distance between a parent and child node.
static java.lang.String KEY_RADIUS_Y
          Property key for specifying the maximum vertical distance between a parent and child node.
static java.lang.String KEY_WIDTH
          Property key for specifying maximum width of layout area.
protected  double RADIUSX
           
protected  double RADIUSY
           
protected  double ROOTX
           
protected  double ROOTY
           
protected  double WIDTH
           
 
Fields inherited from class org.jgraph.layout.JGraphLayoutAlgorithm
LAYOUT_ATTRIBUTES
 
Constructor Summary
RadialTreeLayoutAlgorithm()
           
 
Method Summary
 JGraphLayoutSettings createSettings()
          Returns an new instance of SugiyamaLayoutSettings
 java.lang.String getHint()
          Get a human readable hint for using this layout.
 void run(JGraph graph, java.lang.Object[] dynamic_cells, java.lang.Object[] static_cells)
          Applies a radial tree layout to nodes in the jgraph with respect to the supplied configuration.
 void setConfiguration(java.util.Properties configuration)
           
 java.lang.String toString()
          Returns the name of this algorithm in human readable form.
 
Methods inherited from class org.jgraph.layout.JGraphLayoutAlgorithm
applyLayout, applyLayout, createDialog, createDialog, getMaximumProgress, getProgress, isAllowedToRun, populateDialog, run, setAllowedToRun, setMaximumProgress, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_WIDTH

public static final java.lang.String KEY_WIDTH
Property key for specifying maximum width of layout area. If WIDTH is specified, then CENTRE_X and RADIUS_X are calculated from it based on the maximum depth of the spanning tree.

See Also:
Constant Field Values

KEY_HEIGHT

public static final java.lang.String KEY_HEIGHT
Property key for specifying maximum height of layout area. If HEIGHT is specified, then CENTRE_Y and RADIUS_Y are calculated from it based on the maximum depth of the spanning tree.

See Also:
Constant Field Values

KEY_CENTRE_X

public static final java.lang.String KEY_CENTRE_X
Property key for specifying the X-axis coordinate of the centre of the layout. If WIDTH is specified, then the supplied value is ignored and CENTRE_X is calculated from it based on the maximum depth of the spanning tree.

See Also:
Constant Field Values

KEY_CENTRE_Y

public static final java.lang.String KEY_CENTRE_Y
Property key for specifying the Y-axis coordinate of the centre of the layout. If HEIGHT is specified, then the supplied value is ignored and CENTRE_Y is calculated from it based on the maximum depth of the spanning tree.

See Also:
Constant Field Values

KEY_RADIUS_X

public static final java.lang.String KEY_RADIUS_X
Property key for specifying the maximum horizontal distance between a parent and child node. If WIDTH is specified, then the supplied value is ignored and RADIUS_X is calculated from it based on the maximum depth of the spanning tree.

See Also:
Constant Field Values

KEY_RADIUS_Y

public static final java.lang.String KEY_RADIUS_Y
Property key for specifying the maximum vertical distance between a parent and child node. If WIDTH is specified, then the supplied value is ignored and RADIUS_X is calculated from it based on the maximum depth of the spanning tree.

See Also:
Constant Field Values

RADIUSX

protected double RADIUSX

RADIUSY

protected double RADIUSY

ROOTX

protected double ROOTX

ROOTY

protected double ROOTY

WIDTH

protected double WIDTH

HEIGHT

protected double HEIGHT
Constructor Detail

RadialTreeLayoutAlgorithm

public RadialTreeLayoutAlgorithm()
Method Detail

toString

public java.lang.String toString()
Returns the name of this algorithm in human readable form.


getHint

public java.lang.String getHint()
Get a human readable hint for using this layout.

Overrides:
getHint in class JGraphLayoutAlgorithm

createSettings

public JGraphLayoutSettings createSettings()
Returns an new instance of SugiyamaLayoutSettings

Overrides:
createSettings in class JGraphLayoutAlgorithm

run

public void run(JGraph graph,
                java.lang.Object[] dynamic_cells,
                java.lang.Object[] static_cells)
Applies a radial tree layout to nodes in the jgraph with respect to the supplied configuration.

Specified by:
run in class JGraphLayoutAlgorithm
Parameters:
graph - JGraph instance
dynamic_cells - List of all nodes the layout should move
static_cells - List of node the layout should not move but allow for

setConfiguration

public void setConfiguration(java.util.Properties configuration)