com.lowagie.text.rtf.direct

Class RtfColorTableParser

public class RtfColorTableParser extends Object

The RtfColorTableParser handles the events generated by the RtfTokeniser while the RTF color table is being parsed.

Version: $Revision: 1.6 $

Author: Mark Hall (mhall@edu.uni-klu.ac.at)

Field Summary
intblue
The blue component of the current color being parsed.
intcolorNr
The number of the current color being parsed.
intgreen
The green component of the current color being parsed.
RtfImportHeaderimportHeader
The RtfImportHeader to add color mappings to.
intred
The red component of the current color being parsed.
Constructor Summary
RtfColorTableParser(RtfImportHeader importHeader)
Constructs a new RtfColorTableParser.
Method Summary
voidhandleCtrlWord(String ctrlWord, int groupLevel)
Handle RTF control words.
voidhandleText(String text, int groupLevel)
Handle text content.
static booleanstringMatches(String text, String start)

Field Detail

blue

private int blue
The blue component of the current color being parsed.

colorNr

private int colorNr
The number of the current color being parsed.

green

private int green
The green component of the current color being parsed.

importHeader

private RtfImportHeader importHeader
The RtfImportHeader to add color mappings to.

red

private int red
The red component of the current color being parsed.

Constructor Detail

RtfColorTableParser

public RtfColorTableParser(RtfImportHeader importHeader)
Constructs a new RtfColorTableParser.

Parameters: importHeader The RtfImportHeader to add the color mappings to.

Method Detail

handleCtrlWord

public void handleCtrlWord(String ctrlWord, int groupLevel)
Handle RTF control words. The relevant control words are \red, \green and \blue each with a number specifying the value for that component.

Parameters: ctrlWord The control word to handle. groupLevel Unused

handleText

public void handleText(String text, int groupLevel)
Handle text content. This is to find the end of each color definition, because they are separated by a semicolon (;).

Parameters: text The text to handle. groupLevel Unused.

stringMatches

public static boolean stringMatches(String text, String start)