Class RMParagraph

java.lang.Object
com.inductiveautomation.rm.text.RMParagraph
All Implemented Interfaces:
Archivable, RMTypes, Cloneable

public class RMParagraph extends Object implements Cloneable, RMTypes, Archivable
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);
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.inductiveautomation.rm.base.RMTypes

    RMTypes.Align, RMTypes.AlignX, RMTypes.AlignY
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final RMParagraph
     
    static final char
     
    static final char
     
    static final char
     
    static final char
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new paragraph object initialized to defaultParagraph.
    RMParagraph(RMTypes.AlignX anAlign, float leftIndent, float leftIndentFirst, float rightIndent)
    Creates a new paragraph with the given alignment and indentation.
  • Method Summary

    Modifier and Type
    Method
    Description
    Standard clone of this object.
    Returns a paragraph identical to the receiver, but with the given alignment.
    deriveIndent(double leftIndent, double leftIndentFirst, double 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
    equals(Object anObj)
    Standard equals implementation.
    fromXML(RXArchiver anArchiver, RXElement anElement)
    XML unarchival.
    Returns the alignment associated with this paragraph.
    double
    Returns the left side indentation of this paragraph.
    double
    Returns left side indentation of 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.
    double
    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.
    float[]
    Returns the raw tab array
    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.
    char[]
    Returns the raw tab type array
    void
    setTabs(float[] newTabs, char[] newTypes)
    Sets the tab stops.
    toXML(RXArchiver anArchiver)
    XML archival.

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • RMParagraph

      public RMParagraph()
      Creates a new paragraph object initialized to defaultParagraph. You should probably use RMParagraph.defaultParagraph instead.
    • RMParagraph

      public RMParagraph(RMTypes.AlignX anAlign, float leftIndent, float leftIndentFirst, float rightIndent)
      Creates a new paragraph with the given alignment and indentation.
  • Method Details

    • getAlignmentX

      public RMTypes.AlignX getAlignmentX()
      Returns the alignment associated with this paragraph.
    • getLeftIndent

      public double getLeftIndent()
      Returns the left side indentation of this paragraph.
    • getLeftIndentFirst

      public double getLeftIndentFirst()
      Returns left side indentation of first line in this paragraph (this can be set different than successive lines).
    • getRightIndent

      public double 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.
    • getTabs

      public float[] getTabs()
      Returns the raw tab array
    • getTabTypes

      public char[] getTabTypes()
      Returns the raw tab type array
    • getTabIndex

      public int getTabIndex(float aLocation)
      Returns the tab index for the given location.
    • getTabsString

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

      public RMParagraph deriveAligned(RMTypes.AlignX anAlign)
      Returns a paragraph identical to the receiver, but with the given alignment.
    • deriveIndent

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

      public RMParagraph deriveLineSpacing(float aHeight)
      Returns a paragraph identical to the receiver, but with the given line spacing.
    • deriveLineGap

      public RMParagraph deriveLineGap(float aHeight)
      Returns a paragraph identical to the receiver, but with the given line gap.
    • deriveLineHeightMin

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

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

      public void setTabs(float[] newTabs, char[] newTypes)
      Sets the tab stops.
    • deriveTabs

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

      public RMParagraph deriveTab(int anIndex, float tabValue, char tabType)
      Returns a paragraph identical to the receiver, but with new value for tab at given index.
    • clone

      public RMParagraph clone()
      Standard clone of this object.
      Overrides:
      clone in class Object
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class Object
    • toXML

      public RXElement toXML(RXArchiver anArchiver)
      XML archival.
      Specified by:
      toXML in interface Archivable
    • fromXML

      public Object fromXML(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      Specified by:
      fromXML in interface Archivable