|
|||||||||||
| 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.StrokeType
StrokeType defines a stroke mapper that provides convenient conversion tool from stroke specification strings to stroke objects.
StrokeType uses a stroke definition resource bundle file to map stroke names to stroke definitions. The resource bundle name is:
The default resource bundle defines a set of default strokes. Overriding and extending this bundle allows system administrator to define custom and localized stroke sets.
createStroke(String,ParsePosition),
StrokeData,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class java.text.Format |
java.text.Format.Field |
| Field Summary | |
static StrokeType |
DEFAULT
Default stroke type. |
static java.lang.String |
TYPENAME
Type name ("STROKE"). |
| Fields inherited from class com.davisor.data.Type |
METADATA_GROUP, METADATA_NAME, METADATA_PARENT, METADATA_SUBCHANNELS |
| Constructor Summary | |
|
StrokeType()
Default constructor. |
|
StrokeType(java.lang.String dataName)
Creates a new default type with no identity. |
|
StrokeType(java.lang.String dataName,
java.lang.String id)
Creates a new type. |
|
StrokeType(java.lang.String dataName,
java.lang.String id,
java.util.Map metaData)
Creates a new type. |
|
StrokeType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
Constructs a new type with given spesification. |
protected |
StrokeType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData)
Creates a new type. |
|
StrokeType(StrokeType st)
Copy constructor. |
| Method Summary | |
static java.awt.Stroke |
createStroke(java.lang.String format)
Converts a string to a stroke value. |
static java.awt.Stroke |
createStroke(java.lang.String format,
java.text.ParsePosition status)
Converts a string to a stroke 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 to another object. |
static StrokeParameters |
getStrokeParameters(java.lang.String name)
Gets stock stroke parameters. |
java.lang.Class |
getValueClass()
Gets value container class. |
DataValue |
one()
Gets unit data value for this type. |
DataValue |
toData(java.sql.CallableStatement call,
int column)
Get callable statement result value. |
DataValue |
toData(java.lang.Object value)
Converts object to a stroke value. |
DataValue |
toData(java.sql.ResultSet set,
int column)
Parse a result set output value as a data object. |
DataValue |
toData(java.lang.String value,
java.text.ParsePosition status)
Converts string to a stroke value. |
DataValue |
zero()
Gets zero data value for this type. |
| 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, 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 StrokeType DEFAULT
public static final java.lang.String TYPENAME
| Constructor Detail |
public StrokeType()
public StrokeType(StrokeType st)
public StrokeType(java.lang.String dataName)
dataName - data name (may be null)
public StrokeType(java.lang.String dataName,
java.lang.String id)
dataName - data name (may be null)id - type identity (may be null)
public StrokeType(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 StrokeType(java.lang.String dataName,
java.lang.String id,
java.util.Map metaData)
dataName - data name (may be null)id - type identity (may be null)metaData - type meta data map (may be null)
protected StrokeType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData)
typeName - type namedataName - data name (may be null)id - type identity (may be null)metaData - type meta data map (may be null)| Method Detail |
public com.davisor.core.Dupable dup()
dup in interface com.davisor.core.Dupabledup in class Typepublic boolean equals(java.lang.Object o)
Stroke type objects are equal if their super-classes are.
equals in interface java.util.Comparatorequals in class TypeCompare.equals(Object,Object)
public static java.awt.Stroke createStroke(java.lang.String format)
throws InvalidDataException
StrokeParameters instance, which analyzes the string
and creates a corresponding new stroke instance.
format - stroke spesification string
InvalidDataExceptioncreateStroke(String,ParsePosition)
public static java.awt.Stroke createStroke(java.lang.String format,
java.text.ParsePosition status)
throws InvalidDataException
StrokeParameters instance, which analyzes the string
and creates a corresponding new stroke instance.
format - stroke spesification stringstatus - parse status
InvalidDataExceptiongetStrokeParameters(String),
StrokeParameters.StrokeParameters(String,ParsePosition),
StrokeParameters.toStroke()public static StrokeParameters getStrokeParameters(java.lang.String name)
null is returned.
name - stock stroke name (may be null)
createStroke(String,ParsePosition)public java.lang.Class getValueClass()
getValueClass in class Typepublic DataValue one()
zero()
public DataValue toData(java.lang.Object value)
throws InvalidDataException
toData in class Typevalue - the object to be converted
InvalidDataException - if object can not be convertedType.toData(CallableStatement,int),
Type.toData(ResultSet,int),
Type.toData(String,ParsePosition),
DataValue.toString()
public DataValue toData(java.sql.CallableStatement call,
int column)
throws java.sql.SQLException
toData in class Typecall - statement holding the data value to be convertedcolumn - SQL column index for the data value to be converted
java.sql.SQLException - if a SQL error occursType.toData(Object),
Type.toData(ResultSet,int),
Type.toData(String,ParsePosition),
DataValue.toString()
public DataValue toData(java.sql.ResultSet set,
int column)
throws java.sql.SQLException
toData in class Typeset - resultSet holding the data value to be convertedcolumn - SQL column index for the data value to be converted
java.sql.SQLException - if a SQL error occursType.toData(CallableStatement,int),
Type.toData(Object),
Type.toData(String,ParsePosition),
DataValue.toString()
public DataValue toData(java.lang.String value,
java.text.ParsePosition status)
throws InvalidDataException
toData in class Typevalue - a stroke data stringstatus - parse status
InvalidDataException - if value can not be convertedStrokeDatapublic DataValue zero()
zero in class Typeone()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||