fop 0.95

org.apache.fop.fo.properties
Class ColorProperty

java.lang.Object
  extended by org.apache.fop.fo.properties.Property
      extended by org.apache.fop.fo.properties.ColorProperty

public final class ColorProperty
extends Property

Class for properties that wrap Color values


Nested Class Summary
static class ColorProperty.Maker
          Inner class for creating instances of ColorTypeProperty
 
Field Summary
protected  java.awt.Color color
          The color represented by this property.
 
Fields inherited from class org.apache.fop.fo.properties.Property
log
 
Method Summary
 boolean equals(java.lang.Object o)
          
 java.awt.Color getColor(FOUserAgent foUserAgent)
          Returns an AWT instance of this color
 ColorProperty getColorProperty()
          Can't convert to any other types
static ColorProperty getInstance(java.awt.Color color)
          Returns an instance of a color property given a color
static ColorProperty getInstance(FOUserAgent foUserAgent, java.lang.String value)
          Set the color given a particular String.
 java.lang.Object getObject()
          This method expects to be overridden by subclasses
 int hashCode()
          
 java.lang.String toString()
          
 
Methods inherited from class org.apache.fop.fo.properties.Property
getCharacter, getCondLength, getEnum, getKeep, getLength, getLengthPair, getLengthRange, getList, getNCname, getNumber, getNumeric, getSpace, getSpecifiedValue, getString, isAuto, setSpecifiedValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

color

protected final java.awt.Color color
The color represented by this property.

Method Detail

getInstance

public static ColorProperty getInstance(FOUserAgent foUserAgent,
                                        java.lang.String value)
                                 throws PropertyException
Set the color given a particular String. For a full List of supported values please see ColorUtil.

Parameters:
foUserAgent - FOP user agent
value - RGB value as String to be parsed
Throws:
PropertyException - if the value can't be parsed
See Also:
ColorUtil.parseColorString(FOUserAgent, String)

getInstance

public static ColorProperty getInstance(java.awt.Color color)
Returns an instance of a color property given a color

Parameters:
color - the color value
Returns:
the color property

getColor

public java.awt.Color getColor(FOUserAgent foUserAgent)
Returns an AWT instance of this color

Overrides:
getColor in class Property
Parameters:
foUserAgent - FOP user agent
Returns:
float the AWT color represented by this ColorType instance

toString

public java.lang.String toString()

Overrides:
toString in class Property

getColorProperty

public ColorProperty getColorProperty()
Can't convert to any other types

Returns:
this.colorType

getObject

public java.lang.Object getObject()
Description copied from class: Property
This method expects to be overridden by subclasses

Overrides:
getObject in class Property
Returns:
this.colorType cast as an Object

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

fop 0.95

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.