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.Point2D
The 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.NormalizedPosition
will 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 double
x_relativeToRoot
private double
y_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 double
getX()
double
getY()
void
setLocation(double x_relativeToRoot, double y_relativeToRoot)
-
-
-
Method Detail
-
getX
public double getX()
- Specified by:
getX
in classjava.awt.geom.Point2D
-
getY
public double getY()
- Specified by:
getY
in classjava.awt.geom.Point2D
-
setLocation
public void setLocation(double x_relativeToRoot, double y_relativeToRoot)
- Specified by:
setLocation
in classjava.awt.geom.Point2D
-
-