com.lowagie.text.rtf.direct
Class RtfImportMappings

java.lang.Object
  extended by com.lowagie.text.rtf.direct.RtfImportMappings

public class RtfImportMappings
extends java.lang.Object

The RtfImportMappings make it possible to define font and color mappings when using the RtfWriter2.importRtfFragment method. This is necessary, because a RTF fragment does not contain font or color information, just references to the font and color tables.

The font mappings are fontNr -> fontName and the color mappigns are colorNr -> Color.

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

Field Summary
private  java.util.HashMap colorMappings
          The colorNr to Color mappings.
private  java.util.HashMap fontMappings
          The fontNr to fontName mappings.
 
Constructor Summary
RtfImportMappings()
          Constructs a new RtfImportMappings initialising the mappings.
 
Method Summary
 void addColor(java.lang.String colorNr, java.awt.Color color)
          Add a color to the list of mappings.
 void addFont(java.lang.String fontNr, java.lang.String fontName)
          Add a font to the list of mappings.
 java.util.HashMap getColorMappings()
          Gets the list of color mappings.
 java.util.HashMap getFontMappings()
          Gets the list of font mappings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fontMappings

private java.util.HashMap fontMappings
The fontNr to fontName mappings.


colorMappings

private java.util.HashMap colorMappings
The colorNr to Color mappings.

Constructor Detail

RtfImportMappings

public RtfImportMappings()
Constructs a new RtfImportMappings initialising the mappings.

Method Detail

addFont

public void addFont(java.lang.String fontNr,
                    java.lang.String fontName)
Add a font to the list of mappings.

Parameters:
fontNr - The font number.
fontName - The font name.

addColor

public void addColor(java.lang.String colorNr,
                     java.awt.Color color)
Add a color to the list of mappings.

Parameters:
colorNr - The color number.
color - The Color.

getFontMappings

public java.util.HashMap getFontMappings()
Gets the list of font mappings. String to String.

Returns:
The font mappings.

getColorMappings

public java.util.HashMap getColorMappings()
Gets the list of color mappings. String to Color.

Returns:
The color mappings.