de.dante.extex.backend.documentWriter.rtf
Class RtfDocument

java.lang.Object
  extended byde.dante.extex.backend.documentWriter.rtf.RtfDocument
Direct Known Subclasses:
RtfDocumentWriter

public class RtfDocument
extends java.lang.Object

This class provides a container for an RTF document.

Version:
$Revision: 1.1 $
Author:
Gerd Neugebauer

Constructor Summary
RtfDocument()
          Creates a new object.
 
Method Summary
 java.lang.String getAuthor()
          Getter for author.
 java.lang.String getCreator()
          Getter for creator.
 java.lang.String getTitle()
          Getter for title.
protected  int mapColor(RgbColor col)
          Add a color to the color table if necessary and return a unique index.
protected  int mapFont(Font font)
          Add a font to the font table if necessary and return a unique index.
 void newPage(Color color)
          Start a new page.
protected  void put(byte b)
          Write a single byte to the target stream.
protected  void put(java.lang.String string)
          Write some bytes from a string to the target stream.
 void setAuthor(java.lang.String author)
          Setter for author.
 void setCreator(java.lang.String creator)
          Setter for creator.
 void setTitle(java.lang.String title)
          Setter for title.
 void write(java.io.OutputStream stream)
          Write the contents of the RTF file to a target stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RtfDocument

public RtfDocument()
Creates a new object.

Method Detail

getAuthor

public java.lang.String getAuthor()
Getter for author.

Returns:
the author

getCreator

public java.lang.String getCreator()
Getter for creator.

Returns:
the creator

getTitle

public java.lang.String getTitle()
Getter for title.

Returns:
the title

mapColor

protected int mapColor(RgbColor col)
Add a color to the color table if necessary and return a unique index.

Parameters:
col - the color
Returns:
the unique index in the color table

mapFont

protected int mapFont(Font font)
Add a font to the font table if necessary and return a unique index.

Parameters:
font - the font register
Returns:
the unique index in the font table

newPage

public void newPage(Color color)
             throws java.io.IOException
Start a new page.

Throws:
java.io.IOException - in case of an error

put

protected void put(byte b)
            throws java.io.IOException
Write a single byte to the target stream.

Parameters:
b - the byte to write
Throws:
java.io.IOException - in case of an error

put

protected void put(java.lang.String string)
            throws java.io.IOException
Write some bytes from a string to the target stream.

Parameters:
string - the source string
Throws:
java.io.IOException - in case of an error

setAuthor

public void setAuthor(java.lang.String author)
Setter for author.

Parameters:
author - the author to set

setCreator

public void setCreator(java.lang.String creator)
Setter for creator.

Parameters:
creator - the creator to set

setTitle

public void setTitle(java.lang.String title)
Setter for title.

Parameters:
title - the title to set

write

public void write(java.io.OutputStream stream)
           throws java.io.IOException
Write the contents of the RTF file to a target stream.

Parameters:
stream - the target stream
Throws:
java.io.IOException - in case of an error