Enum ScreenOrientation

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

    public enum ScreenOrientation
    extends java.lang.Enum<ScreenOrientation>
    Enumeration for values used for screen orientation.
    Author:
    Christopher Mindus
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      landscape
      The orientation is either landscape-primary or landscape-secondary (sensor).
      landscape_primary
      The orientation is in the primary landscape mode.
      landscape_secondary
      The orientation is in the secondary landscape mode.
      portrait
      The orientation is either portrait-primary or portrait-secondary (sensor).
      portrait_primary
      The orientation is in the primary portrait mode.
      portrait_secondary
      The orientation is in the secondary portrait mode.
      unknown
      Unknown orientation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String clientOrientation
      The string in window.screen.orientation on the client side.
      boolean isLandscape
      Flag for landscape orientation (false for "unknown").
      boolean isPortrait
      Flag for portrait orientation (false for "unknown").
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ScreenOrientation valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ScreenOrientation[] 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

      • portrait

        public static final ScreenOrientation portrait
        The orientation is either portrait-primary or portrait-secondary (sensor).
      • landscape

        public static final ScreenOrientation landscape
        The orientation is either landscape-primary or landscape-secondary (sensor).
      • portrait_primary

        public static final ScreenOrientation portrait_primary
        The orientation is in the primary portrait mode.
      • portrait_secondary

        public static final ScreenOrientation portrait_secondary
        The orientation is in the secondary portrait mode.
      • landscape_primary

        public static final ScreenOrientation landscape_primary
        The orientation is in the primary landscape mode.
      • landscape_secondary

        public static final ScreenOrientation landscape_secondary
        The orientation is in the secondary landscape mode.
    • Field Detail

      • clientOrientation

        public final java.lang.String clientOrientation
        The string in window.screen.orientation on the client side.
      • isPortrait

        public final boolean isPortrait
        Flag for portrait orientation (false for "unknown").
      • isLandscape

        public final boolean isLandscape
        Flag for landscape orientation (false for "unknown").
    • Method Detail

      • values

        public static ScreenOrientation[] 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 (ScreenOrientation c : ScreenOrientation.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

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