maspack.render.color
Class ColorMapBase

java.lang.Object
  extended by maspack.render.color.ColorMapBase
All Implemented Interfaces:
java.lang.Cloneable, CompositeProperty, HasProperties, ColorMap, Clonable, Scannable
Direct Known Subclasses:
GreyscaleColorMap, HueColorMap, InterpolatingColorMap

public abstract class ColorMapBase
extends java.lang.Object
implements ColorMap, HasProperties, CompositeProperty, Scannable


Field Summary
static PropertyList myProps
           
 
Constructor Summary
ColorMapBase()
           
 
Method Summary
 ColorMapBase clone()
          Returns a clone of this composite property.
abstract  ColorMapBase copy()
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
static int getColor3Value(java.awt.Color c)
           
static int getColor4Value(java.awt.Color c)
           
 Property getProperty(java.lang.String pathName)
          Returns a property associated with a specified path name.
 HasProperties getPropertyHost()
          Should be either HierarchyNode or HasProperties
 PropertyInfo getPropertyInfo()
          If this object is a property, returns the corresponding information
static java.lang.Class<?>[] getSubClasses()
           
 boolean isWritable()
          Returns true if this component should in fact be written to secondary storage.
 void scan(ReaderTokenizer rtok, java.lang.Object ref)
          Scans this element from a ReaderTokenizer.
 void setPropertyHost(HasProperties newParent)
          Sets the host for this property.
 void setPropertyInfo(PropertyInfo info)
          Sets the property information for this property.
 void write(java.io.PrintWriter pw, NumberFormat fmt, java.lang.Object ref)
          Writes a text description of this element to a PrintWriter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface maspack.render.color.ColorMap
getColor, getHSV, getHSV, getRGB, getRGB
 

Field Detail

myProps

public static PropertyList myProps
Constructor Detail

ColorMapBase

public ColorMapBase()
Method Detail

getSubClasses

public static java.lang.Class<?>[] getSubClasses()

getProperty

public Property getProperty(java.lang.String pathName)
Description copied from interface: HasProperties
Returns a property associated with a specified path name. All properties exported by this object must have a name which is a valid Java identifier. Specifying one of these names causes the corresponding Property to be returned. Handles to sub-properties can also be obtained by delimiting the sub-property name(s) by '.' characters. A sub-property exists if the value of a property is itself an object which exports properties. It is only possible to obtain a sub-property handle if each of its ancestor properties exports their values by reference.

Specified by:
getProperty in interface HasProperties
Parameters:
pathName - name of the desired property or sub-property
Returns:
handle to the property

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Returns:
static information for all exported properties

getPropertyInfo

public PropertyInfo getPropertyInfo()
Description copied from interface: CompositeProperty
If this object is a property, returns the corresponding information

Specified by:
getPropertyInfo in interface CompositeProperty

setPropertyInfo

public void setPropertyInfo(PropertyInfo info)
Description copied from interface: CompositeProperty
Sets the property information for this property.

Specified by:
setPropertyInfo in interface CompositeProperty
Parameters:
info - property information

getPropertyHost

public HasProperties getPropertyHost()
Description copied from interface: CompositeProperty
Should be either HierarchyNode or HasProperties

Specified by:
getPropertyHost in interface CompositeProperty

setPropertyHost

public void setPropertyHost(HasProperties newParent)
Description copied from interface: CompositeProperty
Sets the host for this property.

Specified by:
setPropertyHost in interface CompositeProperty
Parameters:
newParent - host for this property

getColor3Value

public static int getColor3Value(java.awt.Color c)

getColor4Value

public static int getColor4Value(java.awt.Color c)

copy

public abstract ColorMapBase copy()

clone

public ColorMapBase clone()
                   throws java.lang.CloneNotSupportedException
Description copied from interface: CompositeProperty
Returns a clone of this composite property.

Specified by:
clone in interface CompositeProperty
Specified by:
clone in interface Clonable
Overrides:
clone in class java.lang.Object
Returns:
clone of this property
Throws:
java.lang.CloneNotSupportedException

write

public void write(java.io.PrintWriter pw,
                  NumberFormat fmt,
                  java.lang.Object ref)
           throws java.io.IOException
Writes a text description of this element to a PrintWriter. The text description should be compatable with scan and complete enough to allow full reconstruction of the element.

Specified by:
write in interface Scannable
Parameters:
pw - stream for writing the element
fmt - numeric formating information
ref - optional reference object which can be used for producing references to other objects
Throws:
java.io.IOException - if an I/O error occured

isWritable

public boolean isWritable()
Returns true if this component should in fact be written to secondary storage. This gives subclasses control over whether or not they are actually written out.

Specified by:
isWritable in interface Scannable
Returns:
true if this component should be written to secondary storage.

scan

public void scan(ReaderTokenizer rtok,
                 java.lang.Object ref)
          throws java.io.IOException
Scans this element from a ReaderTokenizer. The expected text format is assumed to be compatible with that produced by write.

Specified by:
scan in interface Scannable
Parameters:
rtok - Tokenizer from which to scan the element
ref - optional reference object which can be used for resolving references to other objects
Throws:
java.io.IOException - if an I/O or formatting error occured