Class RelativePosition

java.lang.Object
com.luciad.drawing.RelativePosition

public final class RelativePosition extends Object
Describes a position relative to an anchor, with a rotation, alignment and offset.
  • Constructor Details

    • RelativePosition

      public RelativePosition(@NotNull Angle rotation, @NotNull HorizontalAlignment horizontalAlignment, @NotNull VerticalAlignment verticalAlignment, double offsetX, double offsetY)
      Creates a new RelativePosition with the given values.
      Parameters:
      rotation - the rotation around the anchor point.
      horizontalAlignment - the horizontal alignment of this RelativePosition.
      verticalAlignment - the vertical alignment of this RelativePosition.
      offsetX - the horizontal offset, expressed in pixels and relative to the anchor point.
      offsetY - the vertical offset, expressed in pixels and relative to the anchor point.
    • RelativePosition

      public RelativePosition(@NotNull RelativePosition other)
  • Method Details

    • north

      @NotNull public static RelativePosition north(double offset)
      Returns a RelativePosition located to the north of the anchor point with the given offset.
      Parameters:
      offset - : the vertical offset, expressed in pixels and relative to the anchor point.
    • east

      @NotNull public static RelativePosition east(double offset)
      Returns a RelativePosition located to the east of the anchor point with the given offset.
      Parameters:
      offset - : the horizontal offset, expressed in pixels and relative to the anchor point.
    • south

      @NotNull public static RelativePosition south(double offset)
      Returns a RelativePosition located to the south of the anchor point with the given offset.
      Parameters:
      offset - : the vertical offset, expressed in pixels and relative to the anchor point.
    • west

      @NotNull public static RelativePosition west(double offset)
      Returns a RelativePosition located to the west of the anchor point with the given offset.
      Parameters:
      offset - : the horizontal offset, expressed in pixels and relative to the anchor point.
    • northEast

      @NotNull public static RelativePosition northEast(double offsetNorth, double offsetEast)
      Returns a RelativePosition located to the north-east of the anchor point with the given offsets.
      Parameters:
      offsetNorth - : the vertical offset, expressed in pixels and relative to the anchor point.
      offsetEast - : the horizontal offset, expressed in pixels and relative to the anchor point.
    • northWest

      @NotNull public static RelativePosition northWest(double offsetNorth, double offsetWest)
      Returns a RelativePosition located to the north-west of the anchor point with the given offsets.
      Parameters:
      offsetNorth - : the vertical offset, expressed in pixels and relative to the anchor point.
      offsetWest - : the horizontal offset, expressed in pixels and relative to the anchor point.
    • southEast

      @NotNull public static RelativePosition southEast(double offsetSouth, double offsetEast)
      Returns a RelativePosition located to the south-east of the anchor point with the given offsets.
      Parameters:
      offsetSouth - : the vertical offset, expressed in pixels and relative to the anchor point.
      offsetEast - : the horizontal offset, expressed in pixels and relative to the anchor point.
    • southWest

      @NotNull public static RelativePosition southWest(double offsetSouth, double offsetWest)
      Returns a RelativePosition located to the south-west of the anchor point with the given offsets.
      Parameters:
      offsetSouth - : the vertical offset, expressed in pixels and relative to the anchor point.
      offsetWest - : the horizontal offset, expressed in pixels and relative to the anchor point.
    • center

      @NotNull public static RelativePosition center()
      Returns a RelativePosition located on the anchor point with no offset.
    • getRotation

      @NotNull public Angle getRotation()
      the rotation around the anchor point.
    • getHorizontalAlignment

      @NotNull public HorizontalAlignment getHorizontalAlignment()
      the horizontal alignment of this RelativePosition.
    • getVerticalAlignment

      @NotNull public VerticalAlignment getVerticalAlignment()
      the vertical alignment of this RelativePosition.
    • getOffsetX

      public double getOffsetX()
      the horizontal offset, expressed in pixels and relative to the anchor point.
    • getOffsetY

      public double getOffsetY()
      the vertical offset, expressed in pixels and relative to the anchor point.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object