| java.lang.Object | ||
| ↳ | javax.swing.text.LayeredHighlighter | |
| ↳ | javax.swing.text.DefaultHighlighter | |
Known Direct Subclasses
|
Implements the Highlighter interfaces. Implements a simple highlight painter that renders in a solid color.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| DefaultHighlighter.DefaultHighlightPainter | Simple highlight painter that fills a highlighted area with a solid color. | ||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| DefaultPainter | Default implementation of LayeredHighlighter.LayerPainter that can be used for painting highlights. | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new DefaultHighlighther object.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Adds a highlight to the view.
| |||||||||||
Changes a highlight.
| |||||||||||
Called when the UI is being removed from the interface of
a JTextComponent.
| |||||||||||
Makes a copy of the highlights.
| |||||||||||
Called when the UI is being installed into the
interface of a JTextComponent.
| |||||||||||
Renders the highlights.
| |||||||||||
When leaf Views (such as LabelView) are rendering they should
call into this method.
| |||||||||||
Removes all highlights.
| |||||||||||
Removes a highlight from the view.
| |||||||||||
If true, highlights are drawn as the Views draw the text.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
javax.swing.text.LayeredHighlighter
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
javax.swing.text.Highlighter
| |||||||||||
Default implementation of LayeredHighlighter.LayerPainter that can be used for painting highlights.
As of 1.4 this field is final.
Creates a new DefaultHighlighther object.
Adds a highlight to the view. Returns a tag that can be used to refer to the highlight.
| p0 | the start offset of the range to highlight >= 0 |
|---|---|
| p1 | the end offset of the range to highlight >= p0 |
| p | the painter to use to actually render the highlight |
| BadLocationException | if the specified location is invalid |
|---|
Changes a highlight.
| tag | the highlight tag |
|---|---|
| p0 | the beginning of the range >= 0 |
| p1 | the end of the range >= p0 |
| BadLocationException | if the specified location is invalid |
|---|
Called when the UI is being removed from the interface of a JTextComponent.
| c | the component |
|---|
Makes a copy of the highlights. Does not actually clone each highlight, but only makes references to them.
Called when the UI is being installed into the interface of a JTextComponent. Installs the editor, and removes any existing highlights.
| c | the editor component |
|---|
When leaf Views (such as LabelView) are rendering they should call into this method. If a highlight is in the given region it will be drawn immediately.
| g | Graphics used to draw |
|---|---|
| p0 | starting offset of view |
| p1 | ending offset of view |
| viewBounds | Bounds of View |
| editor | JTextComponent |
| view | View instance being rendered |
Removes all highlights.
Removes a highlight from the view.
| tag | the reference to the highlight |
|---|
If true, highlights are drawn as the Views draw the text. That is
the Views will call into paintLayeredHighlight which
will result in a rectangle being drawn before the text is drawn
(if the offsets are in a highlighted region that is). For this to
work the painter supplied must be an instance of
LayeredHighlightPainter.