public class RtfGenerator
extends java.lang.Object
The following RTF features are supported:
| Constructor and Description |
|---|
RtfGenerator(java.awt.Color mainBG)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendNewline()
Adds a newline to the RTF document.
|
void |
appendToDoc(java.lang.String text,
java.awt.Font f,
java.awt.Color fg,
java.awt.Color bg)
Appends styled text to the RTF document being generated.
|
void |
appendToDoc(java.lang.String text,
java.awt.Font f,
java.awt.Color fg,
java.awt.Color bg,
boolean underline)
Appends styled text to the RTF document being generated.
|
void |
appendToDoc(java.lang.String text,
java.awt.Font f,
java.awt.Color fg,
java.awt.Color bg,
boolean underline,
boolean setFG)
Appends styled text to the RTF document being generated.
|
void |
appendToDocNoFG(java.lang.String text,
java.awt.Font f,
java.awt.Color bg,
boolean underline)
Appends styled text to the RTF document being generated.
|
java.lang.String |
getRtf()
Returns the RTF document created by this generator.
|
void |
reset()
Resets this generator.
|
public void appendNewline()
appendToDoc(String, Font, Color, Color)public void appendToDoc(java.lang.String text,
java.awt.Font f,
java.awt.Color fg,
java.awt.Color bg)
text - The text to append.f - The font of the text. If this is null, the
default font is used.fg - The foreground of the text. If this is null,
the default foreground color is used.bg - The background color of the text. If this is
null, the default background color is used.appendNewline()public void appendToDocNoFG(java.lang.String text,
java.awt.Font f,
java.awt.Color bg,
boolean underline)
text - The text to append.f - The font of the text. If this is null, the
default font is used.bg - The background color of the text. If this is
null, the default background color is used.underline - Whether the text should be underlined.appendNewline()public void appendToDoc(java.lang.String text,
java.awt.Font f,
java.awt.Color fg,
java.awt.Color bg,
boolean underline)
text - The text to append.f - The font of the text. If this is null, the
default font is used.fg - The foreground of the text. If this is null,
the default foreground color is used.bg - The background color of the text. If this is
null, the default background color is used.underline - Whether the text should be underlined.appendNewline()public void appendToDoc(java.lang.String text,
java.awt.Font f,
java.awt.Color fg,
java.awt.Color bg,
boolean underline,
boolean setFG)
text - The text to append.f - The font of the text. If this is null, the
default font is used.fg - The foreground of the text. If this is null,
the default foreground color is used.bg - The background color of the text. If this is
null, the default background color is used.underline - Whether the text should be underlined.setFG - Whether the foreground specified by fg should
be honored (if it is non-null).appendNewline()public java.lang.String getRtf()
String.public void reset()