Package snap.geom

Enum Class Pos

All Implemented Interfaces:
Serializable, Comparable<Pos>, Constable

public enum Pos extends Enum<Pos>
A class to represent a position on both horizonal and vertical axis (e.g. TOP_LEFT, BOTTOM_RIGHT, etc.).
  • Enum Constant Details

    • TOP_LEFT

      public static final Pos TOP_LEFT
    • TOP_CENTER

      public static final Pos TOP_CENTER
    • TOP_RIGHT

      public static final Pos TOP_RIGHT
    • CENTER_LEFT

      public static final Pos CENTER_LEFT
    • CENTER

      public static final Pos CENTER
    • CENTER_RIGHT

      public static final Pos CENTER_RIGHT
    • BOTTOM_LEFT

      public static final Pos BOTTOM_LEFT
    • BOTTOM_CENTER

      public static final Pos BOTTOM_CENTER
    • BOTTOM_RIGHT

      public static final Pos BOTTOM_RIGHT
  • Field Details

    • ALL_OUTER

      public static final Pos[] ALL_OUTER
  • Method Details

    • values

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

      public static Pos valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getHPos

      public HPos getHPos()
      Returns the Horizontal position.
    • getVPos

      public VPos getVPos()
      Returns the vertical position.
    • isSide

      public boolean isSide()
      Returns whether position is side.
    • isCorner

      public boolean isCorner()
      Returns whether position is corner.
    • getOpposing

      public Pos getOpposing()
      Returns the opposing position.
    • getSide

      public Side getSide()
      Returns the Side most associated with position (corners go to LEFT/RIGHT, center to null).
    • isLeftOrRight

      public boolean isLeftOrRight()
      Returns whether position is top or bottom.
    • isTopOrBottom

      public boolean isTopOrBottom()
      Returns whether position is top or bottom.
    • of

      public static Pos of(Object anObj)
      Returns the Pos for an object.
    • get

      public static Pos get(String aString)
      Returns the Pos for a string.
    • get

      public static Pos get(HPos aHP, VPos aVP)
      Returns a pos for given HPos and VPos.