magoffin.matt.ma2
Enum MediaSize

java.lang.Object
  extended by java.lang.Enum<MediaSize>
      extended by magoffin.matt.ma2.MediaSize
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<MediaSize>

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

Size constants for media items.

This enumeration defines a finite set of sizes that media items can be requested as. This is to limit the number of sizes the application needs to generate, and possibly cache. Each enumeration defines a default Geometry that represents the width and height of that size, in pixels, but these defaults may be overridden by the application if desired.

Version:
$Revision: 43 $ $Date: 2007-10-21 11:10:01 +1300 (Sun, 21 Oct 2007) $
Author:
matt.magoffin

Enum Constant Summary
BIG
          Big size, eg 800x600.
BIGGER
          Bigger size, eg 1024x768.
BIGGEST
          Biggest size, eg 1600x1200.
NORMAL
          Normal size, eg 640x480.
SMALL
          Small size, eg 480x320.
THUMB_BIG
          Normal thumbnail size.
THUMB_BIGGER
          Big thumbnail size.
THUMB_NORMAL
          Small thumbnail size.
THUMB_SMALL
          Tiny thumbnail size.
TINY
          Tiny size, eg 320x240.
 
Method Summary
 Geometry getGeometry()
          Get a default Geometry object for this size.
static MediaSize valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static MediaSize[] 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

BIGGEST

public static final MediaSize BIGGEST
Biggest size, eg 1600x1200.


BIGGER

public static final MediaSize BIGGER
Bigger size, eg 1024x768.


BIG

public static final MediaSize BIG
Big size, eg 800x600.


NORMAL

public static final MediaSize NORMAL
Normal size, eg 640x480.


SMALL

public static final MediaSize SMALL
Small size, eg 480x320.


TINY

public static final MediaSize TINY
Tiny size, eg 320x240.


THUMB_BIGGER

public static final MediaSize THUMB_BIGGER
Big thumbnail size.


THUMB_BIG

public static final MediaSize THUMB_BIG
Normal thumbnail size.


THUMB_NORMAL

public static final MediaSize THUMB_NORMAL
Small thumbnail size.


THUMB_SMALL

public static final MediaSize THUMB_SMALL
Tiny thumbnail size.

Method Detail

values

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

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

valueOf

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

getGeometry

public Geometry getGeometry()
Get a default Geometry object for this size.

Returns:
geometry