public class RMTextLayout extends java.awt.geom.Rectangle2D.Double implements java.lang.CharSequence, RMTextTypes
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float
RMTextTypes.TabType
RMTypes.Align, RMTypes.AlignX, RMTypes.AlignY
TEXT_CHAR_SPACING, TEXT_COLOR, TEXT_EMBEDDED_SHAPE, TEXT_FONT, TEXT_FORMAT, TEXT_OUTLINE, TEXT_PARAGRAPH, TEXT_SCRIPTING, TEXT_UNDERLINE
Constructor and Description |
---|
RMTextLayout() |
Modifier and Type | Method and Description |
---|---|
int |
addChars(RMXStringRun aRun,
int aStart,
int anEnd)
Adds chars to text layout.
|
RMTextLine |
addLine(RMXStringRun aRun)
Adds a new line and returns it.
|
RMTextRun |
addRun(RMXStringRun aRun,
RMTextLine aLine)
Adds a new run.
|
char |
charAt(int anIndex)
Returns the char value at the specified index.
|
RMTextRun |
createRun()
Creates a new run.
|
void |
deleteChars(int anIndex)
Deletes chars from index.
|
RMTypes.AlignY |
getAlignmentY()
Returns the vertical alignment of this layout.
|
int |
getCharIndex(double anX,
double aY)
Returns the character index for the given x/y point.
|
int |
getCharIndex(java.awt.geom.Point2D aPoint)
Returns the character index for the given x/y point.
|
int |
getEnd()
Returns the end char index of the layout in XString.
|
double |
getFontScale()
Returns the font scale of the text layout.
|
double |
getHeightToFit()
Returns the height to fit.
|
double |
getIndent(RMXStringRun aRun)
Returns the indent for this line.
|
RMTextLine |
getLine()
Returns the head line of line linked list.
|
RMTextLine |
getLine(int anIndex)
Returns the individual line at given index.
|
int |
getLineCount()
Returns the number of lines.
|
RMTextLine |
getLineForChar(int anIndex)
Returns the line for the given character index.
|
RMTextLine |
getLineForPointY(double aY)
Returns the line for the given y value.
|
RMTextLine |
getLineLast()
Returns the last line.
|
boolean |
getLongWordFound()
Returns whether a word was found that over-ran a whole line by itself.
|
boolean |
getNeedsLayout()
Returns whether text needs to perform layout.
|
java.awt.geom.Point2D |
getNextLineStartPoint(RMXStringRun aRun)
Returns what this line thinks is the next line's x.
|
java.awt.geom.GeneralPath |
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.
|
java.awt.geom.Point2D |
getPointForChar(int anIndex)
Returns the text origin for the given character index.
|
boolean |
getRanOutOfRoom()
Returns whether layout ran out of room trying to render chars.
|
RMTextRun |
getRun()
Returns the head run in linked list of runs for the layout.
|
RMTextRun |
getRun(int anIndex)
Returns the text run at the given index.
|
int |
getRunCount()
Returns the number of runs in this line.
|
RMTextRun |
getRunForPoint(double anX,
double aY)
Returns the run for given x/y.
|
RMTextRun |
getRunLast()
Returns the last run.
|
int |
getStart()
Returns the start char index of the layout in XString.
|
boolean |
getUseFractionalMetrics()
Returns whether to use fractional character metrics.
|
double |
getWidthToFit()
Returns the width to fit.
|
boolean |
getWrapped()
Returns whether layout had to wrap a line.
|
RMXString |
getXString()
Returns the RMXString.
|
boolean |
isLocked()
Returns whether text layout is full.
|
void |
layout()
Performs text layout if needed.
|
void |
layoutToFit()
Scales font sizes of all text in an RMText shape to fit in bounds.
|
int |
length()
Returns the length of this text layout.
|
void |
removeLine()
Removes a line.
|
void |
setAlignHeight(double aValue)
Bogus!
|
void |
setAlignmentY(RMTypes.AlignY anAlignment)
Sets the vertical alignment of this layout.
|
void |
setFontScale(double aValue)
Sets the font scale of the text layout.
|
void |
setLocked(boolean aFlag)
Sets whether text layout can add more characters.
|
void |
setNeedsLayout(boolean aValue)
Sets whether text needs to perform layout.
|
void |
setStart(int aStart)
Sets the start char index of the layout in XString.
|
void |
setUseFractionalMetrics(boolean aFlag)
Sets whether to use fractional character metrics.
|
void |
setXString(RMXString anXString)
Sets the RMXString.
|
java.lang.CharSequence |
subSequence(int aStart,
int anEnd)
Returns a new char sequence that is a subsequence of this sequence.
|
java.lang.String |
toString()
Standard toString implementation.
|
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRect
add, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union
public RMXString getXString()
public void setXString(RMXString anXString)
public int getStart()
public void setStart(int aStart)
public int getEnd()
public boolean getNeedsLayout()
public void setNeedsLayout(boolean aValue)
public void layout()
public int addChars(RMXStringRun aRun, int aStart, int anEnd)
public void deleteChars(int anIndex)
public int length()
length
in interface java.lang.CharSequence
public char charAt(int anIndex)
charAt
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int aStart, int anEnd)
subSequence
in interface java.lang.CharSequence
public double getFontScale()
public void setFontScale(double aValue)
public boolean getUseFractionalMetrics()
public void setUseFractionalMetrics(boolean aFlag)
public RMTypes.AlignY getAlignmentY()
public void setAlignmentY(RMTypes.AlignY anAlignment)
public double getWidthToFit()
public double getHeightToFit()
public RMTextLine getLine()
public int getLineCount()
public RMTextLine getLine(int anIndex)
public RMTextLine getLineLast()
public RMTextLine addLine(RMXStringRun aRun)
public void removeLine()
public RMTextRun getRun()
public int getRunCount()
public RMTextRun getRun(int anIndex)
public RMTextRun getRunLast()
public RMTextRun createRun()
public RMTextRun addRun(RMXStringRun aRun, RMTextLine aLine)
public int getCharIndex(java.awt.geom.Point2D aPoint)
public int getCharIndex(double anX, double aY)
public java.awt.geom.Point2D getPointForChar(int anIndex)
public RMTextLine getLineForChar(int anIndex)
public RMTextLine getLineForPointY(double aY)
public RMTextRun getRunForPoint(double anX, double aY)
public java.awt.geom.Point2D getNextLineStartPoint(RMXStringRun aRun)
public double getIndent(RMXStringRun aRun)
public boolean getWrapped()
public boolean getLongWordFound()
public boolean getRanOutOfRoom()
public java.awt.geom.GeneralPath getPathForChars(int aStart, int anEnd)
public boolean isLocked()
public void setLocked(boolean aFlag)
public void setAlignHeight(double aValue)
public void layoutToFit()
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.awt.geom.Rectangle2D.Double