org.apache.fop.fo.properties

Class 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 Color
color
The color represented by this property.

Fields inherited from class org.apache.fop.fo.properties.Property

log

Method Summary

boolean
equals(Object o)
Color
getColor(FOUserAgent foUserAgent)
Returns an AWT instance of this color
ColorProperty
getColorProperty()
Can't convert to any other types
static ColorProperty
getInstance(Color color)
Returns an instance of a color property given a color
static ColorProperty
getInstance(FOUserAgent foUserAgent, String value)
Set the color given a particular String.
Object
getObject()
int
hashCode()
String
toString()

Methods inherited from class org.apache.fop.fo.properties.Property

getCharacter, getColor, getCondLength, getEnum, getKeep, getLength, getLengthPair, getLengthRange, getList, getNCname, getNumber, getNumeric, getObject, getSpace, getSpecifiedValue, getString, isAuto, setSpecifiedValue, toString

Field Details

color

protected final Color color
The color represented by this property.

Method Details

equals

public boolean equals(Object o)

getColor

public Color getColor(FOUserAgent foUserAgent)
Returns an AWT instance of this color
Overrides:
getColor in interface Property
Parameters:
foUserAgent - FOP user agent
Returns:
float the AWT color represented by this ColorType instance

getColorProperty

public ColorProperty getColorProperty()
Can't convert to any other types
Returns:
this.colorType

getInstance

public static ColorProperty getInstance(Color color)
Returns an instance of a color property given a color
Parameters:
color - the color value
Returns:
the color property

getInstance

public static ColorProperty getInstance(FOUserAgent foUserAgent,
                                        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

getObject

public Object getObject()
Overrides:
getObject in interface Property
Returns:
this.colorType cast as an Object

hashCode

public int hashCode()

toString

public String toString()
Overrides:
toString in interface Property

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