pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.statistics.model
Enum AbstractResolution.Format

java.lang.Object
  extended by java.lang.Enum<AbstractResolution.Format>
      extended by org.torweg.pulse.component.statistics.model.AbstractResolution.Format
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<AbstractResolution.Format>
Enclosing class:
AbstractResolution

public static enum AbstractResolution.Format
extends java.lang.Enum<AbstractResolution.Format>

Enumerates the formats for screen resolutions.


Enum Constant Summary
NORMAL
          a normal 4:3 format.
SQUARE
          square format (e.g. handheld computers).
UNKNOWN
          An "unknown" format.
UPRIGHT
          upright format (e.g. handheld computers).
WIDE
          a wide-screen format.
 
Method Summary
static AbstractResolution.Format getFormat(int[] xy)
          returns the Format for the given resolution.
static AbstractResolution.Format getFormat(int x, int y)
          returns the Format for the given resolution.
static AbstractResolution.Format valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static AbstractResolution.Format[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UPRIGHT

public static final AbstractResolution.Format UPRIGHT
upright format (e.g. handheld computers).

anything equal or below a ratio of 0.9 for x/y.


SQUARE

public static final AbstractResolution.Format SQUARE
square format (e.g. handheld computers).

anything between a ratio of 0.9 (excluded) and 1.1 (included) for x/y.


NORMAL

public static final AbstractResolution.Format NORMAL
a normal 4:3 format.

anything between a ratio of 1.1 (excluded) and 1.5 (included) for x/y.


WIDE

public static final AbstractResolution.Format WIDE
a wide-screen format.

any ratio larger than 1.5 for x/y.


UNKNOWN

public static final AbstractResolution.Format UNKNOWN
An "unknown" format.

Method Detail

values

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

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

valueOf

public static AbstractResolution.Format 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

getFormat

public static AbstractResolution.Format getFormat(int x,
                                                  int y)
returns the Format for the given resolution.

Parameters:
x - the available pixels in horizontal direction
y - the available pixels in vertical direction
Returns:
the Format

getFormat

public static AbstractResolution.Format getFormat(int[] xy)
returns the Format for the given resolution.

Parameters:
xy - the available pixels as int[]{horizontal, vertical} direction
Returns:
the Format