public class TextSel
extends java.lang.Object
Constructor and Description |
---|
TextSel(Text aText,
double x1,
double y1,
double x2,
double y2,
boolean isWordSel,
boolean isParaSel)
Returns the selected range that would result from the given two points.
|
TextSel(Text aText,
int aStart,
int anEnd)
Creates a new selection.
|
TextSel(Text aText,
int aStart,
int anEnd,
int anAnchor)
Creates a new selection.
|
Modifier and Type | Method and Description |
---|---|
int |
getAnchor()
Returns the anchor.
|
int |
getCharDown()
Moves the selection index down a line, trying preserve distance from beginning of line.
|
int |
getCharLeft()
Moves the selection index backward a character (or if a range is selected, moves to beginning of range).
|
int |
getCharRight()
Moves the selection index forward a character (or if a range is selected, moves to end of range).
|
int |
getCharUp()
Moves the selection index up a line, trying to preserve distance from beginning of line.
|
int |
getEnd()
Returns the end.
|
TextLine |
getEndLine()
Returns the line at selection end.
|
int |
getLineEnd()
Moves the insertion point to next newline or text end.
|
int |
getLineStart()
Moves the insertion point to the beginning of line.
|
java.awt.geom.GeneralPath |
getPath(double aWidth)
Returns a path for two char indexes - it will be a a simple box with extensions for first/last lines.
|
int |
getSize()
The length.
|
int |
getStart()
Returns the start.
|
TextLine |
getStartLine()
Returns the line at selection start.
|
java.lang.String |
getString()
Returns the selected text string.
|
Text |
getText()
Returns the text.
|
boolean |
isEmpty()
Returns whether selection is empty.
|
protected boolean |
isWordChar(char c)
Returns whether a character should be considered is part of a word when WordSelecting.
|
public TextSel(Text aText, int aStart, int anEnd)
public TextSel(Text aText, int aStart, int anEnd, int anAnchor)
public TextSel(Text aText, double x1, double y1, double x2, double y2, boolean isWordSel, boolean isParaSel)
public Text getText()
public int getStart()
public int getEnd()
public int getAnchor()
public int getSize()
public boolean isEmpty()
public java.lang.String getString()
public int getCharRight()
public int getCharLeft()
public int getCharUp()
public int getCharDown()
public int getLineStart()
public int getLineEnd()
public TextLine getStartLine()
public TextLine getEndLine()
public java.awt.geom.GeneralPath getPath(double aWidth)
protected boolean isWordChar(char c)