public class RtfDestinationColorTable extends RtfDestination
RtfDestinationColorTable handles data destined for the color table destination| Modifier and Type | Field and Description |
|---|---|
private int |
blue
The blue component of the current color being parsed.
|
private java.util.HashMap |
colorMap
Color map object for conversions
|
private int |
colorNr
The number of the current color being parsed.
|
private int |
cshade
Specifies the shade when specifying a theme color.
|
private int |
ctint
Specifies the tint when specifying a theme color.
|
private int |
green
The green component of the current color being parsed.
|
private RtfImportMgr |
importHeader
The RtfImportHeader to add color mappings to.
|
private int |
red
The red component of the current color being parsed.
|
private int |
themeColor
Specifies the use of a theme color.
|
lastCtrlWord, modified, rtfParser| Constructor and Description |
|---|
RtfDestinationColorTable()
Constructor.
|
RtfDestinationColorTable(RtfParser parser)
Constructs a new RtfColorTableParser.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
closeDestination()
Clean up when destination is closed.
|
java.awt.Color |
getColor(java.lang.String key)
Get the
Color object that is mapped to the key. |
boolean |
handleCharacter(int ch)
Handle text for this destination
|
boolean |
handleCloseGroup()
Clean up when group is closed.
|
boolean |
handleControlWord(RtfCtrlWordData ctrlWordData)
Handle control word for this destination
|
boolean |
handleOpenGroup()
Setup when group is opened.
|
boolean |
handleOpeningSubGroup()
Handle a new subgroup contained within this group
|
private void |
processColor()
Processes the color triplet parsed from the document.
|
private void |
setBlue(int value)
Set the blue color value.
|
private void |
setGreen(int value)
Set the green color value.
|
void |
setParser(RtfParser parser)
Set the parser to use with the RtfDestination object.
|
private void |
setRed(int value)
Set the red color to value.
|
private void |
setShade(int value)
Set the shade value
|
private void |
setThemeColor(int value)
Set the theme color value.
|
private void |
setTint(int value)
Set the tint value
|
void |
setToDefaults()
Set default values.
|
addListener, afterCharacter, afterCtrlWord, beforeCharacter, beforeCtrlWord, getNewTokeniserState, isModified, onCharacter, onCloseGroup, onCtrlWord, onOpenGroup, removeListenerprivate RtfImportMgr importHeader
private int colorNr
private int red
private int green
private int blue
private int ctint
cshade,
themeColorprivate int cshade
ctint,
themeColorprivate int themeColor
RtfColorThemes,
ctint,
cshadeprivate java.util.HashMap colorMap
public RtfDestinationColorTable()
public RtfDestinationColorTable(RtfParser parser)
parser - an RtfParserpublic void setParser(RtfParser parser)
RtfDestinationsetParser in class RtfDestinationparser - The RtfParser object.public boolean handleOpeningSubGroup()
RtfDestinationhandleOpeningSubGroup in class RtfDestinationpublic boolean closeDestination()
RtfDestinationcloseDestination in class RtfDestinationpublic boolean handleCloseGroup()
RtfDestinationhandleCloseGroup in class RtfDestinationpublic boolean handleOpenGroup()
RtfDestinationhandleOpenGroup in class RtfDestinationpublic boolean handleCharacter(int ch)
RtfDestinationhandleCharacter in class RtfDestinationpublic boolean handleControlWord(RtfCtrlWordData ctrlWordData)
RtfDestinationhandleControlWord in class RtfDestinationctrlWordData - The control word and parameter information objectpublic void setToDefaults()
setToDefaults in class RtfDestinationprivate void processColor()
private void setRed(int value)
value - Value to set red to.private void setGreen(int value)
value - Value to set green to.private void setBlue(int value)
value - Value to set blue to.private void setTint(int value)
value - Value to set the tint toctintprivate void setShade(int value)
value - Value to set the shade tocshadeprivate void setThemeColor(int value)
value - Value to set the theme color toRtfColorThemespublic java.awt.Color getColor(java.lang.String key)
Color object that is mapped to the key.key - The map number.
*@return Color object from the map. null if key does not exist.