Package com.inductiveautomation.rm.text
Class RMTextLine
- java.lang.Object
- 
- java.awt.geom.RectangularShape
- 
- java.awt.geom.Rectangle2D
- 
- java.awt.geom.Rectangle2D.Double
- 
- com.inductiveautomation.rm.text.RMTextRun
- 
- com.inductiveautomation.rm.text.RMTextLine
 
 
 
 
 
- 
- All Implemented Interfaces:
- java.awt.Shape,- java.io.Serializable,- java.lang.CharSequence,- java.lang.Cloneable
 
 public class RMTextLine extends RMTextRun A class to represent a line of text in a layout.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description RMTextLine()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddChar(char aChar, double aWidth)Adds a char to text line.intaddChars(RMXStringRun aRun, int aStart, int anEnd)Adds chars to text line.charcharAt(int anIndex)Returns the char value at the specified index.protected intdeleteFromLastWord(java.lang.CharSequence anInput, int aStart)Rewind last word from line.intgetCharIndex(double anX)Returns the character index for the given x/y point.doublegetHitMaxX()Returns the max x position possible for layout's path.doublegetLineAdvance()Returns the vertical distance for any line below this line.doublegetMaxAscent()Returns the max ascent of the chars in this line.RMTextLinegetNext()Returns the next run.java.awt.geom.Point2DgetPointForChar(int anIndex)Returns the text origin for the given character index.RMTextRungetRun(int anIndex)Returns the text run at the given index.intgetRunCount()Returns the number of runs in this line.RMTextRungetRunForPointX(double anX)Returns the line index for the given y value.RMTextRungetRunLast()Returns the last run.doublegetRunsHeight()Returns the total height of line runs.doublegetUnderlineStroke()Returns the max stroke width of any underlined chars in this line.doublegetUnderlineY()Returns the Y position of any underlined chars in this line.doublegetXForChar(int anIndex)Returns the x coord for the given character index.doublegetYBaseline()Returns the y position for this line (in same coords as the layout frame).protected voidperformAlignment()Performs alignment.voidperformTabShift()If line has any non-left tabs this method adjusts the width of the tab runs (and the positions of successive runs to correct for shift of these tabs).protected voidsetBounds(double anX, double aY, double aWidth, double aHeight)Sets the bounds of this layout.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 com.inductiveautomation.rm.text.RMTextRungetCharAdvance, getCharSpacing, getColor, getColorChanged, getEnd, getEndsWithNewline, getEndsWithWhiteSpace, getFont, getFontChanged, getIndex, getLastChar, getLayout, getLine, getOutline, getParagraph, getRun, getRunAt, getScripting, getStart, getTab, getTabType, getUnderlineStyle, getXString, glyphVector, isHyphenated, isLocked, isTab, isUnderlined, length, setHyphenated
 - 
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- 
addCharspublic int addChars(RMXStringRun aRun, int aStart, int anEnd) Adds chars to text line.
 - 
addCharprotected void addChar(char aChar, double aWidth)Adds a char to text line.
 - 
charAtpublic char charAt(int anIndex) Returns the char value at the specified index.
 - 
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
- Overrides:
- subSequencein class- RMTextRun
 
 - 
setBoundsprotected void setBounds(double anX, double aY, double aWidth, double aHeight)Sets the bounds of this layout.
 - 
getYBaselinepublic double getYBaseline() Returns the y position for this line (in same coords as the layout frame).- Overrides:
- getYBaselinein class- RMTextRun
 
 - 
getHitMaxXpublic double getHitMaxX() Returns the max x position possible for layout's path. Override if not just layout max.
 - 
getNextpublic RMTextLine getNext() Returns the next run.
 - 
getRunCountpublic int getRunCount() Returns the number of runs in this line.- Overrides:
- getRunCountin class- RMTextRun
 
 - 
getRunpublic RMTextRun getRun(int anIndex) Returns the text run at the given index.
 - 
getRunLast@Nullable public RMTextRun getRunLast() Returns the last run.- Overrides:
- getRunLastin class- RMTextRun
 
 - 
getRunsHeightpublic double getRunsHeight() Returns the total height of line runs.
 - 
getMaxAscentpublic double getMaxAscent() Returns the max ascent of the chars in this line.
 - 
getLineAdvancepublic double getLineAdvance() Returns the vertical distance for any line below this line.
 - 
getXForCharpublic double getXForChar(int anIndex) Returns the x coord for the given character index.- Overrides:
- getXForCharin class- RMTextRun
 
 - 
getPointForCharpublic java.awt.geom.Point2D getPointForChar(int anIndex) Returns the text origin for the given character index.- Overrides:
- getPointForCharin class- RMTextRun
 
 - 
getRunForPointX@Nullable public RMTextRun getRunForPointX(double anX) Returns the line index for the given y value.
 - 
getCharIndexpublic int getCharIndex(double anX) Returns the character index for the given x/y point.- Overrides:
- getCharIndexin class- RMTextRun
 
 - 
getUnderlineStrokepublic double getUnderlineStroke() Returns the max stroke width of any underlined chars in this line.- Overrides:
- getUnderlineStrokein class- RMTextRun
 
 - 
getUnderlineYpublic double getUnderlineY() Returns the Y position of any underlined chars in this line.- Overrides:
- getUnderlineYin class- RMTextRun
 
 - 
deleteFromLastWordprotected int deleteFromLastWord(java.lang.CharSequence anInput, int aStart)Rewind last word from line.
 - 
setLockedpublic void setLocked(boolean aFlag) Sets whether text layout can add more characters.
 - 
performTabShiftpublic void performTabShift() If line has any non-left tabs this method adjusts the width of the tab runs (and the positions of successive runs to correct for shift of these tabs).
 - 
performAlignmentprotected void performAlignment() Performs alignment.
 
- 
 
-