Top Description Inners Methods
org.abego.treelayout

public Interface Configuration<TreeNode>

Known Direct Implementers
org.abego.treelayout.util.DefaultConfiguration
Type Parameters
<TreeNode>
Type of elements used as nodes in the tree

Used to configure the tree layout algorithm.

Also see this overview.

Author
Udo Borkowski ([email protected])

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Configuration.AlignmentInLevel

Possible alignments of a node within a level (centered, towards or away from root)

public static enum
Configuration.Location

Identifies the sides of a rectangle (top, left, ...)

Method Summary

Modifier and TypeMethod and Description
public Configuration.AlignmentInLevel

Returns:

the alignment of "smaller" nodes within a level
getAlignmentInLevel
()

Returns the alignment of "smaller" nodes within a level.

public double

Returns:

the size of the gap between level (nextLevel-1) and nextLevel [result >= 0]
getGapBetweenLevels
(int
[nextLevel > 0]
nextLevel
)

Returns the size of the gap between subsequent levels.

public double

Returns:

the minimal size of the gap between node1 and node2 [result >= 0]
getGapBetweenNodes
(TreeNode
 
node1
,
TreeNode
 
node2
)

Returns the size of the minimal gap of nodes within a level.

public Configuration.Location

Returns:

the position of the root node in the diagram
getRootLocation
()

Returns the position of the root node in the diagram.

Method Detail

getAlignmentInLevelback to summary
public Configuration.AlignmentInLevel getAlignmentInLevel()

Returns the alignment of "smaller" nodes within a level.

By default all nodes of one level are centered in the level. However one may also align them "towards the root" or "away from the root". When the root is located at the top this means the nodes are aligned "to the top of the level" or "to the bottom of the level".

Alignment in level when root is at the top
Center (Default) TowardsRoot ("top of level") AwayFromRoot ("bottom of level")
Tree with root at top and nodes center aligned Tree with root at top and nodes aligned to top Tree with root at top and nodes aligned to bottom

Alignment in level when root is at the left:

Table: Possible Alignments of Nodes (when root at left side)
Center (Default) TowardsRoot ("left of level") AwayFromRoot
("right of level")
Tree with root at left side and nodes center aligned Tree with root at left side and nodes left aligned Tree with root at left side and nodes right aligned

Of cause the alignment also works when the root is at the bottom or at the right side.

Returns:Configuration.AlignmentInLevel

the alignment of "smaller" nodes within a level

getGapBetweenLevelsback to summary
public double getGapBetweenLevels(int nextLevel)

Returns the size of the gap between subsequent levels.

gapBetweenLevels Visualization

Parameters
nextLevel:int

[nextLevel > 0]

Returns:double

the size of the gap between level (nextLevel-1) and nextLevel [result >= 0]

getGapBetweenNodesback to summary
public double getGapBetweenNodes(TreeNode node1, TreeNode node2)

Returns the size of the minimal gap of nodes within a level.

In the layout there will be a gap of at least the returned size between both given nodes.

gapBetweenNodes Visualization

node1 and node2 are at the same level and are placed next to each other.

Parameters
node1:TreeNode

 

node2:TreeNode

 

Returns:double

the minimal size of the gap between node1 and node2 [result >= 0]

getRootLocationback to summary
public Configuration.Location getRootLocation()

Returns the position of the root node in the diagram.

By default the root of the tree is located at the top of the diagram. However one may also put it at the left, right or bottom of the diagram.

Possible Root Positions
Top (Default) Left Right Bottom
Tree with root at top Tree with root at left side Tree with root at right side Tree with root at bottom
Returns:Configuration.Location

the position of the root node in the diagram

org.abego.treelayout back to summary

public final Enum Configuration.AlignmentInLevel

extends Enum<Configuration.AlignmentInLevel>
Class Inheritance

Possible alignments of a node within a level (centered, towards or away from root)

Field Summary

Modifier and TypeField and Description
public static final Configuration.AlignmentInLevel
public static final Configuration.AlignmentInLevel
public static final Configuration.AlignmentInLevel

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Configuration.AlignmentInLevel
public static Configuration.AlignmentInLevel[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

AwayFromRootback to summary
public static final Configuration.AlignmentInLevel AwayFromRoot
Centerback to summary
public static final Configuration.AlignmentInLevel Center
TowardsRootback to summary
public static final Configuration.AlignmentInLevel TowardsRoot

Constructor Detail

AlignmentInLevelback to summary
private AlignmentInLevel()

Method Detail

valueOfback to summary
public static Configuration.AlignmentInLevel valueOf(String name)
valuesback to summary
public static Configuration.AlignmentInLevel[] values()
org.abego.treelayout back to summary

public final Enum Configuration.Location

extends Enum<Configuration.Location>
Class Inheritance

Identifies the sides of a rectangle (top, left, ...)

Field Summary

Modifier and TypeField and Description
public static final Configuration.Location
public static final Configuration.Location
public static final Configuration.Location
public static final Configuration.Location

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Configuration.Location
public static Configuration.Location[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

Bottomback to summary
public static final Configuration.Location Bottom
Leftback to summary
public static final Configuration.Location Left
Rightback to summary
public static final Configuration.Location Right
Topback to summary
public static final Configuration.Location Top

Constructor Detail

Locationback to summary
private Location()

Method Detail

valueOfback to summary
public static Configuration.Location valueOf(String name)
valuesback to summary
public static Configuration.Location[] values()