Package com.inductiveautomation.rm.text
Class RMTextRun
- java.lang.Object
- 
- java.awt.geom.RectangularShape
- 
- java.awt.geom.Rectangle2D
- 
- java.awt.geom.Rectangle2D.Double
- 
- com.inductiveautomation.rm.text.RMTextRun
 
 
 
 
- 
- All Implemented Interfaces:
- java.awt.Shape,- java.io.Serializable,- java.lang.CharSequence,- java.lang.Cloneable
 - Direct Known Subclasses:
- RMTextLine
 
 public class RMTextRun extends java.awt.geom.Rectangle2D.Double implements java.lang.CharSequenceRepresents a run of characters in a line.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description RMTextRun()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddChar(char aChar, double aWidth)Adds a char to text run.intaddChars(RMXStringRun aRun, int aStart, int anEnd)Adds chars to text run.charcharAt(int anIndex)Returns the char value at the specified index.protected doublegetCharAdvance(char aChar)Returns the char advance for a given character.intgetCharIndex(double anX)Returns the character index for the given x/y point.floatgetCharSpacing()Returns the run's char spacing.RMColorgetColor()Returns the run color.booleangetColorChanged()Returns whether color changed from last run.intgetEnd()Returns the char end of this line.booleangetEndsWithNewline()Returns whether run ends with newline.booleangetEndsWithWhiteSpace()Returns whether line ends with space.RMFontgetFont()Returns the run font.booleangetFontChanged()Returns whether font changed from last run.intgetIndex()Returns the index of this run in the line.chargetLastChar()Returns the last char.RMTextLayoutgetLayout()Returns the layout.RMTextLinegetLine()Returns the line this run is associated with.RMTextRungetNext()Returns the next run.RMXString.OutlinegetOutline()Returns whether the run should be outline.RMParagraphgetParagraph()Returns the run paragraph.java.awt.geom.Point2DgetPointForChar(int anIndex)Returns the text origin for the given character index.RMXStringRungetRun()Returns the RMXStringRun for this text run.RMTextRungetRun(int anIndex)Returns the run at given index.RMTextRungetRunAt(int anIndex, boolean isInclusive)Returns the run that contains or ends (if given option is true) at given index.intgetRunCount()Returns the run count.RMTextRungetRunLast()Returns the last run.intgetScripting()Returns the run's scripting.intgetStart()Returns the char start of this line.floatgetTab()Returns the tab location if this run is a tab.chargetTabType()Returns tab type if this run is a tab.doublegetUnderlineStroke()Returns the stroke width for the underline.intgetUnderlineStyle()Returns the underline style of this run.doublegetUnderlineY()Returns the Y position for the underline.doublegetXForChar(int anIndex)Returns the char advance to given char index.RMXStringgetXString()Returns the RMXString for this run.doublegetYBaseline()Returns the y baseline position for this run (in the same coords as the layout frame).java.awt.font.GlyphVectorglyphVector(java.awt.Graphics2D g)Returns the glyph vector for the run.booleanisHyphenated()Returns whether this run has a hyphen at the end.booleanisLocked()Returns whether text layout is full.booleanisTab()Returns whether run is just a tab.booleanisUnderlined()Returns whether the run is underlined.intlength()Returns the length of this text layout.voidsetHyphenated(boolean aFlag)Sets whether this run has a hyphen at the end.voidsetLocked(boolean aFlag)Sets whether text layout can add more characters.java.lang.CharSequencesubSequence(int aStart, int anEnd)Returns a new char sequence that is a subsequence of this sequence.java.lang.StringtoString()Standard toString implementation.- 
Methods inherited from class java.awt.geom.Rectangle2D.DoublecreateIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRect
 - 
Methods inherited from class java.awt.geom.Rectangle2Dadd, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union
 - 
Methods inherited from class java.awt.geom.RectangularShapeclone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
- 
 
- 
- 
- 
Method Detail- 
getLayoutpublic final RMTextLayout getLayout() Returns the layout.
 - 
getLinepublic final RMTextLine getLine() Returns the line this run is associated with.
 - 
getXStringpublic RMXString getXString() Returns the RMXString for this run.
 - 
getRunpublic RMXStringRun getRun() Returns the RMXStringRun for this text run.
 - 
getIndexpublic int getIndex() Returns the index of this run in the line.
 - 
addCharspublic int addChars(RMXStringRun aRun, int aStart, int anEnd) Adds chars to text run.
 - 
addCharprotected void addChar(char aChar, double aWidth)Adds a char to text run.
 - 
getStartpublic int getStart() Returns the char start of this line.
 - 
getEndpublic int getEnd() Returns the char end of this line.
 - 
lengthpublic int length() Returns the length of this text layout.- Specified by:
- lengthin interface- java.lang.CharSequence
 
 - 
charAtpublic char charAt(int anIndex) Returns the char value at the specified index.- Specified by:
- charAtin interface- java.lang.CharSequence
 
 - 
subSequencepublic java.lang.CharSequence subSequence(int aStart, int anEnd)Returns a new char sequence that is a subsequence of this sequence.- Specified by:
- subSequencein interface- java.lang.CharSequence
 
 - 
getFontpublic RMFont getFont() Returns the run font.
 - 
getColorpublic RMColor getColor() Returns the run color.
 - 
getParagraphpublic RMParagraph getParagraph() Returns the run paragraph.
 - 
isUnderlinedpublic boolean isUnderlined() Returns whether the run is underlined.
 - 
getUnderlineStrokepublic double getUnderlineStroke() Returns the stroke width for the underline.
 - 
getUnderlineYpublic double getUnderlineY() Returns the Y position for the underline.
 - 
getUnderlineStylepublic int getUnderlineStyle() Returns the underline style of this run.
 - 
getOutlinepublic RMXString.Outline getOutline() Returns whether the run should be outline.
 - 
getScriptingpublic int getScripting() Returns the run's scripting.
 - 
getCharSpacingpublic float getCharSpacing() Returns the run's char spacing.
 - 
getCharAdvanceprotected double getCharAdvance(char aChar) Returns the char advance for a given character.
 - 
isHyphenatedpublic boolean isHyphenated() Returns whether this run has a hyphen at the end.
 - 
setHyphenatedpublic void setHyphenated(boolean aFlag) Sets whether this run has a hyphen at the end.
 - 
getFontChangedpublic boolean getFontChanged() Returns whether font changed from last run.
 - 
getColorChangedpublic boolean getColorChanged() Returns whether color changed from last run.
 - 
getYBaselinepublic double getYBaseline() Returns the y baseline position for this run (in the same coords as the layout frame).
 - 
isLockedpublic boolean isLocked() Returns whether text layout is full.
 - 
setLockedpublic void setLocked(boolean aFlag) Sets whether text layout can add more characters.
 - 
getCharIndexpublic int getCharIndex(double anX) Returns the character index for the given x/y point.
 - 
getXForCharpublic double getXForChar(int anIndex) Returns the char advance to given char index.
 - 
getPointForCharpublic java.awt.geom.Point2D getPointForChar(int anIndex) Returns the text origin for the given character index.
 - 
isTabpublic boolean isTab() Returns whether run is just a tab.
 - 
getTabpublic float getTab() Returns the tab location if this run is a tab.
 - 
getTabTypepublic char getTabType() Returns tab type if this run is a tab.
 - 
getEndsWithWhiteSpacepublic boolean getEndsWithWhiteSpace() Returns whether line ends with space.
 - 
getEndsWithNewlinepublic boolean getEndsWithNewline() Returns whether run ends with newline.
 - 
getLastCharpublic char getLastChar() Returns the last char.
 - 
getNextpublic RMTextRun getNext() Returns the next run.
 - 
getRunCountpublic int getRunCount() Returns the run count.
 - 
getRunpublic RMTextRun getRun(int anIndex) Returns the run at given index.
 - 
getRunLastpublic RMTextRun getRunLast() Returns the last run.
 - 
getRunAtpublic RMTextRun getRunAt(int anIndex, boolean isInclusive) Returns the run that contains or ends (if given option is true) at given index.
 - 
glyphVectorpublic java.awt.font.GlyphVector glyphVector(java.awt.Graphics2D g) Returns the glyph vector for the run.
 - 
toStringpublic java.lang.String toString() Standard toString implementation.- Specified by:
- toStringin interface- java.lang.CharSequence
- Overrides:
- toStringin class- java.awt.geom.Rectangle2D.Double
 
 
- 
 
-