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 Summary
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
Rectangle2D.Double, Rectangle2D.Float
-
Field Summary
Fields inherited from class java.awt.geom.Rectangle2D.Double
height, width, x, y
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addChar
(char aChar, double aWidth) Adds a char to text run.int
addChars
(RMXStringRun aRun, int aStart, int anEnd) Adds chars to text run.char
charAt
(int anIndex) Returns the char value at the specified index.protected double
getCharAdvance
(char aChar) Returns the char advance for a given character.int
getCharIndex
(double anX) Returns the character index for the given x/y point.float
Returns the run's char spacing.getColor()
Returns the run color.boolean
Returns whether color changed from last run.int
getEnd()
Returns the char end of this line.boolean
Returns whether run ends with newline.boolean
Returns whether line ends with space.getFont()
Returns the run font.boolean
Returns whether font changed from last run.int
getIndex()
Returns the index of this run in the line.char
Returns the last char.final RMTextLayout
Returns the layout.final RMTextLine
getLine()
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.int
Returns the run count.Returns the last run.int
Returns the run's scripting.int
getStart()
Returns the char start of this line.float
getTab()
Returns the tab location if this run is a tab.char
Returns tab type if this run is a tab.double
Returns the stroke width for the underline.int
Returns the underline style of this run.double
Returns the Y position for the underline.double
getXForChar
(int anIndex) Returns the char advance to given char index.Returns the RMXString for this run.double
Returns the y baseline position for this run (in the same coords as the layout frame).Returns the glyph vector for the run.boolean
Returns whether this run has a hyphen at the end.boolean
isLocked()
Returns whether text layout is full.boolean
isTab()
Returns whether run is just a tab.boolean
Returns whether the run is underlined.int
length()
Returns the length of this text layout.void
setHyphenated
(boolean aFlag) Sets whether this run has a hyphen at the end.void
setLocked
(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.Double
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRect
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Constructor Details
-
RMTextRun
public RMTextRun()
-
-
Method Details
-
getLayout
Returns the layout. -
getLine
Returns the line this run is associated with. -
getXString
Returns the RMXString for this run. -
getRun
Returns the RMXStringRun for this text run. -
getIndex
public int getIndex()Returns the index of this run in the line. -
addChars
Adds chars to text run. -
addChar
protected void addChar(char aChar, double aWidth) Adds a char to text run. -
getStart
public int getStart()Returns the char start of this line. -
getEnd
public int getEnd()Returns the char end of this line. -
length
public int length()Returns the length of this text layout.- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int anIndex) Returns the char value at the specified index.- Specified by:
charAt
in interfaceCharSequence
-
subSequence
Returns a new char sequence that is a subsequence of this sequence.- Specified by:
subSequence
in interfaceCharSequence
-
getFont
Returns the run font. -
getColor
Returns the run color. -
getParagraph
Returns the run paragraph. -
isUnderlined
public boolean isUnderlined()Returns whether the run is underlined. -
getUnderlineStroke
public double getUnderlineStroke()Returns the stroke width for the underline. -
getUnderlineY
public double getUnderlineY()Returns the Y position for the underline. -
getUnderlineStyle
public int getUnderlineStyle()Returns the underline style of this run. -
getOutline
Returns whether the run should be outline. -
getScripting
public int getScripting()Returns the run's scripting. -
getCharSpacing
public float getCharSpacing()Returns the run's char spacing. -
getCharAdvance
protected double getCharAdvance(char aChar) Returns the char advance for a given character. -
isHyphenated
public boolean isHyphenated()Returns whether this run has a hyphen at the end. -
setHyphenated
public void setHyphenated(boolean aFlag) Sets whether this run has a hyphen at the end. -
getFontChanged
public boolean getFontChanged()Returns whether font changed from last run. -
getColorChanged
public boolean getColorChanged()Returns whether color changed from last run. -
getYBaseline
public double getYBaseline()Returns the y baseline position for this run (in the same coords as the layout frame). -
isLocked
public boolean isLocked()Returns whether text layout is full. -
setLocked
public void setLocked(boolean aFlag) Sets whether text layout can add more characters. -
getCharIndex
public int getCharIndex(double anX) Returns the character index for the given x/y point. -
getXForChar
public double getXForChar(int anIndex) Returns the char advance to given char index. -
getPointForChar
Returns the text origin for the given character index. -
isTab
public boolean isTab()Returns whether run is just a tab. -
getTab
public float getTab()Returns the tab location if this run is a tab. -
getTabType
public char getTabType()Returns tab type if this run is a tab. -
getEndsWithWhiteSpace
public boolean getEndsWithWhiteSpace()Returns whether line ends with space. -
getEndsWithNewline
public boolean getEndsWithNewline()Returns whether run ends with newline. -
getLastChar
public char getLastChar()Returns the last char. -
getNext
Returns the next run. -
getRunCount
public int getRunCount()Returns the run count. -
getRun
Returns the run at given index. -
getRunLast
Returns the last run. -
getRunAt
Returns the run that contains or ends (if given option is true) at given index. -
glyphVector
Returns the glyph vector for the run. -
toString
Standard toString implementation.- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classRectangle2D.Double
-