|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.text.Format
com.davisor.data.Type
com.davisor.graphics.data.PaintType
com.davisor.graphics.data.ColorType
ColorType defines a solid color data type. In particular, color type provides a convenient conversion tool for conversion from color specification strings to color objects. Color types also define a set of Color utility methods that extend and improve standard Java color utilities.
ColorType uses a color definition resource bundle file to map color names to color definitions. The resource bundle name is:
The default resource bundle defines a set of default colors. Overriding and extending this bundle allows system administrator to define custom and localized color sets.
createColor(String,ParsePosition),
ColorData,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class java.text.Format |
java.text.Format.Field |
| Field Summary | |
static java.lang.String |
TYPENAME
Type name ("COLOR"). |
| Fields inherited from class com.davisor.graphics.data.PaintType |
DEFAULT |
| Fields inherited from class com.davisor.data.Type |
METADATA_GROUP, METADATA_NAME, METADATA_PARENT, METADATA_SUBCHANNELS |
| Constructor Summary | |
|
ColorType()
Default constructor. |
|
ColorType(ColorType ct)
Copy constructor. |
|
ColorType(java.lang.String dataName)
Creates a new default type with no identity. |
|
ColorType(java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.net.URL context)
Creates a new type. |
|
ColorType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
Constructs a new type with given spesification. |
protected |
ColorType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.net.URL context)
Creates a new type. |
| Method Summary | |
static java.awt.Color |
createColor(java.lang.String format)
Creates a new color. |
static java.awt.Color |
createColor(java.lang.String format,
java.text.ParsePosition status)
Convert a string to a color value. |
com.davisor.core.Dupable |
dup()
Makes a deep copy of this object. |
boolean |
equals(java.lang.Object o)
Tests if this object is equal with another object. |
static java.util.Hashtable |
getColors()
Gets a reference to the internal hashtable that holds the currently available colors. |
java.lang.Class |
getValueClass()
Gets value container class. |
DataValue |
one()
Gets the unit data value for this type. |
DataValue |
toData(java.lang.Object value)
Converts the object to a color value. |
DataValue |
toData(java.lang.String value,
java.text.ParsePosition status)
Converts the string to a color value. |
static java.lang.String |
toString(java.awt.Color color)
Convert a color to a string value in the standard "#rrggbb" format. |
DataValue |
zero()
Gets zero data value for this type. |
| Methods inherited from class com.davisor.graphics.data.PaintType |
createColor, createPaint, createPaint, getContext, getPaints, setContext, toData |
| Methods inherited from class com.davisor.data.Type |
ceil, check, check, compare, create, create, create, create, create, dup, floor, format, getCompatibility, getDataName, getFormat, getId, getID, getMetaData, getMetaData, getSpecs, getSQLCode, getSQLName, getSQLName, getTypeName, hashCode, isNull, parseObject, register, register, setDataName, setFormat, setId, setID, setMetaData, setMetaData, setSpecs, toData, toData, toString, toXML, xmlEnd, xmlStart |
| Methods inherited from class java.text.Format |
clone, format, formatToCharacterIterator, parseObject |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String TYPENAME
| Constructor Detail |
public ColorType()
public ColorType(ColorType ct)
public ColorType(java.lang.String dataName)
dataName - data name (may be null)
public ColorType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
dataName - data name (may be null)id - type identity (may be null)format - type spesification (may be null)Type.setFormat(java.lang.String)
public ColorType(java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.net.URL context)
dataName - data name (may be null)id - type identity (may be null)metaData - type meta data map (may be null)context - context for partially specified URL addesses (may be null)
protected ColorType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.net.URL context)
typeName - type namedataName - data name (may be null)id - type identity (may be null)metaData - type meta data map (may be null)context - context for partially specified URL addesses (may be null)| Method Detail |
public com.davisor.core.Dupable dup()
dup in interface com.davisor.core.Dupabledup in class PaintTypepublic boolean equals(java.lang.Object o)
Color type objects are equal if their superclasses are.
equals in interface java.util.Comparatorequals in class PaintType
public static java.awt.Color createColor(java.lang.String format)
throws InvalidDataException
creteColor(String,ParsePosition).
InvalidDataExceptioncreateColor(String,ParsePosition)
public static java.awt.Color createColor(java.lang.String format,
java.text.ParsePosition status)
throws InvalidDataException
format - color spesification stringstatus - parse status
InvalidDataException - if the string cannot be parsed as a colorgetColors()public static java.lang.String toString(java.awt.Color color)
color - the color to be encoded
createColor(java.lang.String)public static java.util.Hashtable getColors()
Any modifications to the exposed hashtable will have immediate global effect on the services of this class. If modifications are made, they should be synchronized with the returned Hashtable object.
createColor(String,ParsePosition)public java.lang.Class getValueClass()
getValueClass in class PaintTypepublic DataValue one()
one in class PaintTypezero()
public DataValue toData(java.lang.String value,
java.text.ParsePosition status)
throws InvalidDataException
toData in class PaintTypevalue - a color data stringstatus - parse status
InvalidDataException - String cannot be converted
to a color value.ColorData
public DataValue toData(java.lang.Object value)
throws InvalidDataException
toData in class PaintTypevalue - the object to be converted
InvalidDataException - if the object cannot be convertedColorDatapublic DataValue zero()
zero in class PaintTypeone()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||