Enum Valign

java.lang.Object
java.lang.Enum<Valign>
de.gurkenlabs.litiengine.Valign
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Valign>, java.lang.constant.Constable

public enum Valign
extends java.lang.Enum<Valign>
The enum Valign defines a range of vertical alignments.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants 
    Enum ConstantDescription
    DOWN 
    MIDDLE 
    MIDDLE_DOWN 
    MIDDLE_TOP 
    TOP 
  • Method Summary

    Modifier and TypeMethodDescription
    static Valignget​(java.lang.String valignString)
    Gets the vertical align enumeration value for the specified string.
    doublegetLocation​(double height, double objectHeight)
    Gets the location for the specified object height to be vertically aligned within the bounds of the specified height.
    doublegetValue​(double height)
    Gets the proportional value of this instance.
    floatgetValue​(float height)
    Gets the proportional value of this instance.
    intgetValue​(int height)
    Gets the proportional value of this instance.
    static ValignvalueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static Valign[]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, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

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

  • Method Details

    • values

      public static Valign[] 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 Valign 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
    • get

      public static Valign get​(java.lang.String valignString)
      Gets the vertical align enumeration value for the specified string.
      Parameters:
      valignString - The string representing the enum value.
      Returns:
      The enum value represented by the specified string or DOWN if the specified string is invalid.
    • getValue

      public float getValue​(float height)
      Gets the proportional value of this instance.
      Parameters:
      height - The height to calculate the relative value from.
      Returns:
      The proportional value for the specified height.
    • getValue

      public double getValue​(double height)
      Gets the proportional value of this instance.
      Parameters:
      height - The height to calculate the relative value from.
      Returns:
      The proportional value for the specified height.
    • getValue

      public int getValue​(int height)
      Gets the proportional value of this instance.
      Parameters:
      height - The height to calculate the relative value from.
      Returns:
      The proportional value for the specified height.
    • getLocation

      public double getLocation​(double height, double objectHeight)
      Gets the location for the specified object height to be vertically aligned within the bounds of the specified height.
      Parameters:
      height - The height, limiting the vertical alignment.
      objectHeight - The height of the object for which to calculate the vertically aligned location.
      Returns:
      The y-coordinate for the location of the object with the specified height.