Enum Anchor

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Anchor>

    public enum Anchor
    extends java.lang.Enum<Anchor>
    Property type for an anchor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Anchor getByValue​(int value)
      Get the anchor constant that corresponds to the specified value
      int getValue()
      The value of the anchor which can be used by java.awt.GridBagLayout.
      boolean isCorner()
      If the anchor is a corner.
      java.lang.String toString()  
      static Anchor valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Anchor[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NORTHWEST

        public static final Anchor NORTHWEST
      • NORTH

        public static final Anchor NORTH
      • NORTHEAST

        public static final Anchor NORTHEAST
      • WEST

        public static final Anchor WEST
      • CENTER

        public static final Anchor CENTER
      • EAST

        public static final Anchor EAST
      • SOUTHWEST

        public static final Anchor SOUTHWEST
      • SOUTH

        public static final Anchor SOUTH
      • SOUTHEAST

        public static final Anchor SOUTHEAST
    • Method Detail

      • values

        public static Anchor[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Anchor c : Anchor.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Anchor valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getByValue

        public static Anchor getByValue​(int value)
        Get the anchor constant that corresponds to the specified value
        Parameters:
        value - the value, as returned by getValue()
        Returns:
        the anchor or null if the value cannot be found
        See Also:
        getValue()
      • isCorner

        public boolean isCorner()
        If the anchor is a corner.
        Returns:
        the value
      • getValue

        public int getValue()
        The value of the anchor which can be used by java.awt.GridBagLayout.
        Returns:
        the value, one of the anchor constants in java.awt.GridBagConstraints
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<Anchor>