| java.lang.Object javax.swing.text.TextInterval
All known Subclasses: javax.swing.text.UnselectedTextInterval, javax.swing.text.ComposedTextInterval, javax.swing.text.SelectedTextInterval,
TextInterval | abstract class TextInterval implements Cloneable(Code) | | Represents a basic interval of text. There are three non-abstract
implementations:
UnselectedTextInterval ,
SelectedTextInterval ,
ComposedTextInterval .
|
Inner Class :interface TextIntervalPainter | |
Field Summary | |
protected int | end End of the interval. | final protected TextIntervalPainter | painter Painter to do actual text painting. | protected int | start Start of the interval. |
Constructor Summary | |
public | TextInterval(int start, int end, TextIntervalPainter painter) Creates a text interval. |
Method Summary | |
final public TextInterval | create(int start, int end) Creates a copy of the interval with new start and end.
Parameters: start - the new start of the interval. Parameters: end - the new end of the interval. | abstract public TextInterval[] | dissect(TextInterval another) Returns dissection of this interval and another .
Parameters: another - the interval to dissect with. | static TextInterval[] | dissect(SelectedTextInterval selected, ComposedTextInterval composed) Dissects selected and composed text intervals.
This method is meant for internal usage only.
Parameters: selected - the interval with selected text. Parameters: composed - the interval with composed text. | static TextInterval[] | dissect(UnselectedTextInterval ordinary, TextInterval selectedOrComposed) Dissects unselected and selected or composed
text intervals.
This method is meant for internal usage only.
Parameters: ordinary - the interval with unselected text. Parameters: selectedOrComposed - the interval with selected or composed text. | abstract public String | getType() Returns the string type of the interval. | final public boolean | intersects(TextInterval another) Checks whether two intervals intersect.
Parameters: another - the interval to check intersection with. | final public boolean | isEmpty() Checks whether this interval is empty. | abstract public int | paint(Graphics g, int x, int y) Paints text which falls in this interval.
Parameters: g - graphics to paint on. Parameters: x - the x coordinate. Parameters: y - the y coordinate.It assumed to be the baseline of text. | public String | toString() Converts interval to a string. |
end | protected int end(Code) | | End of the interval.
|
painter | final protected TextIntervalPainter painter(Code) | | Painter to do actual text painting.
|
start | protected int start(Code) | | Start of the interval.
|
TextInterval | public TextInterval(int start, int end, TextIntervalPainter painter)(Code) | | Creates a text interval.
Parameters: start - the start of the interval. Parameters: end - the end of the interval. Parameters: painter - the painter to use. |
create | final public TextInterval create(int start, int end)(Code) | | Creates a copy of the interval with new start and end.
Parameters: start - the new start of the interval. Parameters: end - the new end of the interval. the interval with the new start and end. |
dissect | abstract public TextInterval[] dissect(TextInterval another)(Code) | | Returns dissection of this interval and another .
Parameters: another - the interval to dissect with. pairwise disjoint intervals. |
dissect | static TextInterval[] dissect(SelectedTextInterval selected, ComposedTextInterval composed)(Code) | | Dissects selected and composed text intervals.
This method is meant for internal usage only.
Parameters: selected - the interval with selected text. Parameters: composed - the interval with composed text. pairwise disjoint intervals. |
dissect | static TextInterval[] dissect(UnselectedTextInterval ordinary, TextInterval selectedOrComposed)(Code) | | Dissects unselected and selected or composed
text intervals.
This method is meant for internal usage only.
Parameters: ordinary - the interval with unselected text. Parameters: selectedOrComposed - the interval with selected or composed text. pairwise disjoint intervals. |
getType | abstract public String getType()(Code) | | Returns the string type of the interval.
It is used in toString method.
the string type of the interval. |
intersects | final public boolean intersects(TextInterval another)(Code) | | Checks whether two intervals intersect.
Parameters: another - the interval to check intersection with. true if this interval intersectswith another ; false otherwise. |
isEmpty | final public boolean isEmpty()(Code) | | Checks whether this interval is empty.
true if the interval start is equal to its end;false otherwise. |
paint | abstract public int paint(Graphics g, int x, int y) throws BadLocationException(Code) | | Paints text which falls in this interval.
Parameters: g - graphics to paint on. Parameters: x - the x coordinate. Parameters: y - the y coordinate.It assumed to be the baseline of text. the x coordinate where the next text interval shouldbe painted. throws: BadLocationException - if interval represents invalid model range. |
toString | public String toString()(Code) | | Converts interval to a string.
the string representation of the interval. |
|
|