Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

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

    public class RtfImportHeader

extends Object

The RtfImportHeader stores the docment header information from an RTF document that is being imported. Currently font and color settings are stored. The RtfImportHeader maintains a mapping from font and color numbers from the imported RTF document to the RTF document that is the target of the import. This guarantees that the merged document has the correct font and color settings.

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

Field Summary
`private HashMap` | `importColorMapping` The HashMap storing the color number mapings.
`private HashMap` | `importFontMapping` The HashMap storing the font number mappings.
`private RtfDocument` | `rtfDoc` The RtfDocument to get font and color numbers from.

Constructor Summary
`RtfImportHeader(RtfDocument rtfDoc)` Constructs a new RtfImportHeader.

Method Summary
`void` | `importColor(String colorNr, Color color)` Imports a color value.
`void` | `importFont(String fontNr, String fontName)` Imports a font.
`String` | `mapColorNr(String colorNr)` Performs the mapping from the original font number to the actual font number used in the RTF document.
`String` | `mapFontNr(String fontNr)` Performs the mapping from the original font number to the actual font number in the resulting RTF document.

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

Field Detail

### importFontMapping

    private HashMap importFontMapping

  The HashMap storing the font number mappings.

### importColorMapping

    private HashMap importColorMapping

  The HashMap storing the color number mapings.

### rtfDoc

    private RtfDocument rtfDoc

  The RtfDocument to get font and color numbers from.

Constructor Detail

### RtfImportHeader

    public RtfImportHeader(RtfDocument rtfDoc)

  Constructs a new RtfImportHeader.

  Parameters:
    `rtfDoc` - The RtfDocument to get font and color numbers from.

Method Detail

### importFont

    public void importFont(String fontNr,
                           String fontName)

  Imports a font. The font name is looked up in the RtfDocumentHeader and then the mapping from original font number to actual font number is added.

  Parameters:
    `fontNr` - The original font number.
    `fontName` - The font name to look up.

### mapFontNr

    public String mapFontNr(String fontNr)

  Performs the mapping from the original font number to the actual font number in the resulting RTF document. If the font number was not seen during import (thus no mapping) then 0 is returned, guaranteeing that the font number is always valid.

  Parameters:
    `fontNr` - The font number to map.
  Returns:
    The mapped font number.

### importColor

    public void importColor(String colorNr,
                            Color color)

  Imports a color value. The color number for the color defined by its red, green and blue values is determined and then the resulting mapping is added.

  Parameters:
    `colorNr` - The original color number.
    `color` - The color to import.

### mapColorNr

    public String mapColorNr(String colorNr)

  Performs the mapping from the original font number to the actual font number used in the RTF document. If the color number was not seen during import (thus no mapping) then 0 is returned, guaranteeing that the color number is always valid.

  Parameters:
    `colorNr` - The color number to map.
  Returns:
    The mapped color number

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD