Enum Class Origin

java.lang.Object
java.lang.Enum<Origin>
com.oorian.css.Origin
All Implemented Interfaces:
Serializable, Comparable<Origin>, Constable

public enum Origin extends Enum<Origin>
CSS origin position values for transform and background positioning.

The Origin enum provides keyword values for specifying position origins used in transform-origin, background-position, and other CSS properties that require positional values.

Position Values:

  • left: Left edge position
  • center: Center position (horizontal or vertical)
  • right: Right edge position
  • top: Top edge position
  • bottom: Bottom edge position

Usage:


 element.setTransformOrigin(Origin.CENTER, Origin.CENTER);
 image.setBackgroundPosition(Origin.LEFT, Origin.TOP);
 
Since:
2012
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Enum Constant Details

    • INITIAL

      public static final Origin INITIAL
      Sets to default value.
    • INHERIT

      public static final Origin INHERIT
      Inherits from parent element.
    • LEFT

      public static final Origin LEFT
      Left edge position.
    • CENTER

      public static final Origin CENTER
      Center position.
    • TOP

      public static final Origin TOP
      Top edge position.
    • BOTTOM

      public static final Origin BOTTOM
      Bottom edge position.
  • Method Details

    • values

      public static Origin[] 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 Origin 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
    • getValue

      public String getValue()
      Returns the CSS value string.
      Returns:
      the CSS value
    • toString

      public String toString()
      Returns the CSS value string.
      Overrides:
      toString in class Enum<Origin>
      Returns:
      the CSS value