Class AbstractTreeLocation

Direct Known Subclasses:
TreeLocationNode, TreeLocationRoot

public abstract class AbstractTreeLocation extends AbstractStackholdingLocation
A location that is child of the "normalized"-area, and describing a turn in a path leading to the final element. A turn divides the basic rectangle along a vertical or horizontal line, and continues the search in one of the newly created, smaller rectangles.
Author:
Benjamin Sigg
  • Constructor Details

    • AbstractTreeLocation

      public AbstractTreeLocation(double size, Side side, long nodeId)
      Creates a new location.
      Parameters:
      size - the size of this location, the parent-location is taken and the area of the rectangle that location yields multiplied by size gives the area of the rectangle yield by this location.
      side - given the rectangle yield by the parent-location, this parameters tells which part the rectangle yield by this location occupies.
      nodeId - a unique identifier for the node represented by this location, can be -1
  • Method Details

    • getSide

      public Side getSide()
      Given the rectangle yield by the parent-location, this property tells which part the rectangle yield by this location occupies.
      Returns:
      the side
    • getSize

      public double getSize()
      Gets the size of this location. The parent-location is taken and the area of the rectangle that location yields multiplied by size gives the area of the rectangle yield by this location.
      Returns:
      the relative size
    • getNodeId

      public long getNodeId()
      Gets the identifier of the node represented by this location.
      Returns:
      the identifier or -1 is not set
    • north

      public TreeLocationNode north(double size)
      Creates a new location which is based at the north side of this location.
      Parameters:
      size - the relative size, a number between 0 and 1
      Returns:
      the new location
    • north

      public TreeLocationNode north(double size, long nodeId)
      Creates a new location which is based at the north side of this location.
      Parameters:
      size - the relative size, a number between 0 and 1
      nodeId - the unique identifier of the new node, can be -1
      Returns:
      the new location
    • south

      public TreeLocationNode south(double size)
      Creates a new location which is based at the south side of this location.
      Parameters:
      size - the relative size, a number between 0 and 1
      Returns:
      the new location
    • south

      public TreeLocationNode south(double size, long nodeId)
      Creates a new location which is based at the south side of this location.
      Parameters:
      size - the relative size, a number between 0 and 1
      nodeId - the unique identifier of the new node, can be -1
      Returns:
      the new location
    • east

      public TreeLocationNode east(double size)
      Creates a new location which is based at the east side of this location.
      Parameters:
      size - the relative size, a number between 0 and 1
      Returns:
      the new location
    • east

      public TreeLocationNode east(double size, long nodeId)
      Creates a new location which is based at the east side of this location.
      Parameters:
      size - the relative size, a number between 0 and 1
      nodeId - the unique identifier of the new node, can be -1
      Returns:
      the new location
    • west

      public TreeLocationNode west(double size)
      Creates a new location which is based at the west side of this location.
      Parameters:
      size - the relative size, a number between 0 and 1
      Returns:
      the new location
    • west

      public TreeLocationNode west(double size, long nodeId)
      Creates a new location which is based at the west side of this location.
      Parameters:
      size - the relative size, a number between 0 and 1
      nodeId - the unique identifier of the new node, can be -1
      Returns:
      the new location
    • leaf

      public TreeLocationLeaf leaf(long leafId)
      Creates a new leaf of this path.
      Parameters:
      leafId - the unique identifier of the leaf, can be -1
      Returns:
      the new leaf
    • findMode

      public ExtendedMode findMode()
      Description copied from class: CLocation
      Gets the mode this location represents.
      Specified by:
      findMode in class CLocation
      Returns:
      the mode or null
    • findParentProperty

      protected abstract SplitDockPathProperty findParentProperty()
      Asks the parent, or in the case of the root creates, the DockableProperty describing the this location.
      Returns:
      the property
    • findProperty

      public SplitDockPathProperty findProperty(DockableProperty successor)
      Description copied from class: CLocation
      Gets a path describing this location in terms of the DockingFrames.
      Specified by:
      findProperty in class CLocation
      Parameters:
      successor - the path of the elements above this location or null
      Returns:
      the path to this location or null, can also be successor
    • aside

      @Deprecated public CLocation aside()
      Deprecated.
      see CLocation.aside() for an explanation.
      Description copied from class: CLocation
      Returns a CLocation that describes the location of an element that should be inserted next to this location.
      Specified by:
      aside in class CLocation
      Returns:
      the new location
    • toString

      public String toString()
      Overrides:
      toString in class Object