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:
- Shape,- Serializable,- CharSequence,- Cloneable
- Direct Known Subclasses:
- RMTextLine
Represents a run of characters in a line.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class java.awt.geom.Rectangle2DRectangle2D.Double, Rectangle2D.Float
- 
Field SummaryFields inherited from class java.awt.geom.Rectangle2D.Doubleheight, width, x, yFields inherited from class java.awt.geom.Rectangle2DOUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected 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.floatReturns the run's char spacing.getColor()Returns the run color.booleanReturns whether color changed from last run.intgetEnd()Returns the char end of this line.booleanReturns whether run ends with newline.booleanReturns whether line ends with space.getFont()Returns the run font.booleanReturns whether font changed from last run.intgetIndex()Returns the index of this run in the line.charReturns the last char.final RMTextLayoutReturns the layout.final RMTextLinegetLine()Returns the line this run is associated with.getNext()Returns the next run.Returns whether the run should be outline.Returns the run paragraph.getPointForChar(int anIndex) Returns the text origin for the given character index.getRun()Returns the RMXStringRun for this text run.getRun(int anIndex) Returns the run at given index.getRunAt(int anIndex, boolean isInclusive) Returns the run that contains or ends (if given option is true) at given index.intReturns the run count.Returns the last run.intReturns the run's scripting.intgetStart()Returns the char start of this line.floatgetTab()Returns the tab location if this run is a tab.charReturns tab type if this run is a tab.doubleReturns the stroke width for the underline.intReturns the underline style of this run.doubleReturns the Y position for the underline.doublegetXForChar(int anIndex) Returns the char advance to given char index.Returns the RMXString for this run.doubleReturns the y baseline position for this run (in the same coords as the layout frame).Returns the glyph vector for the run.booleanReturns whether this run has a hyphen at the end.booleanisLocked()Returns whether text layout is full.booleanisTab()Returns whether run is just a tab.booleanReturns 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.subSequence(int aStart, int anEnd) Returns a new char sequence that is a subsequence of this sequence.toString()Standard toString implementation.Methods inherited from class java.awt.geom.Rectangle2D.DoublecreateIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRectMethods inherited from class java.awt.geom.Rectangle2Dadd, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, unionMethods inherited from class java.awt.geom.RectangularShapeclone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonalMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequencechars, codePoints, isEmpty
- 
Constructor Details- 
RMTextRunpublic RMTextRun()
 
- 
- 
Method Details- 
getLayoutReturns the layout.
- 
getLineReturns the line this run is associated with.
- 
getXStringReturns the RMXString for this run.
- 
getRunReturns the RMXStringRun for this text run.
- 
getIndexpublic int getIndex()Returns the index of this run in the line.
- 
addCharsAdds 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- CharSequence
 
- 
charAtpublic char charAt(int anIndex) Returns the char value at the specified index.- Specified by:
- charAtin interface- CharSequence
 
- 
subSequenceReturns a new char sequence that is a subsequence of this sequence.- Specified by:
- subSequencein interface- CharSequence
 
- 
getFontReturns the run font.
- 
getColorReturns the run color.
- 
getParagraphReturns 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.
- 
getOutlineReturns 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.
- 
getPointForCharReturns 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.
- 
getNextReturns the next run.
- 
getRunCountpublic int getRunCount()Returns the run count.
- 
getRunReturns the run at given index.
- 
getRunLastReturns the last run.
- 
getRunAtReturns the run that contains or ends (if given option is true) at given index.
- 
glyphVectorReturns the glyph vector for the run.
- 
toStringStandard toString implementation.- Specified by:
- toStringin interface- CharSequence
- Overrides:
- toStringin class- Rectangle2D.Double
 
 
-