Class TreeLayout.NormalizedPosition

java.lang.Object
java.awt.geom.Point2D
org.abego.treelayout.TreeLayout.NormalizedPosition
All Implemented Interfaces:
Cloneable
Enclosing class:
TreeLayout<TreeNode>

private class TreeLayout.NormalizedPosition extends 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<TreeNode>.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 Details

    • x_relativeToRoot

      private double x_relativeToRoot
    • y_relativeToRoot

      private double y_relativeToRoot
  • Constructor Details

    • NormalizedPosition

      public NormalizedPosition(double x_relativeToRoot, double y_relativeToRoot)
  • Method Details

    • getX

      public double getX()
      Specified by:
      getX in class Point2D
    • getY

      public double getY()
      Specified by:
      getY in class Point2D
    • setLocation

      public void setLocation(double x_relativeToRoot, double y_relativeToRoot)
      Specified by:
      setLocation in class Point2D