de.caff.util.settings

## Enum Alignment2D

- java.lang.Object
- - java.lang.Enum<Alignment2D>
  - - de.caff.util.settings.Alignment2D

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Alignment2D>

      public enum Alignment2D
      extends java.lang.Enum<Alignment2D>

  Two-dimensional alignment as a combination of vertical and horizontal alignment.
  Author:
    Rammi

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `Center`
    `East`
    `North`
    `NorthEast`
    `NorthWest`
    `South`
    `SouthEast`
    `SouthWest`
    `West`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `HorizontalAlignment` | `getHorizontalAlignment()` Get the underlying horizontal alignment.
    `DoublePair` | `getTextOffset(java.awt.geom.Rectangle2D textBounds, boolean yPointsDown)` Get the offset for a text with the given bounds.
    `VerticalAlignment` | `getVerticalAlignment()` Get the underlying vertical alignment.
    `static Alignment2D` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static Alignment2D[]` | `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, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### SouthWest

          public static final Alignment2D SouthWest

    - #### South

          public static final Alignment2D South

    - #### SouthEast

          public static final Alignment2D SouthEast

    - #### West

          public static final Alignment2D West

    - #### Center

          public static final Alignment2D Center

    - #### East

          public static final Alignment2D East

    - #### NorthWest

          public static final Alignment2D NorthWest

    - #### North

          public static final Alignment2D North

    - #### NorthEast

          public static final Alignment2D NorthEast

  - ### Method Detail

    - #### values

          public static Alignment2D[] 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 (Alignment2D c : Alignment2D.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static Alignment2D 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

    - #### getVerticalAlignment

          @NotNull
          public VerticalAlignment getVerticalAlignment()

      Get the underlying vertical alignment.
      Returns:
        vertical alignment

    - #### getHorizontalAlignment

          @NotNull
          public HorizontalAlignment getHorizontalAlignment()

      Get the underlying horizontal alignment.
      Returns:
        horizontal alignment

    - #### getTextOffset

          @NotNull
          public DoublePair getTextOffset(@NotNull
                                                   java.awt.geom.Rectangle2D textBounds,
                                                   boolean yPointsDown)

      Get the offset for a text with the given bounds.
      Parameters:
        `textBounds` - text bounds
        `yPointsDown` - `true`: Y axis points down, rectangle's minimal horizontal edge is North (typical screen coordinates),
        `false`: Y axis points up, rectangle's minimal horizontal edge is South (often used elsewhere)
      Returns:
        a pair of translations offsets in X (DoublePair.first) and Y (DoublePair.second) direction to make the origin the correct text attachment point