|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.lowagie.text.Font com.lowagie.text.rtf.style.RtfFont com.lowagie.text.rtf.style.RtfParagraphStyle
public class RtfParagraphStyle
The RtfParagraphStyle stores all style/formatting attributes of a RtfParagraph. Additionally it also supports the style name system available in RTF. The RtfParagraphStyle is a Font and can thus be used as such. To use the stylesheet functionality it needs to be set as the font of a Paragraph. Otherwise it will work like a RtfFont. It also supports inheritance of styles.
Field Summary | |
---|---|
static byte[] |
ALIGN_CENTER
Constant for center alignment |
static byte[] |
ALIGN_JUSTIFY
Constant for justified alignment |
static byte[] |
ALIGN_LEFT
Constant for left alignment |
static byte[] |
ALIGN_RIGHT
Constant for right alignment |
static byte[] |
FIRST_LINE_INDENT
Constant for the first line indentation |
static byte[] |
INDENT_LEFT
Constant for left indentation |
static byte[] |
INDENT_RIGHT
Constant for right indentation |
static byte[] |
KEEP_TOGETHER
Constant for keeping the paragraph together on one page |
static byte[] |
KEEP_TOGETHER_WITH_NEXT
Constant for keeping the paragraph together with the next one on one page |
static byte[] |
SPACING_AFTER
Constant for the space after the paragraph. |
static byte[] |
SPACING_BEFORE
Constant for the space before the paragraph. |
static RtfParagraphStyle |
STYLE_HEADING_1
The style for level 1 headings. |
static RtfParagraphStyle |
STYLE_HEADING_2
The style for level 2 headings. |
static RtfParagraphStyle |
STYLE_HEADING_3
The style for level 3 headings. |
static RtfParagraphStyle |
STYLE_NORMAL
The NORMAL/STANDARD style. |
Fields inherited from class com.lowagie.text.rtf.style.RtfFont |
---|
DEFAULT_FONT, document, FONT_SIZE, STYLE_BOLD, STYLE_DOUBLE_STRIKETHROUGH, STYLE_EMBOSSED, STYLE_ENGRAVED, STYLE_HIDDEN, STYLE_ITALIC, STYLE_NONE, STYLE_OUTLINE, STYLE_SHADOW, STYLE_STRIKETHROUGH, STYLE_UNDERLINE |
Fields inherited from class com.lowagie.text.Font |
---|
BOLD, BOLDITALIC, COURIER, DEFAULTSIZE, HELVETICA, ITALIC, NORMAL, STRIKETHRU, SYMBOL, TIMES_ROMAN, UNDEFINED, UNDERLINE, ZAPFDINGBATS |
Fields inherited from interface com.lowagie.text.rtf.RtfBasicElement |
---|
CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR |
Constructor Summary | |
---|---|
RtfParagraphStyle(RtfDocument doc,
RtfParagraphStyle style)
Constructs a RtfParagraphStyle from another RtfParagraphStyle. |
|
RtfParagraphStyle(java.lang.String styleName,
java.lang.String basedOnName)
Constructs a new RtfParagraphStyle that is based on an existing RtfParagraphStyle. |
|
RtfParagraphStyle(java.lang.String styleName,
java.lang.String fontName,
int fontSize,
int fontStyle,
java.awt.Color fontColor)
Constructs a new RtfParagraphStyle with the given attributes. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Tests whether two RtfParagraphStyles are equal. |
int |
getAlignment()
Gets the alignment of this RtfParagraphStyle. |
java.lang.String |
getBasedOnName()
Gets the name of the RtfParagraphStyle this RtfParagraphStyle is based on. |
int |
getFirstLineIndent()
Gets the first line indentation of this RtfParagraphStyle. |
int |
getIndentLeft()
Gets the left indentation of this RtfParagraphStyle. |
int |
getIndentRight()
Gets the right indentation of this RtfParagraphStyle. |
boolean |
getKeepTogether()
Gets whether the lines in the paragraph should be kept together in this RtfParagraphStyle. |
boolean |
getKeepTogetherWithNext()
Gets whether the paragraph should be kept together with the next in this RtfParagraphStyle. |
int |
getLineLeading()
Gets the line leading of this RtfParagraphStyle. |
int |
getSpacingAfter()
Gets the space after the paragraph of this RtfParagraphStyle. |
int |
getSpacingBefore()
Gets the space before the paragraph of this RtfParagraphStyle.. |
java.lang.String |
getStyleName()
Gets the name of this RtfParagraphStyle. |
void |
handleInheritance()
Handles the inheritance of paragraph style settings. |
int |
hashCode()
Gets the hash code of this RtfParagraphStyle. |
void |
setAlignment(int alignment)
Sets the alignment of this RtfParagraphStyle. |
void |
setColor(java.awt.Color color)
Sets the color of this RtfParagraphStyle. |
void |
setFirstLineIndent(int firstLineIndent)
Sets the first line indentation of this RtfParagraphStyle. |
void |
setFontName(java.lang.String fontName)
Sets the font name of this RtfParagraphStyle. |
void |
setIndentLeft(int indentLeft)
Sets the left indentation of this RtfParagraphStyle. |
void |
setIndentRight(int indentRight)
Sets the right indentation of this RtfParagraphStyle. |
void |
setKeepTogether(boolean keepTogether)
Sets whether the lines in the paragraph should be kept together in this RtfParagraphStyle. |
void |
setKeepTogetherWithNext(boolean keepTogetherWithNext)
Sets whether the paragraph should be kept together with the next in this RtfParagraphStyle. |
void |
setLineLeading(int lineLeading)
Sets the line leading of this RtfParagraphStyle. |
void |
setSize(float fontSize)
Sets the font size of this RtfParagraphStyle. |
void |
setSpacingAfter(int spacingAfter)
Sets the space after the paragraph of this RtfParagraphStyle. |
void |
setSpacingBefore(int spacingBefore)
Sets the space before the paragraph of this RtfParagraphStyle. |
void |
setStyle(int fontStyle)
Sets the font style of this RtfParagraphStyle. |
protected void |
setStyleNumber(int styleNumber)
Sets the number of this RtfParagraphStyle in the stylesheet list. |
void |
writeBegin(java.io.OutputStream result)
Writes the start information of this RtfParagraphStyle. |
void |
writeContent(java.io.OutputStream out)
unused |
void |
writeDefinition(java.io.OutputStream result)
Writes the definition of this RtfParagraphStyle for the stylesheet list. |
void |
writeEnd(java.io.OutputStream result)
Unused |
Methods inherited from class com.lowagie.text.rtf.style.RtfFont |
---|
compareTo, difference, getCharset, getFamilyname, getFontName, getFontNumber, getFontSize, getFontStyle, intToByteArray, isStandardFont, setCharset, setColor, setFamily, setInHeader, setInTable, setRtfDocument, setStyle |
Methods inherited from class com.lowagie.text.Font |
---|
getBaseFont, getCalculatedBaseFont, getCalculatedLeading, getCalculatedSize, getCalculatedStyle, getColor, getFamily, getFamilyIndex, getSize, getStyle, getStyleValue, isBold, isItalic, isStrikethru, isUnderlined |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte[] ALIGN_LEFT
public static final byte[] ALIGN_RIGHT
public static final byte[] ALIGN_CENTER
public static final byte[] ALIGN_JUSTIFY
public static final byte[] FIRST_LINE_INDENT
public static final byte[] INDENT_LEFT
public static final byte[] INDENT_RIGHT
public static final byte[] KEEP_TOGETHER
public static final byte[] KEEP_TOGETHER_WITH_NEXT
public static final byte[] SPACING_AFTER
public static final byte[] SPACING_BEFORE
public static final RtfParagraphStyle STYLE_NORMAL
public static final RtfParagraphStyle STYLE_HEADING_1
public static final RtfParagraphStyle STYLE_HEADING_2
public static final RtfParagraphStyle STYLE_HEADING_3
Constructor Detail |
---|
public RtfParagraphStyle(java.lang.String styleName, java.lang.String fontName, int fontSize, int fontStyle, java.awt.Color fontColor)
styleName
- The name of this RtfParagraphStyle.fontName
- The name of the font to use for this RtfParagraphStyle.fontSize
- The size of the font to use for this RtfParagraphStyle.fontStyle
- The style of the font to use for this RtfParagraphStyle.fontColor
- The color of the font to use for this RtfParagraphStyle.public RtfParagraphStyle(java.lang.String styleName, java.lang.String basedOnName)
styleName
- The name of this RtfParagraphStyle.basedOnName
- The name of the RtfParagraphStyle this RtfParagraphStyle is based on.public RtfParagraphStyle(RtfDocument doc, RtfParagraphStyle style)
doc
- The RtfDocument this RtfParagraphStyle belongs to.style
- The RtfParagraphStyle to copy settings from.Method Detail |
---|
public java.lang.String getStyleName()
public java.lang.String getBasedOnName()
public int getAlignment()
public void setAlignment(int alignment)
alignment
- The alignment to use.public int getFirstLineIndent()
public void setFirstLineIndent(int firstLineIndent)
firstLineIndent
- The first line indentation to use.public int getIndentLeft()
public void setIndentLeft(int indentLeft)
indentLeft
- The left indentation to use.public int getIndentRight()
public void setIndentRight(int indentRight)
indentRight
- The right indentation to use.public int getSpacingBefore()
public void setSpacingBefore(int spacingBefore)
spacingBefore
- The space before to use.public int getSpacingAfter()
public void setSpacingAfter(int spacingAfter)
spacingAfter
- The space after to use.public void setFontName(java.lang.String fontName)
setFontName
in class RtfFont
fontName
- The font name to usepublic void setSize(float fontSize)
setSize
in class RtfFont
fontSize
- The font size to use.Font.setSize(float)
public void setStyle(int fontStyle)
setStyle
in class RtfFont
fontStyle
- The font style to use.Font.setStyle(int)
public void setColor(java.awt.Color color)
setColor
in class RtfFont
color
- The Color to use.Font.setColor(Color)
public int getLineLeading()
public void setLineLeading(int lineLeading)
lineLeading
- The line leading to use.public boolean getKeepTogether()
public void setKeepTogether(boolean keepTogether)
keepTogether
- Whether the lines in the paragraph should be kept together.public boolean getKeepTogetherWithNext()
public void setKeepTogetherWithNext(boolean keepTogetherWithNext)
keepTogetherWithNext
- Whether the paragraph should be kept together with the next.public void handleInheritance()
public void writeDefinition(java.io.OutputStream result) throws java.io.IOException
writeDefinition
in interface RtfExtendedElement
writeDefinition
in class RtfFont
result
- The OutputStream
to write the element definition to
java.io.IOException
public void writeBegin(java.io.OutputStream result) throws java.io.IOException
writeBegin
in class RtfFont
result
- The OutputStream
to write to.
java.io.IOException
- On i/o errors.public void writeEnd(java.io.OutputStream result) throws java.io.IOException
writeEnd
in class RtfFont
result
- The OutputStream
that nothing is written to
java.io.IOException
- On i/o errors.public void writeContent(java.io.OutputStream out) throws java.io.IOException
writeContent
in interface RtfBasicElement
writeContent
in class RtfFont
out
- The OutputStream
to write the content to
java.io.IOException
public boolean equals(java.lang.Object o)
equals
in class RtfFont
o
- The RtfFont to compare with this RtfFont
True
if the RtfFonts are equal, false
otherwisepublic int hashCode()
hashCode
in class RtfFont
protected void setStyleNumber(int styleNumber)
styleNumber
- The number to use.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |