com.davisor.graphics.data
Class PaintsData

java.lang.Object
  extended bycom.davisor.data.VoidData
      extended bycom.davisor.data.VoidValue
          extended bycom.davisor.data.GenericValue
              extended bycom.davisor.graphics.data.PaintData
                  extended bycom.davisor.graphics.data.PaintsData
All Implemented Interfaces:
BetterPaint, java.lang.Comparable, Data, DataValue, com.davisor.core.Dupable, java.awt.Paint, PaintValue, java.io.Serializable, SerializableData, java.awt.Transparency

public class PaintsData
extends PaintData

PaintsData objects represent an ordered list of paints.

Since:
JDK1.1
See Also:
PaintType, Serialized Form

Field Summary
protected  PaintsData M_next
          The next paint.
 
Fields inherited from class com.davisor.graphics.data.PaintData
M_creationString, M_paint
 
Fields inherited from class com.davisor.data.VoidData
M_type
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
PaintsData(PaintsData data, boolean deep)
          Deep or shallow copy constructor.
PaintsData(PaintType type, java.awt.Paint paint, PaintsData first)
          Constructs a paint data object that terminates a paint chain.
PaintsData(PaintType type, java.awt.Paint paint, PaintsData first, java.lang.String paints, java.text.ParsePosition status)
          Constructs a first or intermediate paint in a paint chain.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this data agains other data objects.
 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.
 PaintsData getNext()
          Gets the next paint in this paint chain.
 int hashCode()
          Returns a hash code value for the object.
 BetterPaint next()
          Gets the next paint in this paint series.
 void setValue(java.lang.String value, java.text.ParsePosition status)
          Set data value.
 java.lang.String toString()
          Gets paint chain string representation.
 java.lang.String toTailString()
          Gets paint chain string representation, starting from the next paint in this chanel.
 
Methods inherited from class com.davisor.graphics.data.PaintData
add, brighterPaint, createContext, darkerPaint, div, getCreationString, getPaint, getTransparency, isNull, mul, setCreationString, sub, writeReplace
 
Methods inherited from class com.davisor.data.GenericValue
max, min, toStatement, toXML
 
Methods inherited from class com.davisor.data.VoidValue
abs, ceil, deinterpolate, floor, getFormat, interpolate, negate, unit
 
Methods inherited from class com.davisor.data.VoidData
getDataValue, getType, setType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.davisor.data.DataValue
abs, ceil, deinterpolate, floor, getFormat, interpolate, max, min, negate, toStatement, toXML, unit
 
Methods inherited from interface com.davisor.data.Data
getType
 

Field Detail

M_next

protected PaintsData M_next
The next paint.

Constructor Detail

PaintsData

public PaintsData(PaintsData data,
                  boolean deep)
Deep or shallow copy constructor. If shallow, the new object shares underlying type with the original object. If deep, the type is dupped.

Parameters:
data - source data
deep - determine if copying is deep or shallow
See Also:
VoidData.getType(), Type.dup()

PaintsData

public PaintsData(PaintType type,
                  java.awt.Paint paint,
                  PaintsData first)
           throws InvalidDataException
Constructs a paint data object that terminates a paint chain. If a references to the first paint in the chain is given, this paint is made to point back to it, thus making the chain circular. If no reference to the first paint is given, the chain ends to this paint.

Parameters:
type - custom paint type
paint - paint for this node
first - first paint in a paint chain (may be null)
See Also:
next(), PaintsData(PaintType,Paint,PaintsData,String,ParsePosition)

PaintsData

public PaintsData(PaintType type,
                  java.awt.Paint paint,
                  PaintsData first,
                  java.lang.String paints,
                  java.text.ParsePosition status)
           throws InvalidDataException
Constructs a first or intermediate paint in a paint chain. If a reference to the first paint in this chain is already known and given, this paint pass that reference forward, and also become an intermediate paint member in that paint chain. If no reference to the first paint is known or given, this paint will pass a reference to itself forward, and thus become the first paint in a new paint chain.

The declaration of the paints following this paint are defined with a paint spesification string, as described by PaintParameters class.

Parameters:
type - custom paint type
paint - paint for this node
first - first paint in a paint chain (may be null)
paints - paint spesifications for remaining paints
status - parse status
See Also:
PaintsData(PaintType,Paint,PaintsData), PaintType.toData(String,ParsePosition,PaintsData), PaintParameters
Method Detail

next

public BetterPaint next()
Gets the next paint in this paint series.

Specified by:
next in interface BetterPaint
Overrides:
next in class PaintData
Returns:
a reference to this object

compareTo

public int compareTo(java.lang.Object o)
Compares this data agains other data objects.

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class GenericValue
See Also:
GenericValue.max(com.davisor.data.DataValue), GenericValue.min(com.davisor.data.DataValue), Compare.compareTo(Object,Object)

setValue

public void setValue(java.lang.String value,
                     java.text.ParsePosition status)
              throws InvalidDataException
Set data value.

Specified by:
setValue in interface DataValue
Overrides:
setValue in class VoidValue
Parameters:
value - new data value (may be null)
status - parse status (may be null)
Returns:
a reference to this Data object
Throws:
InvalidDataException - 'value' can not be interpreted

dup

public com.davisor.core.Dupable dup()
Makes a deep copy of this object.

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

getNext

public PaintsData getNext()
Gets the next paint in this paint chain.


equals

public boolean equals(java.lang.Object o)
Tests if this object is equal with another object.

Paints data objects are equal if their super-classes are, and if they both have exactly the same paints data object as their next paints list node.

Overrides:
equals in class PaintData
See Also:
Compare.equals(Object,Object)

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class PaintData

toString

public java.lang.String toString()
Gets paint chain string representation.

Specified by:
toString in interface DataValue
Overrides:
toString in class PaintData
See Also:
toTailString()

toTailString

public java.lang.String toTailString()
Gets paint chain string representation, starting from the next paint in this chanel.

See Also:
toString()


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