com.jgraph.layout.tree

Class JGraphRadialTreeLayout

public class JGraphRadialTreeLayout extends Object implements JGraphLayout

Lays out the nodes in a graph as a radial tree (root at the centre, children in concentric ovals).
Field Summary
protected doubleangleOffset
The initial offset to compute the angle position.
protected booleanautoRadius
Specifies if the radios should be computed automatically.
protected doublemaxradiusx
Specifies the minimum and maximum autoradius
protected doublemaxradiusy
Specifies the minimum and maximum autoradius
protected doubleminradiusx
Specifies the minimum and maximum autoradius
protected doubleminradiusy
Specifies the minimum and maximum autoradius
protected booleanmoveRoots
Specifies whether root cells should be moved.
protected Mapnodes
Store of mapping from tree nodes to graph cells
protected doubleradiusx
x-axis radius of each circle
protected doubleradiusy
y-axis radius of each circle
protected doublerootx
x-axis root of the layout
protected doublerooty
y-axis root of the layout
protected ObjectvirtualRootCell
An object that may be used as a key for a virtual root.
Method Summary
doublegetAngleOffset()
doublegetMaxradiusx()
doublegetMaxradiusy()
doublegetMinradiusx()
doublegetMinradiusy()
doublegetRadiusx()
doublegetRadiusy()
JGraphRadialTreeLayout.TreeNodegetTreeNode(Object cell)
booleanisAutoRadius()
booleanisMoveRoots()
voidrun(JGraphFacade graph)
Applies a radial tree layout to nodes in the jgraph with respect to the supplied configuration.
voidsetAngleOffset(double angleOffset)
voidsetAutoRadius(boolean autoRadius)
voidsetMaxradiusx(double maxradiusx)
voidsetMaxradiusy(double maxradiusy)
voidsetMinradiusx(double minradiusx)
voidsetMinradiusy(double minradiusy)
voidsetMoveRoots(boolean moveRoots)
voidsetRadiusx(double radiusx)
voidsetRadiusy(double radiusy)
StringtoString()
Returns Radialtree, the name of this algorithm.

Field Detail

angleOffset

protected double angleOffset
The initial offset to compute the angle position.

autoRadius

protected boolean autoRadius
Specifies if the radios should be computed automatically.

maxradiusx

protected double maxradiusx
Specifies the minimum and maximum autoradius

maxradiusy

protected double maxradiusy
Specifies the minimum and maximum autoradius

minradiusx

protected double minradiusx
Specifies the minimum and maximum autoradius

minradiusy

protected double minradiusy
Specifies the minimum and maximum autoradius

moveRoots

protected boolean moveRoots
Specifies whether root cells should be moved. Note: Single roots are never moved by this layout.

nodes

protected transient Map nodes
Store of mapping from tree nodes to graph cells

radiusx

protected double radiusx
x-axis radius of each circle

radiusy

protected double radiusy
y-axis radius of each circle

rootx

protected double rootx
x-axis root of the layout

rooty

protected double rooty
y-axis root of the layout

virtualRootCell

protected Object virtualRootCell
An object that may be used as a key for a virtual root.

Method Detail

getAngleOffset

public double getAngleOffset()

Returns: Returns the angleOffset.

getMaxradiusx

public double getMaxradiusx()

Returns: Returns the maxradiusx.

getMaxradiusy

public double getMaxradiusy()

Returns: Returns the maxradiusy.

getMinradiusx

public double getMinradiusx()

Returns: Returns the minradiusx.

getMinradiusy

public double getMinradiusy()

Returns: Returns the minradiusy.

getRadiusx

public double getRadiusx()

Returns: the value of radiusx

getRadiusy

public double getRadiusy()

Returns: the value of radiusy

getTreeNode

public JGraphRadialTreeLayout.TreeNode getTreeNode(Object cell)

Parameters: cell the cell whose tree node is to be obtained

Returns: the tree node corresponding to the specified cell

isAutoRadius

public boolean isAutoRadius()

Returns: Returns the autoRadius.

isMoveRoots

public boolean isMoveRoots()

Returns: Returns the moveRoots.

run

public void run(JGraphFacade graph)
Applies a radial tree layout to nodes in the jgraph with respect to the supplied configuration.

Parameters: graph the facade describing the graph and its configuration

setAngleOffset

public void setAngleOffset(double angleOffset)

Parameters: angleOffset The angleOffset to set.

setAutoRadius

public void setAutoRadius(boolean autoRadius)

Parameters: autoRadius The autoRadius to set.

setMaxradiusx

public void setMaxradiusx(double maxradiusx)

Parameters: maxradiusx The maxradiusx to set.

setMaxradiusy

public void setMaxradiusy(double maxradiusy)

Parameters: maxradiusy The maxradiusy to set.

setMinradiusx

public void setMinradiusx(double minradiusx)

Parameters: minradiusx The minradiusx to set.

setMinradiusy

public void setMinradiusy(double minradiusy)

Parameters: minradiusy The minradiusy to set.

setMoveRoots

public void setMoveRoots(boolean moveRoots)

Parameters: moveRoots The moveRoots to set.

setRadiusx

public void setRadiusx(double radiusx)

Parameters: radiusx value to set radiusx to

setRadiusy

public void setRadiusy(double radiusy)

Parameters: radiusy value to set radiusx to

toString

public String toString()
Returns Radialtree, the name of this algorithm.
Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.