dsto.dfc.swing.icons
Class IconicEnumerationValue

java.lang.Object
  extended by dsto.dfc.util.AbstractEnumerationValue
      extended by dsto.dfc.util.StringEnumerationValue
          extended by dsto.dfc.swing.icons.IconicEnumerationValue
All Implemented Interfaces:
Iconic, EnumerationValue, Serializable
Direct Known Subclasses:
AbstractStyle, BillBoard.LayoutEnum

public abstract class IconicEnumerationValue
extends StringEnumerationValue
implements Iconic, Serializable

Base class for enumerated types that have an iconic representation.

Version:
$Revision$
See Also:
Serialized Form

Field Summary
protected  Icon icon
          Icon is marked transient on the assumption that StringEnumerationValue's readResolve () will do a resolution to the singleton instance in getEnumValues ().
 
Fields inherited from class dsto.dfc.util.StringEnumerationValue
name, text
 
Fields inherited from interface dsto.dfc.swing.icons.Iconic
NULL_ICON
 
Constructor Summary
protected IconicEnumerationValue()
           
  IconicEnumerationValue(String name)
          Create new instance with a null icon.
  IconicEnumerationValue(String name, Icon icon)
          Create an instance with associated string and icon representation.
  IconicEnumerationValue(String name, String iconRes)
          Create an instance with associated string and icon representation.
  IconicEnumerationValue(String name, String text, Icon icon)
          Create an instance with associated string and icon representation.
  IconicEnumerationValue(String name, String text, String iconRes)
           
 
Method Summary
abstract  EnumerationValue[] getEnumValues()
          Get the list of values within the enumeration.
 Icon getIcon()
          The small (16x16) icon for the object.
 Icon getLargeIcon()
          The large (32x32) icon.
 
Methods inherited from class dsto.dfc.util.StringEnumerationValue
equals, findIndex, findValue, getName, getText, hashCode, setName, toString
 
Methods inherited from class dsto.dfc.util.AbstractEnumerationValue
findIndex, findIndex, readResolve
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface dsto.dfc.swing.icons.Iconic
getName
 

Field Detail

icon

protected transient Icon icon
Icon is marked transient on the assumption that StringEnumerationValue's readResolve () will do a resolution to the singleton instance in getEnumValues ().

Constructor Detail

IconicEnumerationValue

protected IconicEnumerationValue()

IconicEnumerationValue

public IconicEnumerationValue(String name)
Create new instance with a null icon.

Parameters:
name - The logical name of the this value.

IconicEnumerationValue

public IconicEnumerationValue(String name,
                              String iconRes)
Create an instance with associated string and icon representation.

Parameters:
name - The logical name of the this value.
iconRes - The resource name of the icon to associate with this value.

IconicEnumerationValue

public IconicEnumerationValue(String name,
                              Icon icon)
Create an instance with associated string and icon representation.

Parameters:
name - The logical name of this value.
icon - The icon to associate with this value.

IconicEnumerationValue

public IconicEnumerationValue(String name,
                              String text,
                              Icon icon)
Create an instance with associated string and icon representation.

Parameters:
name - The logical name of this value.
text - The human readable text for the value.
icon - The icon to associate with this value.

IconicEnumerationValue

public IconicEnumerationValue(String name,
                              String text,
                              String iconRes)
Method Detail

getEnumValues

public abstract EnumerationValue[] getEnumValues()
Description copied from interface: EnumerationValue
Get the list of values within the enumeration.

Specified by:
getEnumValues in interface EnumerationValue
Specified by:
getEnumValues in class StringEnumerationValue

getIcon

public Icon getIcon()
Description copied from interface: Iconic
The small (16x16) icon for the object. May be null if no small icon is available.

Specified by:
getIcon in interface Iconic

getLargeIcon

public Icon getLargeIcon()
Description copied from interface: Iconic
The large (32x32) icon.

Specified by:
getLargeIcon in interface Iconic
Returns:
The large icon, or null if no large icon is available.


Copyright © 2008 Commonwealth of Australia