|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.gui.treevisualizer.PlaceNode1
This class will place the Nodes of a tree.
It will place these nodes so that they symetrically fill each row. This is simple to calculate but is not visually nice for most trees.
Field Summary | |
private int[] |
m_levelNode
An array containing the current node place for each level to place each node accordingly. |
private double[] |
m_levels
An array containing the spacing value for each level |
private int |
m_noLevels
The number of levels in the tree |
private double |
m_yRatio
The distance between each level. |
Constructor Summary | |
PlaceNode1()
|
Method Summary | |
void |
place(Node r)
Call this function to have each node in the tree starting at 'r' placed in a visual (not logical, they already are) tree position. |
private void |
placer(Node r,
int l)
This function goes through and sets the position of each node |
private void |
setNumOfNodes(Node r,
int l)
This function finds the number of nodes on each level recursively. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private double[] m_levels
private int m_noLevels
private int[] m_levelNode
private double m_yRatio
Constructor Detail |
public PlaceNode1()
Method Detail |
public void place(Node r)
place
in interface NodePlace
r
- The top of the tree.private void setNumOfNodes(Node r, int l)
r
- The current Node upto.l
- The current level upto.private void placer(Node r, int l)
r
- The current node upto.l
- the current level upto.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |