com.lowagie.text.rtf.parser

Class RtfImportMappings

public class RtfImportMappings extends 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.

Since: 2.1.0

Author: Mark Hall (Mark.Hall@mail.room3b.eu) Howard Shank (hgshank@yahoo.com)

Field Summary
HashMapcolorMappings
The colorNr to Color mappings.
HashMapfontMappings
The fontNr to fontName mappings.
HashMaplistMappings
The listNr to List mappings.
HashMapstylesheetListMappings
The sytlesheetListNr to Stylesheet mappings.
Constructor Summary
RtfImportMappings()
Constructs a new RtfImportMappings initialising the mappings.
Method Summary
voidaddColor(String colorNr, Color color)
Add a color to the list of mappings.
voidaddFont(String fontNr, String fontName)
Add a font to the list of mappings.
voidaddList(String listNr, String list)
Add a List to the list of mappings.
voidaddStylesheetList(String stylesheetListNr, String list)
Add a Stylesheet List to the list of mappings.
HashMapgetColorMappings()
Gets the list of color mappings.
HashMapgetFontMappings()
Gets the list of font mappings.
HashMapgetListMappings()
Gets the list of List mappings.
HashMapgetStylesheetListMappings()
Gets the list of Stylesheet mappings.

Field Detail

colorMappings

private HashMap colorMappings
The colorNr to Color mappings.

fontMappings

private HashMap fontMappings
The fontNr to fontName mappings.

listMappings

private HashMap listMappings
The listNr to List mappings.

stylesheetListMappings

private HashMap stylesheetListMappings
The sytlesheetListNr to Stylesheet mappings.

Constructor Detail

RtfImportMappings

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

Method Detail

addColor

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

Parameters: colorNr The color number. color The Color.

addFont

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

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

addList

public void addList(String listNr, String list)
Add a List to the list of mappings.

Parameters: listNr The List number. list The List.

addStylesheetList

public void addStylesheetList(String stylesheetListNr, String list)
Add a Stylesheet List to the list of mappings.

Parameters: stylesheetListNr The Stylesheet List number. list The StylesheetList.

getColorMappings

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

Returns: The color mappings.

getFontMappings

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

Returns: The font mappings.

getListMappings

public HashMap getListMappings()
Gets the list of List mappings.

Returns: The List mappings.

getStylesheetListMappings

public HashMap getStylesheetListMappings()
Gets the list of Stylesheet mappings. .

Returns: The Stylesheet List mappings.