public class TextSelection extends TextRange
POSN_ANCHOR, POSN_END, POSN_LOOSE, POSN_START
Constructor and Description |
---|
TextSelection()
Default constructor.
|
TextSelection(GFXColour oColour,
GFXColour oColourBg,
TextStream poStream)
Constructor with colours and stream.
|
TextSelection(TextSelection oSource)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
GFXColour |
colour()
Obtain the current foreground colour of the selection.
|
void |
colour(GFXColour oNewColour)
Change the foreground colour of the selection.
|
GFXColour |
colourBg()
Obtain the current background colour of the selection.
|
void |
colourBg(GFXColour oNewColourBg)
Change the background colour of the selection.
|
void |
copyFrom(TextSelection oSource)
Assignment operator.
|
boolean |
equals(Object object)
Equality comparison.
|
int |
hashCode() |
anchor, anchor, anchor, associate, associate, attribute, attribute, attribute, charPosition, charRange, copyFrom, count, countEmbed, countField, countText, delete, delete, end, end, end, enumerateMarkers, enumerateMarkers, getSelectionRectangles, grabLine, grabPara, grabWord, grabWord, insert, isEmpty, loose, loose, loose, markup, markup, notEqual, position, position, position, replace, replace, replace, replace, replace, replace, start, start, start, stream, text, text, text, tighten, union
public TextSelection()
Construct a text selection object with no initial stream association. The default foreground colour is white and the default background colour is black.
public TextSelection(TextSelection oSource)
Copy the source selection object including range and colours.
oSource
- - Source selection to copy.public TextSelection(GFXColour oColour, GFXColour oColourBg, TextStream poStream)
Construct a text selection object associated with the given stream and using the given colours. The selection range initially covers the entire text stream.
oColour
- - Foreground colour.oColourBg
- - Background colour.poStream
- - (optional) Text stream for association. NULL
(default) creates the text selection with no initial association.public GFXColour colour()
public void colour(GFXColour oNewColour)
Note: changing the colour does not automatically cause an invalidation of the selected text in any view.
oNewColour
- - New foreground colour.public GFXColour colourBg()
public void colourBg(GFXColour oNewColourBg)
Note: changing the colour does not automatically cause an invalidation of the selected text in any view.
oNewColourBg
- - New background colour.public void copyFrom(TextSelection oSource)
Copies all attrbutes of the source selection, including underlying text range and colours.
oSource
- - Source selection to copy.public boolean equals(Object object)
Two selections are considered equal of the represent the same range in the same text stream, and have the same foreground and background colours.
Copyright © 2010 - 2020 Adobe. All Rights Reserved