fop 0.92beta

org.apache.fop.area
Class Trait.Color

java.lang.Object
  extended byorg.apache.fop.area.Trait.Color
All Implemented Interfaces:
ColorType, java.io.Serializable
Enclosing class:
Trait

public static class Trait.Color
extends java.lang.Object
implements ColorType, java.io.Serializable

Serializable ColorType implementation for the area tree.

See Also:
Serialized Form

Constructor Summary
Trait.Color(ColorType col)
          Copy constructor
Trait.Color(float r, float g, float b, float a)
          Creates a new Color instance
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 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.
 float getGreen()
          Returns the green component of the color.
 float getRed()
          Returns the red component of the color.
 int hashCode()
           
static ColorType makeSerializable(ColorType col)
          Converts a given color to a serializable instance if necessary.
 java.lang.String toString()
           
static Trait.Color valueOf(java.lang.String s)
          Returns a Color represtation of a string of the format "#RRGGBB".
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Trait.Color

public Trait.Color(float r,
                   float g,
                   float b,
                   float a)
Creates a new Color instance

Parameters:
r - the red component
g - the green component
b - the blue component
a - the alpha component

Trait.Color

public Trait.Color(ColorType col)
Copy constructor

Parameters:
col - the ColorType instance which shall be duplicated
Method Detail

getRed

public float getRed()
Description copied from interface: ColorType
Returns the red component of the color.

Specified by:
getRed in interface ColorType
Returns:
float a value between 0.0 and 1.0
See Also:
ColorType.getRed()

getGreen

public float getGreen()
Description copied from interface: ColorType
Returns the green component of the color.

Specified by:
getGreen in interface ColorType
Returns:
float a value between 0.0 and 1.0
See Also:
ColorType.getGreen()

getBlue

public float getBlue()
Description copied from interface: ColorType
Returns the blue component of the color.

Specified by:
getBlue in interface ColorType
Returns:
float a value between 0.0 and 1.0
See Also:
ColorType.getBlue()

getAlpha

public float getAlpha()
Description copied from interface: ColorType
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)
See Also:
ColorType.getAlpha()

getAWTColor

public java.awt.Color getAWTColor()
Description copied from interface: ColorType
Returns an AWT instance of this color

Specified by:
getAWTColor in interface ColorType
Returns:
float the AWT color represented by this ColorType instance
See Also:
ColorType.getAWTColor()

makeSerializable

public static ColorType makeSerializable(ColorType col)
Converts a given color to a serializable instance if necessary.

Parameters:
col - the color
Returns:
the serializable color value.

hashCode

public int hashCode()
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object obj)
See Also:
Object.equals(java.lang.Object)

valueOf

public static Trait.Color valueOf(java.lang.String s)
Returns a Color represtation of a string of the format "#RRGGBB".

Parameters:
s - the string
Returns:
the Color value

toString

public java.lang.String toString()
See Also:
Object.toString()

fop 0.92beta

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