org.jfor.jfor.rtflib.rtfdoc
Class RtfColorTable

java.lang.Object
  extended byorg.jfor.jfor.rtflib.rtfdoc.RtfColorTable

public class RtfColorTable
extends java.lang.Object

Singelton of the RTF color table. This class was created for tag processing.

Author:
Andreas Putz

Method Summary
 int getColorNumber(int red, int green, int blue)
          Gets the number of color in the color table
 java.lang.Integer getColorNumber(java.lang.String name)
          get the RTF number of a named color
static RtfColorTable getInstance()
          Singelton.
 void writeColors(RtfHeader header)
          Writes the color table in the header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RtfColorTable getInstance()
Singelton.

Returns:
The instance of RTFColorTable

getColorNumber

public java.lang.Integer getColorNumber(java.lang.String name)
get the RTF number of a named color

Returns:
null if name not found

getColorNumber

public int getColorNumber(int red,
                          int green,
                          int blue)
Gets the number of color in the color table

Parameters:
red - Color level red
green - Color level green
blue - Color level blue
Returns:
The number of the color in the table

writeColors

public void writeColors(RtfHeader header)
                 throws java.io.IOException
Writes the color table in the header.

Parameters:
header - The header container to write in
Throws:
java.io.IOException - On error