fop 0.90alpha1

org.apache.fop.fo.properties
Class ColorTypeProperty

java.lang.Object
  |
  +--org.apache.fop.fo.properties.Property
        |
        +--org.apache.fop.fo.properties.ColorTypeProperty
All Implemented Interfaces:
ColorType

public class ColorTypeProperty
extends Property
implements ColorType

Superclass for properties that wrap ColorType values


Inner Class Summary
static class ColorTypeProperty.Maker
          Inner class for creating instances of ColorTypeProperty
 
Field Summary
protected  float alpha
          the alpha component (indicator of opaque-ness) 0.0 - 1.0; 0.0 is completely transparent; 1.0 is completely opaque see definition at http://java.sun.com/j2se/1.3/docs/api/java/awt/Color.html
protected  float blue
          the blue component
protected  float green
          the green component
protected static java.lang.String[] NAMES
          The names of the predefined colors
protected  float red
          the red component
protected static int[][] VALUES
          The color values for the predefined colors
 
Fields inherited from class org.apache.fop.fo.properties.Property
log
 
Constructor Summary
ColorTypeProperty(float red, float green, float blue)
          Main constructor
ColorTypeProperty(java.lang.String value)
          Set the colour given a particular String specifying either a colour name or #RGB or #RRGGBB
 
Method Summary
static int convertChannelToInteger(float floatValue)
           
 float getAlpha()
          Returns the alpha (degree of opaque-ness) component of the color.
 java.awt.Color getAWTColor()
          Returns an AWT instance of this color
 float getBlue()
          Returns the blue component of the color.
 ColorTypeProperty getColorType()
          Can't convert to any other types
 float getGreen()
          Returns the green component of the color.
 java.lang.Object getObject()
          This method expects to be overridden by subclasses
 float getRed()
          Returns the red component of the color.
 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

red

protected float red
the red component

green

protected float green
the green component

blue

protected float blue
the blue component

alpha

protected float alpha
the alpha component (indicator of opaque-ness) 0.0 - 1.0; 0.0 is completely transparent; 1.0 is completely opaque see definition at http://java.sun.com/j2se/1.3/docs/api/java/awt/Color.html

NAMES

protected static final java.lang.String[] NAMES
The names of the predefined colors

VALUES

protected static final int[][] VALUES
The color values for the predefined colors
Constructor Detail

ColorTypeProperty

public ColorTypeProperty(float red,
                         float green,
                         float blue)
Main constructor
Parameters:
red - red component
green - green component
blue - blue component

ColorTypeProperty

public ColorTypeProperty(java.lang.String value)
Set the colour given a particular String specifying either a colour name or #RGB or #RRGGBB
Parameters:
value - RGB value as String to be parsed
Method Detail

getBlue

public float getBlue()
Returns the blue component of the color.
Specified by:
getBlue in interface ColorType
Returns:
float a value between 0.0 and 1.0

getGreen

public float getGreen()
Returns the green component of the color.
Specified by:
getGreen in interface ColorType
Returns:
float a value between 0.0 and 1.0

getRed

public float getRed()
Returns the red component of the color.
Specified by:
getRed in interface ColorType
Returns:
float a value between 0.0 and 1.0

getAlpha

public float getAlpha()
Returns the alpha (degree of opaque-ness) component of the color.
Specified by:
getAlpha in interface ColorType
Returns:
float a value between 0.0 (fully transparent) and 1.0 (fully opaque)

getAWTColor

public java.awt.Color getAWTColor()
Returns an AWT instance of this color
Specified by:
getAWTColor in interface ColorType
Returns:
float the AWT color represented by this ColorType instance

convertChannelToInteger

public static int convertChannelToInteger(float floatValue)
Parameters:
floatValue - value (between 0.0 and 1.0) of color channel
Returns:
integer equivalent (between 0 and 255)

toString

public java.lang.String toString()
Overrides:
toString in class Property
See Also:
Object.toString()

getColorType

public ColorTypeProperty getColorType()
Can't convert to any other types
Overrides:
getColorType in class Property
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

fop 0.90alpha1

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