Class 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.

    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.awt.geom.Point2D

        java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
    • 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)  
      • Methods inherited from class java.awt.geom.Point2D

        clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • x_relativeToRoot

        private double x_relativeToRoot
      • y_relativeToRoot

        private double y_relativeToRoot
    • Constructor Detail

      • NormalizedPosition

        public NormalizedPosition​(double x_relativeToRoot,
                                  double y_relativeToRoot)
    • Method Detail

      • getX

        public double getX()
        Specified by:
        getX in class java.awt.geom.Point2D
      • getY

        public double getY()
        Specified by:
        getY in class java.awt.geom.Point2D
      • setLocation

        public void setLocation​(double x_relativeToRoot,
                                double y_relativeToRoot)
        Specified by:
        setLocation in class java.awt.geom.Point2D