com.davisor.graphics
Class PaintScale

java.lang.Object
  extended byjava.text.Format
      extended bycom.davisor.data.Type
          extended bycom.davisor.graphics.AbstractScale
              extended bycom.davisor.graphics.PaintScale
All Implemented Interfaces:
java.lang.Cloneable, java.util.Comparator, com.davisor.core.Dupable, java.io.Serializable

public class PaintScale
extends AbstractScale

Since:
JDK1.2
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.davisor.graphics.AbstractScale
AbstractScale.ScalingPoint
 
Nested classes inherited from class java.text.Format
java.text.Format.Field
 
Field Summary
static java.lang.String COLOR
          Prefix for color scale ("color").
protected  java.lang.String M_scaleType
          Scale type.
static java.lang.String PAINT
          Prefix for paint scale ("paint").
 
Fields inherited from class com.davisor.graphics.AbstractScale
COUNT, M_additionalValues, M_dataType, M_defaultMode, M_infinityAdditionalValues, M_infinityPoint, M_legendFormat, M_points, M_stringPoints, MAX, MAXPERCENT, MIN, MINPERCENT, MODE_LINEAR, MODE_NONE, SCALEFIELDNAMES, TOTALCOUNT
 
Fields inherited from class com.davisor.data.Type
METADATA_GROUP, METADATA_NAME, METADATA_PARENT, METADATA_SUBCHANNELS, TYPENAME
 
Constructor Summary
PaintScale(PaintScale ps)
          Deep copy constructor.
PaintScale(Type dataType, java.lang.String defaultMode, java.lang.String scaleType, java.lang.String legendFormat)
          Sets given attributes.
 
Method Summary
 com.davisor.core.Dupable dup()
          Makes a deep copy of this object.
protected  DataValue getDeinterpolatedValue(double factor, DataValue minValue, DataValue maxValue)
          Returns a deinterpolated value.
 java.awt.Paint getPaint(DataValue value)
          Returns a Paint defined for the given DataValue or null.
 java.lang.String toString()
          Gets type string representation.
 
Methods inherited from class com.davisor.graphics.AbstractScale
addPoint, addPoint, getAdditionalValues, getDefaultInterpolationMode, getInfinityAdditionalValues, getInfinityPoint, getInfinityPointLegendFormat, getInterpolationMode, getLegendFormat, getPointLegendFormat, getPoints, getScaledValue, getStringPoints, getValueClass, getValues, init, toData, toData, toString, zero
 
Methods inherited from class com.davisor.data.Type
ceil, check, check, compare, create, create, create, create, create, dup, equals, 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, 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

PAINT

public static final java.lang.String PAINT
Prefix for paint scale ("paint").

See Also:
Constant Field Values

COLOR

public static final java.lang.String COLOR
Prefix for color scale ("color").

See Also:
Constant Field Values

M_scaleType

protected java.lang.String M_scaleType
Scale type.

Constructor Detail

PaintScale

public PaintScale(PaintScale ps)
Deep copy constructor.


PaintScale

public PaintScale(Type dataType,
                  java.lang.String defaultMode,
                  java.lang.String scaleType,
                  java.lang.String legendFormat)
Sets given attributes.

Parameters:
dataType - point data type
defaultMode - default interpolation mode
scaleType - scale type
legendFormat - legend value format (may be null)
Method Detail

dup

public com.davisor.core.Dupable dup()
Description copied from class: Type
Makes a deep copy of this object.

Specified by:
dup in interface com.davisor.core.Dupable
Specified by:
dup in class Type

getDeinterpolatedValue

protected DataValue getDeinterpolatedValue(double factor,
                                           DataValue minValue,
                                           DataValue maxValue)
Returns a deinterpolated value.

Specified by:
getDeinterpolatedValue in class AbstractScale
Parameters:
factor - scaling factor
minValue - Value to be returned when scaling factor is zero (0)
maxValue - Value to be returned when scaling factor is one (1)

getPaint

public java.awt.Paint getPaint(DataValue value)
Returns a Paint defined for the given DataValue or null.


toString

public java.lang.String toString()
Description copied from class: Type
Gets type string representation. The string representation is a set of XML tag attributes, giving values to type attributes.

Subclasses are expected to concatenate their own attributes to this string.

Overrides:
toString in class Type
See Also:
Type.xmlEnd(), Type.xmlStart(), Strings.toXML(String,Object)


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.