Enum Alignment

java.lang.Object
java.lang.Enum<Alignment>
com.github.weisj.darklaf.util.Alignment
All Implemented Interfaces:
Serializable, Comparable<Alignment>, java.lang.constant.Constable

public enum Alignment extends Enum<Alignment>
  • Enum Constant Details

    • NORTH

      public static final Alignment NORTH
    • SOUTH

      public static final Alignment SOUTH
    • EAST

      public static final Alignment EAST
    • WEST

      public static final Alignment WEST
    • NORTH_EAST

      public static final Alignment NORTH_EAST
    • NORTH_WEST

      public static final Alignment NORTH_WEST
    • SOUTH_EAST

      public static final Alignment SOUTH_EAST
    • SOUTH_WEST

      public static final Alignment SOUTH_WEST
    • CENTER

      public static final Alignment CENTER
  • Method Details

    • values

      public static Alignment[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Alignment valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getAlignment

      public static Alignment getAlignment(Point point, Dimension size, Rectangle outerBounds, Alignment hint)
      Get fitting alignment.
      Parameters:
      point - point to align at.
      size - Size of rectangle to align.
      outerBounds - outer boundaries to align in.
      hint - preferred alignment.
      Returns:
      fitting alignment. If none is found the default is CENTER.
    • canBeAligned

      public boolean canBeAligned(Point point, Dimension size, Rectangle outerBounds)
      Check whether the given Rectangle can be aligned at point inside boundaries.
      Parameters:
      point - point to align at.
      size - size of rectangle to align.
      outerBounds - boundaries.
      Returns:
      true if can be aligned.
    • relativePos

      public Point relativePos(Dimension toAlign, Point alignAt)
      Get the relative Position of Rectangle to Point with respect to the alignment.
      Parameters:
      toAlign - size of Rectangle to align.
      alignAt - point to align at.
      Returns:
      top/left position of aligned rectangle
    • alignOutside

      public Point alignOutside(Dimension toAlign, Rectangle innerBounds)
      Align Rectangle outside other rectangle with respect to the alignment.
      Parameters:
      toAlign - size of rectangle to align
      innerBounds - bounds of inside rectangle
      Returns:
      top/left point of aligned rectangle
    • getIndex

      public int getIndex()
      Get the index of the alignment. This function is for utility purposes where one might save settings based on alignment in an array.
      Returns:
      the index.
    • opposite

      public Alignment opposite()
      Get the opposite alignment.
      Returns:
      Alignment opposite on the compass.
    • anticlockwise

      public Alignment anticlockwise()
    • clockwise

      public Alignment clockwise()
    • maskInsets

      public Insets maskInsets(Insets insets)
    • maskInsets

      public Insets maskInsets(Insets insets, int maskValue)
    • maskInsets

      public Insets maskInsets(int top, int left, int bottom, int right, int mask)
    • maskInsetsInverted

      public Insets maskInsetsInverted(Insets insets)
    • maskInsetsInverted

      public Insets maskInsetsInverted(Insets insets, int mask)
    • maskInsetsInverted

      public Insets maskInsetsInverted(int top, int left, int bottom, int right, int mask)
    • alignInside

      public Point alignInside(Dimension toAlign, Rectangle outerBounds)
      Align Rectangle inside other rectangle with respect to the alignment.
      Parameters:
      toAlign - size of rectangle to align
      outerBounds - bounds of outer rectangle
      Returns:
      top/left point of aligned rectangle
    • isNorth

      public boolean isNorth()
    • isSouth

      public boolean isSouth()
    • isEast

      public boolean isEast()
    • isWest

      public boolean isWest()
    • isEast

      public boolean isEast(boolean includePureDirections)
    • isWest

      public boolean isWest(boolean includePureDirections)
    • isVertical

      public boolean isVertical()
    • isHorizontal

      public boolean isHorizontal()
    • isDiagonal

      public boolean isDiagonal()
    • getAngle

      public double getAngle()
    • getDegreeAngle

      public int getDegreeAngle()