Package com.lowagie.text.rtf.parser
Class RtfImportMappings
- java.lang.Object
-
- com.lowagie.text.rtf.parser.RtfImportMappings
-
public class RtfImportMappings extends java.lang.ObjectThe 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
Fields Modifier and Type Field Description private java.util.HashMapcolorMappingsThe colorNr to Color mappings.private java.util.HashMapfontMappingsThe fontNr to fontName mappings.private java.util.HashMaplistMappingsThe listNr to List mappings.private java.util.HashMapstylesheetListMappingsThe sytlesheetListNr to Stylesheet mappings.
-
Constructor Summary
Constructors Constructor Description RtfImportMappings()Constructs a new RtfImportMappings initialising the mappings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColor(java.lang.String colorNr, java.awt.Color color)Add a color to the list of mappings.voidaddFont(java.lang.String fontNr, java.lang.String fontName)Add a font to the list of mappings.voidaddList(java.lang.String listNr, java.lang.String list)Add a List to the list of mappings.voidaddStylesheetList(java.lang.String stylesheetListNr, java.lang.String list)Add a Stylesheet List to the list of mappings.java.util.HashMapgetColorMappings()Gets the list of color mappings.java.util.HashMapgetFontMappings()Gets the list of font mappings.java.util.HashMapgetListMappings()Gets the list of List mappings.java.util.HashMapgetStylesheetListMappings()Gets the list of Stylesheet mappings.
-
-
-
Field Detail
-
fontMappings
private java.util.HashMap fontMappings
The fontNr to fontName mappings.
-
colorMappings
private java.util.HashMap colorMappings
The colorNr to Color mappings.
-
listMappings
private java.util.HashMap listMappings
The listNr to List mappings.
-
stylesheetListMappings
private java.util.HashMap stylesheetListMappings
The sytlesheetListNr to Stylesheet 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.
-
addList
public void addList(java.lang.String listNr, java.lang.String list)Add a List to the list of mappings.- Parameters:
listNr- The List number.list- The List.
-
addStylesheetList
public void addStylesheetList(java.lang.String stylesheetListNr, java.lang.String list)Add a Stylesheet List to the list of mappings.- Parameters:
stylesheetListNr- The Stylesheet List number.list- The StylesheetList.
-
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.
-
getListMappings
public java.util.HashMap getListMappings()
Gets the list of List mappings.- Returns:
- The List mappings.
-
getStylesheetListMappings
public java.util.HashMap getStylesheetListMappings()
Gets the list of Stylesheet mappings. .- Returns:
- The Stylesheet List mappings.
-
-