org.proteinshader.gui.enums
Enum ImageFormatEnum

java.lang.Object
  extended by java.lang.Enum<ImageFormatEnum>
      extended by org.proteinshader.gui.enums.ImageFormatEnum
All Implemented Interfaces:
Serializable, Comparable<ImageFormatEnum>

public enum ImageFormatEnum
extends Enum<ImageFormatEnum>

Provides an enumeration of the image file formats.

This enum is used by the FileMenu, FileMenuListenerFactory, SaveImageFileChooser, and ScreenShot classes.


Enum Constant Summary
GIF
          The GIF extension is a dot followed by 'gif'.
INVISIBLE_CANVAS_PNG
          The Invisible Canvas PNG extension is a dot followed by 'png'.
JPEG
          The JPEG extension is a dot followed by 'jpg'.
PNG
          The PNG extension is a dot followed by 'png'.
 
Method Summary
 String getExtension()
          Returns the file extension for this image format.
 String getMenuName()
          Returns the name of the ImageFormatEnum in a form suitable for use in a menu.
 String getSaveTitle()
          Returns the a title suitable for use with a save-type file chooser.
 String getShortName()
          Returns the short standard name of the ImageFormatEnum (usually 3 letters).
 String toString()
          Returns the name of the ImageFormatEnum in a form suitable for use in a menu.
static ImageFormatEnum valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ImageFormatEnum valueOfMenuName(String menuName)
          Returns the ImageFormatEnum with the same menu name as the String given as an argument.
static ImageFormatEnum[] 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, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PNG

public static final ImageFormatEnum PNG
The PNG extension is a dot followed by 'png'.


INVISIBLE_CANVAS_PNG

public static final ImageFormatEnum INVISIBLE_CANVAS_PNG
The Invisible Canvas PNG extension is a dot followed by 'png'.


JPEG

public static final ImageFormatEnum JPEG
The JPEG extension is a dot followed by 'jpg'.


GIF

public static final ImageFormatEnum GIF
The GIF extension is a dot followed by 'gif'.

Method Detail

values

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

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

valueOf

public static ImageFormatEnum valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name

getShortName

public String getShortName()
Returns the short standard name of the ImageFormatEnum (usually 3 letters).

Returns:
The short name name of the ImageFormatEnum.

getMenuName

public String getMenuName()
Returns the name of the ImageFormatEnum in a form suitable for use in a menu.

Returns:
The menu name of the ImageFormatEnum.

getSaveTitle

public String getSaveTitle()
Returns the a title suitable for use with a save-type file chooser.

Returns:
A title for saving the format type.

getExtension

public String getExtension()
Returns the file extension for this image format. The extension is always returned as a dot (period) followed by three lowercase letters.

Returns:
The file extension for this image format.

toString

public String toString()
Returns the name of the ImageFormatEnum in a form suitable for use in a menu.

Overrides:
toString in class Enum<ImageFormatEnum>
Returns:
The menu name of the ImageFormatEnum.

valueOfMenuName

public static ImageFormatEnum valueOfMenuName(String menuName)
Returns the ImageFormatEnum with the same menu name as the String given as an argument. The menu name can be obtained with either the toString() or getMenuName() method.

Returns:
The ImageFormatEnum matching the menu name.
Throws:
IllegalArgumentException - if the menu name does not match an ImageFormatEnum.


Copyright © 2007-2008