dsto.dfc.swing.styles
Class AbstractStyle
java.lang.Object
dsto.dfc.util.AbstractEnumerationValue
dsto.dfc.util.StringEnumerationValue
dsto.dfc.swing.icons.IconicEnumerationValue
dsto.dfc.swing.styles.AbstractStyle
- All Implemented Interfaces:
- Iconic, Style, EnumerationValue, Serializable
public abstract class AbstractStyle
- extends IconicEnumerationValue
- implements Style, EnumerationValue, Serializable
Base implementation of the Style interface. The intended use of
this class is to create a set of related styles, so this class also
implements the EnumerationValue interface. Subclasses of this class must
implement getEnumValues () to return all other styles in the style
set, and override readResolve () to call super.readResolve (). This
enables inheritance of the singleton deserialization logic from the
IconicEnumerationValue class.
- Version:
- $Revision$
- Author:
- Matthew Phillips
- See Also:
- Serialized Form
Methods inherited from interface dsto.dfc.swing.icons.Iconic |
getName |
type
protected transient Class type
description
protected transient String description
AbstractStyle
protected AbstractStyle()
AbstractStyle
public AbstractStyle(String name,
String text,
Class type,
String description,
String iconResource)
- Creates a new
AbstractStyle
instance.
- Parameters:
name
- The logical unique name of the style. This is used
(via IconicEnumerationValue's deserialization) to resolve saved
instances to the singleton instance.text
- The user-readable textual name of the style.type
- The type of value for the style.description
- A short (tooltip length) description of the
style.iconResource
- The name of an icon resource for the
style. May be null for no icon.
AbstractStyle
public AbstractStyle(String name,
String text,
Class type,
String description,
Icon icon)
- Creates a new
AbstractStyle
instance.
- Parameters:
name
- The logical unique name of the style. This is used
(via IconicEnumerationValue's deserialization) to resolve saved
instances to the singleton instance.text
- The user-readable textual name of the style.type
- The type of value for the style.description
- A short (tooltip length) description of the
style.icon
- The icon for the style. May be null for no icon.
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 IconicEnumerationValue
getType
public Class getType()
- Description copied from interface:
Style
- The type of value for the style.
- Specified by:
getType
in interface Style
getDescription
public String getDescription()
- Description copied from interface:
Style
- A short (tooltip length) description of the style.
- Specified by:
getDescription
in interface Style
readResolve
protected Object readResolve()
throws InvalidObjectException
- Description copied from class:
AbstractEnumerationValue
- Serialization support: resolves instance written to stream to the
equivalent instance in getEnumValues () using equals (). Superclasses
that wish to use this feature must override this method and call
super.readResolve ().
- Overrides:
readResolve
in class AbstractEnumerationValue
- Throws:
InvalidObjectException
- if value could not be resolved
to a valid entry in the list of enum values.
Copyright © 2008 Commonwealth of Australia