Class CRectangleLocation


public class CRectangleLocation extends AbstractStackholdingLocation
A location describing a normalized element by giving its relative position and size (relative meaning that the element is positioned in a rectangle of size 1/1).
Author:
Benjamin Sigg
  • Constructor Details

    • CRectangleLocation

      public CRectangleLocation(CSplitLocation parent, double x, double y, double width, double height)
      Creates a new location.
      Parameters:
      parent - the parent that knows the id of the root station
      x - the relative x-coordinate, a value between 0 and 1 is preferred
      y - the relative y-coordinate, a value between 0 and 1 is preferred
      width - the relative width, a value between 0 and 1 is preferred
      height - the relative height, a value between 0 and 1 is preferred
  • Method Details

    • getX

      public double getX()
      Gets the relative x-coordinate
      Returns:
      a value between 0 and 1
    • getY

      public double getY()
      Gets the relative y-coordinate
      Returns:
      a value between 0 and 1
    • getWidth

      public double getWidth()
      Gets the relative width
      Returns:
      a value between 0 and 1
    • getHeight

      public double getHeight()
      Gest the relative height
      Returns:
      a value between 0 and 1
    • findRoot

      public String findRoot()
      Description copied from class: CLocation
      Gets the name of the station this location belongs to. This can be the id of any CStation.
      Specified by:
      findRoot in class CLocation
      Returns:
      the name of the station or null if this location does not have enough information to find the root
    • getParent

      public CLocation getParent()
      Description copied from class: CLocation
      Gets the parent location of this location. Some root-locations may never have a parent.
      Specified by:
      getParent in class CLocation
      Returns:
      the parent location, can be null
    • 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
    • findProperty

      public DockableProperty 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