Groovy Documentation

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

java.lang.Object
  com.wordpress.tipsforjava.swing.LinePainter
All Implemented Interfaces:
Highlighter.HighlightPainter, CaretListener, MouseListener, MouseMotionListener

public class LinePainter
extends Object

Track the movement of the Caret by painting a background line at the current caret position.

Authors:
Rob Camick
Darryl Burke


Field Summary
private Color color

private JTextComponent component

private Rectangle lastView

 
Constructor Summary
LinePainter(JTextComponent component)

LinePainter(JTextComponent component, Color color)

 
Method Summary
void caretUpdate(CaretEvent e)

void mouseClicked(MouseEvent e)

void mouseDragged(MouseEvent e)

void mouseEntered(MouseEvent e)

void mouseExited(MouseEvent e)

void mouseMoved(MouseEvent e)

void mousePressed(MouseEvent e)

void mouseReleased(MouseEvent e)

void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c)

private void resetHighlight()

void setColor(Color color)

void setLighter(Color color)

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

color

private Color color


component

private JTextComponent component


lastView

private Rectangle lastView


 
Constructor Detail

LinePainter

public LinePainter(JTextComponent component)


LinePainter

public LinePainter(JTextComponent component, Color color)


 
Method Detail

caretUpdate

public void caretUpdate(CaretEvent e)


mouseClicked

public void mouseClicked(MouseEvent e)


mouseDragged

public void mouseDragged(MouseEvent e)


mouseEntered

public void mouseEntered(MouseEvent e)


mouseExited

public void mouseExited(MouseEvent e)


mouseMoved

public void mouseMoved(MouseEvent e)


mousePressed

public void mousePressed(MouseEvent e)


mouseReleased

public void mouseReleased(MouseEvent e)


paint

public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c)


resetHighlight

private void resetHighlight()


setColor

public void setColor(Color color)


setLighter

public void setLighter(Color color)


 

Groovy Documentation