Package com.reportmill.text
Class RMParagraph
- java.lang.Object
- 
- com.reportmill.base.RMObject
- 
- com.reportmill.text.RMParagraph
 
 
- 
- All Implemented Interfaces:
- RMArchiver.Archiving,- java.lang.Cloneable
 
 public class RMParagraph extends RMObject 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 SummaryFields Modifier and Type Field Description static byteALIGN_CENTERstatic byteALIGN_FULLstatic byteALIGN_LEFTstatic byteALIGN_RIGHTstatic RMParagraphDEFAULTstatic charTAB_CENTERstatic charTAB_DECIMALstatic charTAB_LEFTstatic charTAB_RIGHT
 - 
Constructor SummaryConstructors Constructor Description RMParagraph()Creates 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 SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description RMParagraphderiveAligned(int anAlign)Returns a paragraph identical to the receiver, but with the given alignment.RMParagraphderiveIndent(float leftIndent, float leftIndentFirst, float rightIndent)Returns a paragraph identical to the receiver, but with the given indentation values.RMParagraphderiveLineGap(float aHeight)Returns a paragraph identical to the receiver, but with the given line gap.RMParagraphderiveLineHeightMax(float aHeight)Returns a paragraph identical to the receiver, but with the given max line height.RMParagraphderiveLineHeightMin(float aHeight)Returns a paragraph identical to the receiver, but with the given min line height.RMParagraphderiveLineSpacing(float aHeight)Returns a paragraph identical to the receiver, but with the given line spacing.RMParagraphderiveTab(int anIndex, float tabValue, char tabType)Returns a paragraph identical to the receiver, but with new value for tab at given index.RMParagraphderiveTabs(float[] newTabs, char[] newTypes)Returns a paragraph identical to the receiver, but with the given tabs.booleanequals(java.lang.Object anObj)Standard equals implementation.java.lang.ObjectfromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.bytegetAlign()Returns the alignment associated with this paragraph.bytegetAlign(java.lang.String aString)Returns an alignment for the given string, "left", "center", "right" or "full".java.lang.StringgetAlignString()Returns a string representation of the alignment associated with this paragraph, "left", "center" or "right".floatgetLeftIndent()Returns the left side indentation of this paragraph.floatgetLeftIndentFirst()Returns the left side indentation of the first line in this paragraph (this can be set different than successive lines).floatgetLineGap()Returns additional line spacing expressed as a constant amount in points.floatgetLineHeightMax()Returns the maximum line height in printer points associated with this paragraph.floatgetLineHeightMin()Returns the minimum line height in printer points associated with this paragraph.floatgetLineSpacing()Returns the spacing of lines expressed as a factor of a given line's height.floatgetParagraphSpacing()Returns the spacing between paragraphs in printer points associated with this paragraph.floatgetRightIndent()Returns the right side indentation of this paragraph.floatgetTab(int anIndex)Returns the specific tab value for the given index in printer points.intgetTabCount()Returns the number of tabs associated with this paragraph.intgetTabIndex(float aLocation)Returns the tab index for the given location.java.lang.StringgetTabsString()Returns the values of all the tabs associated with this paragraph as a comma separated string.chargetTabType(int anIndex)Returns the type of tab at the given index.java.lang.ObjectinitWithArchiver(RMArchiver archive)Legacy unarchival.RXElementtoXML(RXArchiver anArchiver)XML archival.- 
Methods inherited from class com.reportmill.base.RMObjectclone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, undoClone, undoCopy, undoEquals
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULTpublic static final RMParagraph DEFAULT 
 - 
ALIGN_LEFTpublic static final byte ALIGN_LEFT - See Also:
- Constant Field Values
 
 - 
ALIGN_RIGHTpublic static final byte ALIGN_RIGHT - See Also:
- Constant Field Values
 
 - 
ALIGN_CENTERpublic static final byte ALIGN_CENTER - See Also:
- Constant Field Values
 
 - 
ALIGN_FULLpublic static final byte ALIGN_FULL - See Also:
- Constant Field Values
 
 - 
TAB_LEFTpublic static final char TAB_LEFT - See Also:
- Constant Field Values
 
 - 
TAB_RIGHTpublic static final char TAB_RIGHT - See Also:
- Constant Field Values
 
 - 
TAB_CENTERpublic static final char TAB_CENTER - See Also:
- Constant Field Values
 
 - 
TAB_DECIMALpublic static final char TAB_DECIMAL - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
RMParagraphpublic RMParagraph() Creates a new paragraph object initialized to defaultParagraph. You should probably use RMParagraph.defaultParagraph instead.
 - 
RMParagraphpublic RMParagraph(int anAlign, float leftIndent, float leftIndentFirst, float rightIndent)Creates a new paragraph with the given alignment and indentation.
 
- 
 - 
Method Detail- 
getAlignpublic byte getAlign() Returns the alignment associated with this paragraph.
 - 
getAlignStringpublic java.lang.String getAlignString() Returns a string representation of the alignment associated with this paragraph, "left", "center" or "right".
 - 
getAlignpublic byte getAlign(java.lang.String aString) Returns an alignment for the given string, "left", "center", "right" or "full".
 - 
getLeftIndentpublic float getLeftIndent() Returns the left side indentation of this paragraph.
 - 
getLeftIndentFirstpublic float getLeftIndentFirst() Returns the left side indentation of the first line in this paragraph (this can be set different than successive lines).
 - 
getRightIndentpublic float getRightIndent() Returns the right side indentation of this paragraph.
 - 
getLineSpacingpublic float getLineSpacing() Returns the spacing of lines expressed as a factor of a given line's height.
 - 
getLineGappublic float getLineGap() Returns additional line spacing expressed as a constant amount in points.
 - 
getLineHeightMinpublic float getLineHeightMin() Returns the minimum line height in printer points associated with this paragraph.
 - 
getLineHeightMaxpublic float getLineHeightMax() Returns the maximum line height in printer points associated with this paragraph.
 - 
getParagraphSpacingpublic float getParagraphSpacing() Returns the spacing between paragraphs in printer points associated with this paragraph.
 - 
getTabCountpublic int getTabCount() Returns the number of tabs associated with this paragraph.
 - 
getTabpublic float getTab(int anIndex) Returns the specific tab value for the given index in printer points.
 - 
getTabTypepublic char getTabType(int anIndex) Returns the type of tab at the given index.
 - 
getTabIndexpublic int getTabIndex(float aLocation) Returns the tab index for the given location.
 - 
getTabsStringpublic java.lang.String getTabsString() Returns the values of all the tabs associated with this paragraph as a comma separated string.
 - 
deriveAlignedpublic RMParagraph deriveAligned(int anAlign) Returns a paragraph identical to the receiver, but with the given alignment.
 - 
deriveIndentpublic RMParagraph deriveIndent(float leftIndent, float leftIndentFirst, float rightIndent) Returns a paragraph identical to the receiver, but with the given indentation values.
 - 
deriveLineSpacingpublic RMParagraph deriveLineSpacing(float aHeight) Returns a paragraph identical to the receiver, but with the given line spacing.
 - 
deriveLineGappublic RMParagraph deriveLineGap(float aHeight) Returns a paragraph identical to the receiver, but with the given line gap.
 - 
deriveLineHeightMinpublic RMParagraph deriveLineHeightMin(float aHeight) Returns a paragraph identical to the receiver, but with the given min line height.
 - 
deriveLineHeightMaxpublic RMParagraph deriveLineHeightMax(float aHeight) Returns a paragraph identical to the receiver, but with the given max line height.
 - 
deriveTabspublic RMParagraph deriveTabs(float[] newTabs, char[] newTypes) Returns a paragraph identical to the receiver, but with the given tabs.
 - 
deriveTabpublic RMParagraph deriveTab(int anIndex, float tabValue, char tabType) Returns a paragraph identical to the receiver, but with new value for tab at given index.
 - 
equalspublic boolean equals(java.lang.Object anObj) Standard equals implementation.- Overrides:
- equalsin class- java.lang.Object
 
 - 
initWithArchiverpublic java.lang.Object initWithArchiver(RMArchiver archive) Legacy unarchival.- Specified by:
- initWithArchiverin interface- RMArchiver.Archiving
- Overrides:
- initWithArchiverin class- RMObject
 
 - 
toXMLpublic RXElement toXML(RXArchiver anArchiver) XML archival.
 - 
fromXMLpublic java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement) XML unarchival.
 
- 
 
-