Package org.abego.treelayout
Class TreeLayout.NormalizedPosition
- java.lang.Object
-
- java.awt.geom.Point2D
-
- org.abego.treelayout.TreeLayout.NormalizedPosition
-
- All Implemented Interfaces:
java.lang.Cloneable
- Enclosing class:
- TreeLayout<TreeNode>
private class TreeLayout.NormalizedPosition extends java.awt.geom.Point2DThe algorithm calculates the position starting with the root at 0. I.e. the left children will get negative positions. However we want the result to be normalized to (0,0).TreeLayout.NormalizedPositionwill normalize the position (given relative to the root position), taking the current bounds into account. This way the left most node bounds will start at x = 0, the top most node bounds at y = 0.
-
-
Field Summary
Fields Modifier and Type Field Description private doublex_relativeToRootprivate doubley_relativeToRoot
-
Constructor Summary
Constructors Constructor Description NormalizedPosition(double x_relativeToRoot, double y_relativeToRoot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetX()doublegetY()voidsetLocation(double x_relativeToRoot, double y_relativeToRoot)
-
-
-
Method Detail
-
getX
public double getX()
- Specified by:
getXin classjava.awt.geom.Point2D
-
getY
public double getY()
- Specified by:
getYin classjava.awt.geom.Point2D
-
setLocation
public void setLocation(double x_relativeToRoot, double y_relativeToRoot)- Specified by:
setLocationin classjava.awt.geom.Point2D
-
-