ReportMill 7.0 API

com.reportmill.text
Class RMParagraph

java.lang.Object
  extended bycom.reportmill.foundation.RMObject
      extended bycom.reportmill.text.RMParagraph
All Implemented Interfaces:
java.lang.Cloneable, com.reportmill.foundation.RMArchiver.Archiving

public class RMParagraph
extends com.reportmill.foundation.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 Summary
static float[] _defaultTabs
           
static byte ALIGN_CENTER
           
static byte ALIGN_LEFT
           
static byte ALIGN_RIGHT
           
static RMParagraph defaultParagraph
           
 
Constructor Summary
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 Summary
 RMParagraph deriveAligned(int anAlign)
          Returns a paragraph identical to the receiver, but with the given alignment.
 RMParagraph deriveIndent(float leftIndent, float leftIndentFirst, float rightIndent)
          Returns a paragraph identical to the receiver, but with the given indentation values.
 RMParagraph deriveMaxLineHeight(float aHeight)
          Returns a paragraph identical to the receiver, but with the given max line height.
 RMParagraph deriveMinLineHeight(float aHeight)
          Returns a paragraph identical to the receiver, but with the given min line height.
 RMParagraph deriveTabs(float[] newTabs)
          Returns a paragraph identical to the receiver, but with the given tabs.
 boolean equals(java.lang.Object anObj)
          Standard equals implementation.
 java.lang.Object fromXML(com.ribs.RXArchiver anArchiver, com.ribs.RXElement anElement)
          XML unarchival.
 byte getAlign()
          Returns the alignment associated with this paragraph.
 java.lang.String getAlignString()
          Returns a string representation of the alignment associated with this paragraph, "left", "center" or "right".
 float getLeftIndent()
          Returns the left side indentation of this paragraph.
 float getLeftIndentFirst()
          Returns the left side indentation of the first line in this paragraph (this can be set different than successive lines).
 float getLineSpacing()
          Returns the spacing between lines in printer points associated with this paragraph.
 float getMaxLineHeight()
          Returns the maximum line height in printer points associated with this paragraph.
 float getMinLineHeight()
          Returns the minimum line height in printer points associated with this paragraph.
 float getParagraphSpacing()
          Returns the spacing between paragraphs in printer points associated with this paragraph.
 float getRightIndent()
          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 getTabCount()
          Returns the number of tabs associated with this paragraph.
 java.lang.String getTabsString()
          Returns the values of all the tabs associated with this paragraph as a comma separated string.
 java.lang.Object initWithArchiver(com.reportmill.foundation.RMArchiver archive)
          Legacy unarchival.
 com.ribs.RXElement toXML(com.ribs.RXArchiver anArchiver)
          XML archival.
 
Methods inherited from class com.reportmill.foundation.RMObject
archiverClassName, clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, undoClone, undoCopy, undoEquals
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIGN_LEFT

public static final byte ALIGN_LEFT
See Also:
Constant Field Values

ALIGN_RIGHT

public static final byte ALIGN_RIGHT
See Also:
Constant Field Values

ALIGN_CENTER

public static final byte ALIGN_CENTER
See Also:
Constant Field Values

_defaultTabs

public static float[] _defaultTabs

defaultParagraph

public static final RMParagraph defaultParagraph
Constructor Detail

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 Detail

getAlign

public byte getAlign()
Returns the alignment associated with this paragraph.


getAlignString

public java.lang.String getAlignString()
Returns a string representation of the alignment associated with this paragraph, "left", "center" or "right".


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.


getMinLineHeight

public float getMinLineHeight()
Returns the minimum line height in printer points associated with this paragraph.


getMaxLineHeight

public float getMaxLineHeight()
Returns the maximum line height in printer points associated with this paragraph.


getLineSpacing

public float getLineSpacing()
Returns the spacing between lines 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.


getTabsString

public java.lang.String getTabsString()
Returns the values of all the tabs associated with this paragraph as a comma separated string.


deriveAligned

public RMParagraph deriveAligned(int anAlign)
Returns a paragraph identical to the receiver, but with the given alignment.


deriveIndent

public RMParagraph deriveIndent(float leftIndent,
                                float leftIndentFirst,
                                float rightIndent)
Returns a paragraph identical to the receiver, but with the given indentation values.


deriveMinLineHeight

public RMParagraph deriveMinLineHeight(float aHeight)
Returns a paragraph identical to the receiver, but with the given min line height.


deriveMaxLineHeight

public RMParagraph deriveMaxLineHeight(float aHeight)
Returns a paragraph identical to the receiver, but with the given max line height.


deriveTabs

public RMParagraph deriveTabs(float[] newTabs)
Returns a paragraph identical to the receiver, but with the given tabs.


equals

public boolean equals(java.lang.Object anObj)
Standard equals implementation.


initWithArchiver

public java.lang.Object initWithArchiver(com.reportmill.foundation.RMArchiver archive)
Legacy unarchival.


toXML

public com.ribs.RXElement toXML(com.ribs.RXArchiver anArchiver)
XML archival.


fromXML

public java.lang.Object fromXML(com.ribs.RXArchiver anArchiver,
                                com.ribs.RXElement anElement)
XML unarchival.


ReportMill 7.0 API