## com.lowagie.text.rtf.direct
Class RtfColorTableParser

    java.lang.Object
      com.lowagie.text.rtf.direct.RtfColorTableParser

    public class RtfColorTableParser

extends java.lang.Object

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

Version:
  $Revision: 1.5 $
Author:
  Mark Hall (mhall@edu.uni-klu.ac.at)

Field Summary
`private int` `blue` The blue component of the current color being parsed.
`private int` `colorNr` The number of the current color being parsed.
`private int` `green` The green component of the current color being parsed.
`private RtfImportHeader` `importHeader` The RtfImportHeader to add color mappings to.
`private int` `red` The red component of the current color being parsed.

Constructor Summary
`RtfColorTableParser(RtfImportHeader importHeader)` Constructs a new RtfColorTableParser.

Method Summary
`void` `handleCtrlWord(java.lang.String ctrlWord, int groupLevel)` Handle RTF control words.
`void` `handleText(java.lang.String text, int groupLevel)` Handle text content.
`static boolean` `stringMatches(java.lang.String text, java.lang.String start)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### importHeader

    private RtfImportHeader importHeader

  The RtfImportHeader to add color mappings to.

### colorNr

    private int colorNr

  The number of the current color being parsed.

### red

    private int red

  The red component of the current color being parsed.

### green

    private int green

  The green component of the current color being parsed.

### blue

    private int blue

  The blue 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

### stringMatches

    public static boolean stringMatches(java.lang.String text,
                                        java.lang.String start)

### handleCtrlWord

    public void handleCtrlWord(java.lang.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(java.lang.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.