public class RMTextEditor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
isSpellChecking |
Constructor and Description |
---|
RMTextEditor() |
Modifier and Type | Method and Description |
---|---|
void |
copy()
Copies the current selection onto the clipboard.
|
void |
cut()
Copies the current selection onto the clip board, then deletes the current selection.
|
void |
delete()
Deletes the current selection.
|
void |
delete(int aStart,
int anEnd,
boolean doUpdateSel)
Deletes the given range of chars.
|
void |
deleteForward()
Deletes the character in front of the insertion point.
|
void |
deleteToLineEnd()
Deletes the characters from the insertion point to the end of the line.
|
RMTypes.AlignX |
getAlignX()
Returns the alignment for current selection.
|
Rect |
getBounds()
Returns the text editor bounds.
|
float |
getCharSpacing()
Returns the character spacing of the current selection or cursor.
|
RMColor |
getColor()
Returns the color of the current selection or cursor.
|
RMFont |
getFont()
Returns the font of the current selection or cursor.
|
RMFormat |
getFormat()
Returns the format of the current selection or cursor.
|
RMParagraph |
getInputParagraph()
Returns the paragraph of the current selection or cursor position.
|
RMTextStyle |
getInputStyle()
Returns the text style applied to any input characters.
|
TextBoxLine |
getLine(int anIndex)
Returns the individual line at given index.
|
int |
getLineCount()
Returns the number of lines.
|
TextBoxLine |
getLineForChar(int anIndex)
Returns the line index for the given character index.
|
float |
getLineGap()
Returns the line gap for current selection.
|
float |
getLineHeightMax()
Returns the maximum line height for a line of text (even if font size would dictate higher).
|
float |
getLineHeightMin()
Returns the min line height for current selection.
|
float |
getLineSpacing()
Returns the line spacing for current selection.
|
double |
getPrefHeight()
Returns the height needed to display all characters.
|
double |
getPrefWidth()
Returns the width needed to display all characters.
|
TextSel |
getSel()
Returns the text editor selection.
|
TextSel |
getSel(double p1x,
double p1y,
double p2x,
double p2y)
Returns the selected range that would result from the given two points.
|
int |
getSelAnchor()
Returns the character index of the last explicitly selected char (confined to the bounds of the selection).
|
int |
getSelEnd()
Returns the character index of the end of the text selection.
|
Shape |
getSelPath()
Returns the path for the current selection.
|
int |
getSelStart()
Returns the character index of the start of the text selection.
|
TextBoxLine |
getSelStartLine()
Returns the line at selection start.
|
Shape |
getSpellingPath()
Returns a path for misspelled word underlining.
|
java.lang.String |
getString()
Returns the plain string of the xstring being edited.
|
RichText |
getText()
Returns the rich text.
|
Border |
getTextBorder()
Returns whether current selection is outlined.
|
TextBox |
getTextBox()
Returns the text box used to layout text.
|
RMXString |
getXString()
Returns the xstring that is being edited.
|
static boolean |
isHyphenating()
Returns whether layout tries to hyphenate wrapped words.
|
boolean |
isSelEmpty()
Returns whether the selection is empty.
|
boolean |
isSpellChecking()
Returns whether editor is doing check-as-you-type spelling.
|
boolean |
isUnderlined()
Returns whether current selection is underlined.
|
void |
keyBackward(boolean isShiftDown)
Moves the insertion point backward a character (or if a range is selected, moves to beginning of range).
|
void |
keyDown()
Moves the insertion point down a line, trying preserve distance from beginning of line.
|
void |
keyForward(boolean isShiftDown)
Moves the insertion point forward a character (or if a range is selected, moves to end of range).
|
void |
keyUp()
Moves the insertion point up a line, trying to preserve distance from beginning of line.
|
int |
length()
Returns the number of characters in the text string.
|
void |
mouseDragged(ViewEvent anEvent)
Handles mouse dragged.
|
void |
mousePressed(ViewEvent anEvent)
Handles mouse pressed.
|
void |
mouseReleased(ViewEvent anEvent)
Handles mouse released.
|
void |
paste()
Pasts the current clipboard data over the current selection.
|
void |
processEvent(ViewEvent anEvent)
Handles events.
|
void |
replace(RichText aRichText)
Replaces the current selection with the given xstring.
|
void |
replace(RichText aRichText,
int aStart,
int anEnd,
boolean doUpdateSel)
Replaces the current selection with the given xstring.
|
void |
replace(java.lang.String aString)
Replaces the current selection with the given string.
|
void |
replace(java.lang.String aString,
int aStart,
int anEnd,
boolean doUpdateSel)
Replaces the current selection with the given string.
|
void |
replace(java.lang.String aString,
TextStyle aStyle,
int aStart,
int anEnd,
boolean doUpdateSel)
Replaces the current selection with the given string.
|
void |
selectAll()
Selects all the characters in the text editor.
|
void |
selectLineEnd()
Moves the insertion point to next newline or text end.
|
void |
selectLineStart()
Moves the insertion point to the beginning of line.
|
void |
setAlignX(RMTypes.AlignX anAlignX)
Sets the alignment for current selection.
|
void |
setBounds(double aX,
double aY,
double aW,
double aH)
Sets the text editor bounds.
|
void |
setCharSpacing(float aValue)
Returns the character spacing of the current selection or cursor.
|
void |
setColor(RMColor color)
Sets the color of the current selection or cursor.
|
void |
setFont(RMFont font)
Sets the font of the current selection or cursor.
|
void |
setFormat(RMFormat aFormat)
Sets the format of the current selection or cursor, after trying to expand the selection to encompass currently
selected, @-sign delineated key.
|
static void |
setHyphenating(boolean aValue)
Sets whether layout tries to hyphenate wrapped words.
|
void |
setInputAttribute(java.lang.String aKey,
java.lang.Object aValue)
Sets the attributes that are applied to current selection or newly typed chars.
|
void |
setInputParagraph(RMParagraph ps)
Sets the paragraph of the current selection or cursor position.
|
void |
setLineGap(float aHeight)
Sets the line gap for current selection.
|
void |
setLineHeightMax(float aHeight)
Sets the maximum line height for a line of text (even if font size would dictate higher).
|
void |
setLineHeightMin(float aHeight)
Sets the min line height for current selection.
|
void |
setLineSpacing(float aHeight)
Sets the line spacing for current selection.
|
void |
setSel(int newStartEnd)
Sets the character index of the text cursor.
|
void |
setSel(int aStart,
int anEnd)
Sets the character index of the start and end of the text selection.
|
void |
setSel(int aStart,
int anEnd,
int anAnchor)
Sets the character index of the start and end of the text selection.
|
void |
setSubscript()
Sets current selection to subscript.
|
void |
setSuperscript()
Sets current selection to superscript.
|
void |
setTextBorder(Border aBorder)
Sets whether current selection is outlined.
|
void |
setTextBox(TextBox aTextBox)
Returns the text box used to layout text.
|
void |
setUnderlined(boolean aFlag)
Sets whether current selection is underlined.
|
void |
setXString(RMXString aString)
Sets the xstring that is to be edited.
|
public TextBox getTextBox()
public void setTextBox(TextBox aTextBox)
public RichText getText()
public RMXString getXString()
public void setXString(RMXString aString)
public Rect getBounds()
public void setBounds(double aX, double aY, double aW, double aH)
public int length()
public boolean isSpellChecking()
public boolean isSelEmpty()
public TextSel getSel()
public void setSel(int newStartEnd)
public void setSel(int aStart, int anEnd)
public void setSel(int aStart, int anEnd, int anAnchor)
public int getSelStart()
public int getSelEnd()
public int getSelAnchor()
public void selectAll()
public TextSel getSel(double p1x, double p1y, double p2x, double p2y)
public int getLineCount()
public TextBoxLine getLine(int anIndex)
public TextBoxLine getLineForChar(int anIndex)
public TextBoxLine getSelStartLine()
public RMTextStyle getInputStyle()
public void setInputAttribute(java.lang.String aKey, java.lang.Object aValue)
public RMParagraph getInputParagraph()
public void setInputParagraph(RMParagraph ps)
public java.lang.String getString()
public RMColor getColor()
public void setColor(RMColor color)
public RMFont getFont()
public void setFont(RMFont font)
public RMFormat getFormat()
public void setFormat(RMFormat aFormat)
public boolean isUnderlined()
public void setUnderlined(boolean aFlag)
public Border getTextBorder()
public void setTextBorder(Border aBorder)
public void setSuperscript()
public void setSubscript()
public float getCharSpacing()
public void setCharSpacing(float aValue)
public RMTypes.AlignX getAlignX()
public void setAlignX(RMTypes.AlignX anAlignX)
public float getLineSpacing()
public void setLineSpacing(float aHeight)
public float getLineGap()
public void setLineGap(float aHeight)
public float getLineHeightMin()
public void setLineHeightMin(float aHeight)
public float getLineHeightMax()
public void setLineHeightMax(float aHeight)
public void delete()
public void delete(int aStart, int anEnd, boolean doUpdateSel)
public void replace(java.lang.String aString)
public void replace(java.lang.String aString, int aStart, int anEnd, boolean doUpdateSel)
public void replace(java.lang.String aString, TextStyle aStyle, int aStart, int anEnd, boolean doUpdateSel)
public void replace(RichText aRichText)
public void replace(RichText aRichText, int aStart, int anEnd, boolean doUpdateSel)
public void cut()
public void copy()
public void paste()
public void keyForward(boolean isShiftDown)
public void keyBackward(boolean isShiftDown)
public void keyUp()
public void keyDown()
public void selectLineStart()
public void selectLineEnd()
public void deleteForward()
public void deleteToLineEnd()
public double getPrefWidth()
public double getPrefHeight()
public void processEvent(ViewEvent anEvent)
public void mousePressed(ViewEvent anEvent)
public void mouseDragged(ViewEvent anEvent)
public void mouseReleased(ViewEvent anEvent)
public Shape getSelPath()
public Shape getSpellingPath()
public static final boolean isHyphenating()
public static final void setHyphenating(boolean aValue)