public class RTextAreaHighlighter
extends javax.swing.plaf.basic.BasicTextUI.BasicHighlighter
RTextArea
s. It knows to
always paint "mark all" highlights below selection highlights.Most of this code is copied from javax.swing.text.DefaultHighlighter; unfortunately, we cannot re-use much of it since it is package private.
限定符和类型 | 类和说明 |
---|---|
static interface |
RTextAreaHighlighter.HighlightInfo
Information about a highlight being painted by this highlighter.
|
protected static class |
RTextAreaHighlighter.HighlightInfoImpl
A straightforward implementation of
HighlightInfo . |
static interface |
RTextAreaHighlighter.LayeredHighlightInfo
Information about a layered highlight being painted by this highlighter.
|
protected static class |
RTextAreaHighlighter.LayeredHighlightInfoImpl
A straightforward implementation of
HighlightInfo for
painting layered highlights. |
构造器和说明 |
---|
RTextAreaHighlighter()
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
void |
deinstall(javax.swing.text.JTextComponent c) |
int |
getMarkAllHighlightCount()
Returns the number of "mark all" highlights currently shown in the
editor.
|
java.util.List<DocumentRange> |
getMarkAllHighlightRanges()
Returns a list of "mark all" highlights in the text area.
|
void |
install(javax.swing.text.JTextComponent c) |
void |
paintLayeredHighlights(java.awt.Graphics g,
int lineStart,
int lineEnd,
java.awt.Shape viewBounds,
javax.swing.text.JTextComponent editor,
javax.swing.text.View view)
When leaf Views (such as LabelView) are rendering they should
call into this method.
|
protected void |
paintList(java.awt.Graphics g,
java.util.List<? extends RTextAreaHighlighter.HighlightInfo> highlights)
Paints a list of highlights.
|
protected void |
paintListLayered(java.awt.Graphics g,
int lineStart,
int lineEnd,
java.awt.Shape viewBounds,
javax.swing.text.JTextComponent editor,
javax.swing.text.View view,
java.util.List<? extends RTextAreaHighlighter.HighlightInfo> highlights) |
protected void |
repaintListHighlight(RTextAreaHighlighter.HighlightInfo info) |
protected RTextArea textArea
public void deinstall(javax.swing.text.JTextComponent c)
deinstall
在接口中 javax.swing.text.Highlighter
deinstall
在类中 javax.swing.text.DefaultHighlighter
public int getMarkAllHighlightCount()
public java.util.List<DocumentRange> getMarkAllHighlightRanges()
public void install(javax.swing.text.JTextComponent c)
install
在接口中 javax.swing.text.Highlighter
install
在类中 javax.swing.text.DefaultHighlighter
protected void paintList(java.awt.Graphics g, java.util.List<? extends RTextAreaHighlighter.HighlightInfo> highlights)
g
- The graphics context.highlights
- The list of highlights to paint.public void paintLayeredHighlights(java.awt.Graphics g, int lineStart, int lineEnd, java.awt.Shape viewBounds, javax.swing.text.JTextComponent editor, javax.swing.text.View view)
paintLayeredHighlights
在类中 javax.swing.text.DefaultHighlighter
g
- Graphics used to drawlineStart
- starting offset of viewlineEnd
- ending offset of viewviewBounds
- Bounds of Vieweditor
- JTextComponentview
- View instance being renderedprotected void paintListLayered(java.awt.Graphics g, int lineStart, int lineEnd, java.awt.Shape viewBounds, javax.swing.text.JTextComponent editor, javax.swing.text.View view, java.util.List<? extends RTextAreaHighlighter.HighlightInfo> highlights)
protected void repaintListHighlight(RTextAreaHighlighter.HighlightInfo info)