edu.rice.cs.drjava.ui
Class ReverseHighlighter.DefaultUnderlineHighlightPainter
java.lang.Object
javax.swing.text.LayeredHighlighter.LayerPainter
edu.rice.cs.drjava.ui.ReverseHighlighter.DefaultUnderlineHighlightPainter
- All Implemented Interfaces:
- Highlighter.HighlightPainter
- Enclosing class:
- ReverseHighlighter
public static class ReverseHighlighter.DefaultUnderlineHighlightPainter
- extends LayeredHighlighter.LayerPainter
Simple highlight painter that underlines text.
|
Method Summary |
private void |
drawUnderline(Graphics g,
int x,
int y,
int width,
int height,
int thick)
|
Color |
getColor()
|
int |
getThickness()
|
void |
paint(Graphics g,
int offs0,
int offs1,
Shape bounds,
JTextComponent c)
Paints a highlight. |
Shape |
paintLayer(Graphics g,
int offs0,
int offs1,
Shape bounds,
JTextComponent c,
View view)
Paints a portion of a highlight. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
color
private Color color
thickness
private int thickness
ReverseHighlighter.DefaultUnderlineHighlightPainter
public ReverseHighlighter.DefaultUnderlineHighlightPainter(Color c,
int t)
- Constructs a new highlight painter. If c< is null, the JTextComponent will be queried for its selection color.
- Parameters:
c - the color for the highlightt - the thickness in pixels
getColor
public Color getColor()
- Returns:
- the color of the highlight
getThickness
public int getThickness()
- Returns:
- thickness in pixels
drawUnderline
private void drawUnderline(Graphics g,
int x,
int y,
int width,
int height,
int thick)
paint
public void paint(Graphics g,
int offs0,
int offs1,
Shape bounds,
JTextComponent c)
- Paints a highlight.
- Parameters:
g - the graphics contextoffs0 - the starting model offset >= 0offs1 - the ending model offset >= offs1bounds - the bounding box for the highlightc - the editor
paintLayer
public Shape paintLayer(Graphics g,
int offs0,
int offs1,
Shape bounds,
JTextComponent c,
View view)
- Paints a portion of a highlight.
- Specified by:
paintLayer in class LayeredHighlighter.LayerPainter
- Parameters:
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
- Returns:
- region drawing occured in