Package com.reportmill.text
Class RMParagraph
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.text.RMParagraph
- All Implemented Interfaces:
RMArchiver.Archiving
,Cloneable
This class represents attributes of a paragraph in an RMXString (all of the characters up to and including each
newline in an RMXString make up a paragraph). Paragraphs can have their own alignment, indentation, min/max line
height, etc. You might use this class like this:
RMParagraph pgraph = RMParagraph.defaultParagraph.deriveAligned(RMParagraph.ALIGN_RIGHT); RMXString xstring = new RMXString("Hello World", pgraph);
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
static final RMParagraph
static final char
static final char
static final char
static final char
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new paragraph object initialized to defaultParagraph.RMParagraph
(int anAlign, float leftIndent, float leftIndentFirst, float rightIndent) Creates a new paragraph with the given alignment and indentation. -
Method Summary
Modifier and TypeMethodDescriptionderiveAligned
(int anAlign) Returns a paragraph identical to the receiver, but with the given alignment.deriveIndent
(float leftIndent, float leftIndentFirst, float rightIndent) Returns a paragraph identical to the receiver, but with the given indentation values.deriveLineGap
(float aHeight) Returns a paragraph identical to the receiver, but with the given line gap.deriveLineHeightMax
(float aHeight) Returns a paragraph identical to the receiver, but with the given max line height.deriveLineHeightMin
(float aHeight) Returns a paragraph identical to the receiver, but with the given min line height.deriveLineSpacing
(float aHeight) Returns a paragraph identical to the receiver, but with the given line spacing.deriveTab
(int anIndex, float tabValue, char tabType) Returns a paragraph identical to the receiver, but with new value for tab at given index.deriveTabs
(float[] newTabs, char[] newTypes) Returns a paragraph identical to the receiver, but with the given tabs.boolean
Standard equals implementation.fromXML
(RXArchiver anArchiver, RXElement anElement) XML unarchival.byte
getAlign()
Returns the alignment associated with this paragraph.byte
Returns an alignment for the given string, "left", "center", "right" or "full".Returns a string representation of the alignment associated with this paragraph, "left", "center" or "right".float
Returns the left side indentation of this paragraph.float
Returns the left side indentation of the first line in this paragraph (this can be set different than successive lines).float
Returns additional line spacing expressed as a constant amount in points.float
Returns the maximum line height in printer points associated with this paragraph.float
Returns the minimum line height in printer points associated with this paragraph.float
Returns the spacing of lines expressed as a factor of a given line's height.float
Returns the spacing between paragraphs in printer points associated with this paragraph.float
Returns the right side indentation of this paragraph.float
getTab
(int anIndex) Returns the specific tab value for the given index in printer points.int
Returns the number of tabs associated with this paragraph.int
getTabIndex
(float aLocation) Returns the tab index for the given location.Returns the values of all the tabs associated with this paragraph as a comma separated string.char
getTabType
(int anIndex) Returns the type of tab at the given index.initWithArchiver
(RMArchiver archive) Legacy unarchival.toXML
(RXArchiver anArchiver) XML archival.Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, undoClone, undoCopy, undoEquals
-
Field Details
-
DEFAULT
-
ALIGN_LEFT
public static final byte ALIGN_LEFT- See Also:
-
ALIGN_RIGHT
public static final byte ALIGN_RIGHT- See Also:
-
ALIGN_CENTER
public static final byte ALIGN_CENTER- See Also:
-
ALIGN_FULL
public static final byte ALIGN_FULL- See Also:
-
TAB_LEFT
public static final char TAB_LEFT- See Also:
-
TAB_RIGHT
public static final char TAB_RIGHT- See Also:
-
TAB_CENTER
public static final char TAB_CENTER- See Also:
-
TAB_DECIMAL
public static final char TAB_DECIMAL- See Also:
-
-
Constructor Details
-
RMParagraph
public RMParagraph()Creates a new paragraph object initialized to defaultParagraph. You should probably use RMParagraph.defaultParagraph instead. -
RMParagraph
public RMParagraph(int anAlign, float leftIndent, float leftIndentFirst, float rightIndent) Creates a new paragraph with the given alignment and indentation.
-
-
Method Details
-
getAlign
public byte getAlign()Returns the alignment associated with this paragraph. -
getAlignString
Returns a string representation of the alignment associated with this paragraph, "left", "center" or "right". -
getAlign
Returns an alignment for the given string, "left", "center", "right" or "full". -
getLeftIndent
public float getLeftIndent()Returns the left side indentation of this paragraph. -
getLeftIndentFirst
public float getLeftIndentFirst()Returns the left side indentation of the first line in this paragraph (this can be set different than successive lines). -
getRightIndent
public float getRightIndent()Returns the right side indentation of this paragraph. -
getLineSpacing
public float getLineSpacing()Returns the spacing of lines expressed as a factor of a given line's height. -
getLineGap
public float getLineGap()Returns additional line spacing expressed as a constant amount in points. -
getLineHeightMin
public float getLineHeightMin()Returns the minimum line height in printer points associated with this paragraph. -
getLineHeightMax
public float getLineHeightMax()Returns the maximum line height in printer points associated with this paragraph. -
getParagraphSpacing
public float getParagraphSpacing()Returns the spacing between paragraphs in printer points associated with this paragraph. -
getTabCount
public int getTabCount()Returns the number of tabs associated with this paragraph. -
getTab
public float getTab(int anIndex) Returns the specific tab value for the given index in printer points. -
getTabType
public char getTabType(int anIndex) Returns the type of tab at the given index. -
getTabIndex
public int getTabIndex(float aLocation) Returns the tab index for the given location. -
getTabsString
Returns the values of all the tabs associated with this paragraph as a comma separated string. -
deriveAligned
Returns a paragraph identical to the receiver, but with the given alignment. -
deriveIndent
Returns a paragraph identical to the receiver, but with the given indentation values. -
deriveLineSpacing
Returns a paragraph identical to the receiver, but with the given line spacing. -
deriveLineGap
Returns a paragraph identical to the receiver, but with the given line gap. -
deriveLineHeightMin
Returns a paragraph identical to the receiver, but with the given min line height. -
deriveLineHeightMax
Returns a paragraph identical to the receiver, but with the given max line height. -
deriveTabs
Returns a paragraph identical to the receiver, but with the given tabs. -
deriveTab
Returns a paragraph identical to the receiver, but with new value for tab at given index. -
equals
Standard equals implementation. -
initWithArchiver
Legacy unarchival.- Specified by:
initWithArchiver
in interfaceRMArchiver.Archiving
- Overrides:
initWithArchiver
in classRMObject
-
toXML
XML archival. -
fromXML
XML unarchival.
-