|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.gui.treevisualizer.PlaceNode2
This class will place the Nodes of a tree.
It will place these nodes so that they fall at evenly below their parent. It will then go through and look for places where nodes fall on the wrong side of other nodes when it finds one it will trace back up the tree to find the first common sibling group these two nodes have And it will adjust the spacing between these two siblings so that the two nodes no longer overlap. This is nasty to calculate with , and takes a while with the current algorithm I am using to do this.
Nested Class Summary | |
private class |
PlaceNode2.Ease
An inner class used to report information about any tangles found. |
private class |
PlaceNode2.Group
Inner class for containing the grouping data. |
private class |
PlaceNode2.Level
Inner class for containing the level data. |
Field Summary | |
private int |
m_groupNum
The Number of groups the tree has |
private PlaceNode2.Group[] |
m_groups
An array that lists the groups and information about them. |
private int |
m_levelNum
The number of levels the group tree has |
private PlaceNode2.Level[] |
m_levels
An array that lists the levels and information about them. |
private double |
m_yRatio
The space each row will take up. |
Constructor Summary | |
PlaceNode2()
|
Method Summary | |
private void |
groupBuild(Node r)
This starts to create the information about the sibling groups. |
private void |
groupFind(Node r,
int pg)
This is called to build the rest of the grouping information. |
private void |
moveSubtree(int n,
double o)
This will recursively shift a sub there to be centered about a particular value. |
private void |
nodeY(Node r)
This will set all of the children node of a particular node to their height. |
private PlaceNode2.Ease |
overlap(int l)
This will find an overlap and then return information about that overlap |
void |
place(Node r)
The Funtion to call to have the nodes arranged. |
private void |
scaleByInd()
This scales the x values to between 0 and 1 for each individual line rather than doing them all at once. |
private void |
scaleByMax()
This scales all the x values to be between 0 and 1. |
private void |
untangle()
This will untangle the nodes in the tree so that they fall on the correct side of each other. |
private void |
untangle2()
This untangles the nodes so that they will will fall on the correct side of the other nodes along their row. |
private void |
xPlacer(int start)
This will set initial places for the x coord of the nodes. |
private void |
xShift(int n)
This will shift a group of nodes to be aligned under their parent. |
private void |
yPlacer()
This function sets up the height of each node, and also fills the levels array with information about what the start and end groups on that level are. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private double m_yRatio
private PlaceNode2.Group[] m_groups
private PlaceNode2.Level[] m_levels
private int m_groupNum
private int m_levelNum
Constructor Detail |
public PlaceNode2()
Method Detail |
public void place(Node r)
place
in interface NodePlace
r
- The top node of the tree to arrange.private void xPlacer(int start)
start
- The `number for the first group to start on (I think).private void xShift(int n)
n
- The group number to shiftprivate void scaleByMax()
private void scaleByInd()
private void untangle2()
private void moveSubtree(int n, double o)
n
- The first group in the sub tree.o
- The point to start shifting the subtree.private void untangle()
private PlaceNode2.Ease overlap(int l)
l
- The level to start on.
private void yPlacer()
private void nodeY(Node r)
r
- The parent node of the children to set their height.private void groupBuild(Node r)
r
- The top node.private void groupFind(Node r, int pg)
r
- The parent of the group.pg
- The number for the parents group.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |