Package com.inductiveautomation.rm.text
Class RMTextLayout
java.lang.Object
java.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double
com.inductiveautomation.rm.text.RMTextLayout
- All Implemented Interfaces:
- RMTypes,- RMTextTypes,- Shape,- Serializable,- CharSequence,- Cloneable
- Direct Known Subclasses:
- RMTextLayoutInPath
A class to layout text.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class java.awt.geom.Rectangle2DRectangle2D.Double, Rectangle2D.FloatNested classes/interfaces inherited from interface com.inductiveautomation.rm.text.RMTextTypesRMTextTypes.TabTypeNested classes/interfaces inherited from interface com.inductiveautomation.rm.base.RMTypesRMTypes.Align, RMTypes.AlignX, RMTypes.AlignY
- 
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_TOPFields inherited from interface com.inductiveautomation.rm.text.RMTextTypesTEXT_CHAR_SPACING, TEXT_COLOR, TEXT_EMBEDDED_SHAPE, TEXT_FONT, TEXT_FORMAT, TEXT_OUTLINE, TEXT_PARAGRAPH, TEXT_SCRIPTING, TEXT_UNDERLINE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddChar(char aChar) Adds a char to the layout.intaddChars(RMXStringRun aRun, int aStart, int anEnd) Adds chars to text layout.addLine(RMXStringRun aRun) Adds a new line and returns it.addRun(RMXStringRun aRun, RMTextLine aLine) Adds a new run.charcharAt(int anIndex) Returns the char value at the specified index.protected RMTextLineCreates a new text line.Creates a new run.voiddeleteChars(int anIndex) Deletes chars from index.Returns the vertical alignment of this layout.intgetCharIndex(double anX, double aY) Returns the character index for the given x/y point.intgetCharIndex(Point2D aPoint) Returns the character index for the given x/y point.intgetEnd()Returns the end char index of the layout in XString.doubleReturns the font scale of the text layout.doubleReturns the height to fit.doublegetIndent(RMXStringRun aRun) Returns the indent for this line.getLine()Returns the head line of line linked list.getLine(int anIndex) Returns the individual line at given index.intReturns the number of lines.getLineForChar(int anIndex) Returns the line for the given character index.getLineForPointY(double aY) Returns the line for the given y value.Returns the last line.booleanReturns whether a word was found that over-ran a whole line by itself.booleanReturns whether text needs to perform layout.Returns what this line thinks is the next line's x.getPathForChars(int aStart, int anEnd) Returns a path for two char indexes - it will be a a simple box with extensions for first/last lines.getPointForChar(int anIndex) Returns the text origin for the given character index.booleanReturns whether layout ran out of room trying to render chars.getRun()Returns the head run in linked list of runs for the layout.getRun(int anIndex) Returns the text run at the given index.intReturns the number of runs in this line.getRunForPoint(double anX, double aY) Returns the run for given x/y.Returns the last run.intgetStart()Returns the start char index of the layout in XString.booleanReturns whether to use fractional character metrics.doubleReturns the width to fit.booleanReturns whether layout had to wrap a line.Returns the RMXString.booleanisLocked()Returns whether text layout is full.voidlayout()Performs text layout if needed.protected voidPerforms text layout.voidScales font sizes of all text in an RMText shape to fit in bounds.intlength()Returns the length of this text layout.protected voidpathlineTo(GeneralPath path, double x, double y) protected voidpathmoveTo(GeneralPath path, double x, double y) protected voidPerform vertical alignment - this needs to move to RMTextShape!voidRemoves a line.voidsetAlignHeight(double aValue) Bogus!voidsetAlignmentY(RMTypes.AlignY anAlignment) Sets the vertical alignment of this layout.voidsetFontScale(double aValue) Sets the font scale of the text layout.voidsetLocked(boolean aFlag) Sets whether text layout can add more characters.voidsetNeedsLayout(boolean aValue) Sets whether text needs to perform layout.voidsetStart(int aStart) Sets the start char index of the layout in XString.voidsetUseFractionalMetrics(boolean aFlag) Sets whether to use fractional character metrics.voidsetXString(RMXString anXString) Sets the RMXString.subSequence(int aStart, int anEnd) Returns a new char sequence that is a sub-sequence 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- 
RMTextLayoutpublic RMTextLayout()
 
- 
- 
Method Details- 
getXStringReturns the RMXString.
- 
setXStringSets the RMXString.
- 
getStartpublic int getStart()Returns the start char index of the layout in XString.
- 
setStartpublic void setStart(int aStart) Sets the start char index of the layout in XString.
- 
getEndpublic int getEnd()Returns the end char index of the layout in XString.
- 
getNeedsLayoutpublic boolean getNeedsLayout()Returns whether text needs to perform layout.
- 
setNeedsLayoutpublic void setNeedsLayout(boolean aValue) Sets whether text needs to perform layout.
- 
layoutpublic void layout()Performs text layout if needed.
- 
layoutTextprotected void layoutText()Performs text layout.
- 
addCharsAdds chars to text layout.
- 
addCharprotected void addChar(char aChar) Adds a char to the layout.
- 
deleteCharspublic void deleteChars(int anIndex) Deletes chars from index.
- 
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 sub-sequence of this sequence.- Specified by:
- subSequencein interface- CharSequence
 
- 
getFontScalepublic double getFontScale()Returns the font scale of the text layout.
- 
setFontScalepublic void setFontScale(double aValue) Sets the font scale of the text layout.
- 
getUseFractionalMetricspublic boolean getUseFractionalMetrics()Returns whether to use fractional character metrics.
- 
setUseFractionalMetricspublic void setUseFractionalMetrics(boolean aFlag) Sets whether to use fractional character metrics.
- 
getAlignmentYReturns the vertical alignment of this layout.
- 
setAlignmentYSets the vertical alignment of this layout.
- 
getWidthToFitpublic double getWidthToFit()Returns the width to fit.
- 
getHeightToFitpublic double getHeightToFit()Returns the height to fit.
- 
getLineReturns the head line of line linked list.
- 
getLineCountpublic int getLineCount()Returns the number of lines.
- 
getLineReturns the individual line at given index.
- 
getLineLastReturns the last line.
- 
createLineCreates a new text line.
- 
addLineAdds a new line and returns it.
- 
removeLinepublic void removeLine()Removes a line.
- 
getRunReturns the head run in linked list of runs for the layout.
- 
getRunCountpublic int getRunCount()Returns the number of runs in this line.
- 
getRunReturns the text run at the given index.
- 
getRunLastReturns the last run.
- 
createRunCreates a new run.
- 
addRunAdds a new run.
- 
getCharIndexReturns the character index for the given x/y point.
- 
getCharIndexpublic int getCharIndex(double anX, double aY) Returns the character index for the given x/y point.
- 
getPointForCharReturns the text origin for the given character index.
- 
getLineForCharReturns the line for the given character index.
- 
getLineForPointYReturns the line for the given y value.
- 
getRunForPointReturns the run for given x/y.
- 
getNextLineStartPointReturns what this line thinks is the next line's x. Override if not infinity.
- 
getIndentReturns the indent for this line.
- 
getWrappedpublic boolean getWrapped()Returns whether layout had to wrap a line.
- 
getLongWordFoundpublic boolean getLongWordFound()Returns whether a word was found that over-ran a whole line by itself.
- 
getRanOutOfRoompublic boolean getRanOutOfRoom()Returns whether layout ran out of room trying to render chars.
- 
getPathForCharsReturns a path for two char indexes - it will be a a simple box with extensions for first/last lines.
- 
pathmoveTo
- 
pathlineTo
- 
isLockedpublic boolean isLocked()Returns whether text layout is full.
- 
setLockedpublic void setLocked(boolean aFlag) Sets whether text layout can add more characters.
- 
performAlignmentYprotected void performAlignmentY()Perform vertical alignment - this needs to move to RMTextShape!
- 
setAlignHeightpublic void setAlignHeight(double aValue) Bogus!
- 
layoutToFitpublic void layoutToFit()Scales font sizes of all text in an RMText shape to fit in bounds. Caches font scale factor in xstring.
- 
toStringStandard toString implementation.- Specified by:
- toStringin interface- CharSequence
- Overrides:
- toStringin class- Rectangle2D.Double
 
 
-