Groovy Documentation

com.wordpress.tipsforjava.swing
[Java] Class RectanglePainter

java.lang.Object
  javax.swing.text.LayeredHighlighter.LayerPainter
      javax.swing.text.DefaultHighlighter.DefaultHighlightPainter
          com.wordpress.tipsforjava.swing.RectanglePainter

public class RectanglePainter
extends DefaultHighlighter.DefaultHighlightPainter

Implements a simple highlight painter that renders a rectangle around the area to be highlighted.

Authors:
Rob Camick
Darryl Burke


Constructor Summary
RectanglePainter(Color color)

 
Method Summary
private Rectangle getDrawingArea(int offs0, int offs1, Shape bounds, View view)

Shape paintLayer(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c, View view)

Paints a portion of a highlight.

 
Methods inherited from class DefaultHighlighter.DefaultHighlightPainter
paint, getColor, paintLayer, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 
Methods inherited from class LayeredHighlighter.LayerPainter
paintLayer, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll, paint
 

Constructor Detail

RectanglePainter

public RectanglePainter(Color color)


 
Method Detail

getDrawingArea

private Rectangle getDrawingArea(int offs0, int offs1, Shape bounds, View view)


paintLayer

public Shape paintLayer(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c, View view)
Paints a portion of a highlight.
Parameters:
g - the graphics context
offs0 - the starting model offset >= 0
offs1 - the ending model offset >= offs1
bounds - the bounding box of the view, which is not necessarily the region to paint.
c - the editor
view - View painting for
Returns:
region drawing occured in


 

Groovy Documentation