Highlighter.HighlightPainter
DefaultHighlighter
public static class DefaultHighlighter.DefaultHighlightPainter extends LayeredHighlighter.LayerPainter
Constructor | Description |
---|---|
DefaultHighlightPainter |
Constructs a new highlight painter. |
Modifier and Type | Method | Description |
---|---|---|
Color |
getColor() |
Returns the color of the highlight. |
void |
paint |
Paints a highlight. |
Shape |
paintLayer |
Paints a portion of a highlight. |
public DefaultHighlightPainter(Color c)
c
is null, the JTextComponent will be queried for its selection color.c
- the color for the highlightpublic Color getColor()
public void paint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c)
g
- the graphics contextoffs0
- the starting model offset >= 0offs1
- the ending model offset >= offs1bounds
- the bounding box for the highlightc
- the editorpublic Shape paintLayer(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c, View view)
paintLayer
in class LayeredHighlighter.LayerPainter
g
- the graphics contextoffs0
- the starting model offset >= 0offs1
- the ending model offset >= offs1bounds
- the bounding box of the view, which is not necessarily the region to paint.c
- the editorview
- View painting for
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/text/DefaultHighlighter.DefaultHighlightPainter.html