Class RtfColor
java.lang.Object
com.lowagie.text.rtf.RtfElement
com.lowagie.text.rtf.style.RtfColor
- All Implemented Interfaces:
RtfBasicElement, RtfExtendedElement
The RtfColor stores one rtf color value for a rtf document
- Version:
- $Id: RtfColor.java 3580 2008-08-06 15:52:00Z howard_s $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intThe blue valueprivate static final byteConstant for the end of one color entryprivate static final byte[]Constant for BLUE valueprivate static final byte[]Constant for GREEN valueprivate static final byte[]Constant for the number of the color in the list of colorsprivate static final byte[]Constant for RED valueprivate intThe number of the color in the list of colorsprivate intThe green valueprivate intThe red valueFields inherited from class RtfElement
document, inHeader, inTableFields inherited from interface RtfBasicElement
CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR -
Constructor Summary
ConstructorsModifierConstructorDescriptionRtfColor(RtfDocument doc, int red, int green, int blue) Constructs a RtfColor based on the red/green/blue valuesprotectedRtfColor(RtfDocument doc, int red, int green, int blue, int colorNumber) Constructor only for use when initializing the RtfColorListRtfColor(RtfDocument doc, RtfColor col) Constructs a RtfColor as a clone of an existing RtfColorRtfColor(RtfDocument doc, Color col) Constructs a RtfColor based on the Color -
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this RtfColor is equal to another RtfColor.intgetBlue()Get the blue value of this RtfColorintGets the number of this RtfColor in the list of colorsintgetGreen()Get the green value of this RtfColorintgetRed()Get the red value of this RtfColorinthashCode()Returns the hash code of this RtfColor.voidSets the RtfDocument this RtfColor belongs tovoidwriteBegin(OutputStream result) Writes the beginning of this RtfColorvoidwriteContent(OutputStream out) unusedvoidwriteDefinition(OutputStream result) Write the definition part of this RtfColor.voidwriteEnd(OutputStream result) UnusedMethods inherited from class RtfElement
intToByteArray, isInTable, setInHeader, setInTableMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RtfBasicElement
setInHeader, setInTable
-
Field Details
-
COLOR_RED
private static final byte[] COLOR_REDConstant for RED value -
COLOR_GREEN
private static final byte[] COLOR_GREENConstant for GREEN value -
COLOR_BLUE
private static final byte[] COLOR_BLUEConstant for BLUE value -
COLON
private static final byte COLONConstant for the end of one color entry- See Also:
-
COLOR_NUMBER
private static final byte[] COLOR_NUMBERConstant for the number of the color in the list of colors -
colorNumber
private int colorNumberThe number of the color in the list of colors -
red
private int redThe red value -
green
private int greenThe green value -
blue
private int blueThe blue value
-
-
Constructor Details
-
RtfColor
Constructor only for use when initializing the RtfColorList- Parameters:
doc- The RtfDocument this RtfColor belongs tored- The red value to usegreen- The green value to useblue- The blue value to usecolorNumber- The number of the color in the color list
-
RtfColor
Constructs a RtfColor as a clone of an existing RtfColor- Parameters:
doc- The RtfDocument this RtfColor belongs tocol- The RtfColor to use as a base
-
RtfColor
Constructs a RtfColor based on the Color- Parameters:
doc- The RtfDocument this RtfColor belongs tocol- The Color to base this RtfColor on
-
RtfColor
Constructs a RtfColor based on the red/green/blue values- Parameters:
doc- The RtfDocument this RtfColor belongs tored- The red value to usegreen- The green value to useblue- The blue value to use
-
-
Method Details
-
writeContent
unused- Specified by:
writeContentin interfaceRtfBasicElement- Specified by:
writeContentin classRtfElement- Parameters:
out- TheOutputStreamto write the content to- Throws:
IOException
-
writeDefinition
Write the definition part of this RtfColor.- Specified by:
writeDefinitionin interfaceRtfExtendedElement- Parameters:
result- TheOutputStreamto write the element definition to- Throws:
IOException
-
writeBegin
Writes the beginning of this RtfColor -
writeEnd
Unused- Parameters:
result- TheOutputStreamto which nothing will be written
-
equals
-
hashCode
-
getBlue
public int getBlue()Get the blue value of this RtfColor- Returns:
- The blue value
-
getGreen
public int getGreen()Get the green value of this RtfColor- Returns:
- The green value
-
getRed
public int getRed()Get the red value of this RtfColor- Returns:
- The red value
-
getColorNumber
public int getColorNumber()Gets the number of this RtfColor in the list of colors- Returns:
- Returns the colorNumber.
-
setRtfDocument
Sets the RtfDocument this RtfColor belongs to- Specified by:
setRtfDocumentin interfaceRtfBasicElement- Overrides:
setRtfDocumentin classRtfElement- Parameters:
doc- The RtfDocument to use
-