public static class

MotifTextUI.MotifCaret

extends DefaultCaret
implements UIResource
java.lang.Object
   ↳ java.awt.geom.RectangularShape
     ↳ java.awt.geom.Rectangle2D
       ↳ java.awt.Rectangle
         ↳ javax.swing.text.DefaultCaret
           ↳ com.sun.java.swing.plaf.motif.MotifTextUI.MotifCaret

Class Overview

The motif caret is rendered as an I beam.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.

Summary

[Expand]
Inherited Constants
From class javax.swing.text.DefaultCaret
From class java.awt.geom.Rectangle2D
[Expand]
Inherited Fields
From class javax.swing.text.DefaultCaret
From class java.awt.Rectangle
Public Constructors
MotifTextUI.MotifCaret()
Public Methods
void focusGained(FocusEvent e)
Called when the component containing the caret gains focus.
void focusLost(FocusEvent e)
Called when the component containing the caret loses focus.
void paint(Graphics g)
Renders the caret as a vertical line.
Protected Methods
void damage(Rectangle r)
Damages the area surrounding the caret to cause it to be repainted.
[Expand]
Inherited Methods
From class javax.swing.text.DefaultCaret
From class java.awt.Rectangle
From class java.awt.geom.Rectangle2D
From class java.awt.geom.RectangularShape
From class java.lang.Object
From interface java.awt.Shape
From interface java.awt.event.FocusListener
From interface java.awt.event.MouseListener
From interface java.awt.event.MouseMotionListener
From interface javax.swing.text.Caret

Public Constructors

public MotifTextUI.MotifCaret ()

Public Methods

public void focusGained (FocusEvent e)

Called when the component containing the caret gains focus. This is implemented to repaint the component so the focus rectangle will be re-rendered, as well as providing the superclass behavior.

Parameters
e the focus event

public void focusLost (FocusEvent e)

Called when the component containing the caret loses focus. This is implemented to set the caret to visibility to false.

Parameters
e the focus event

public void paint (Graphics g)

Renders the caret as a vertical line. If this is reimplemented the damage method should also be reimplemented as it assumes the shape of the caret is a vertical line. Does nothing if isVisible() is false. The caret color is derived from getCaretColor() if the component has focus, else from getDisabledTextColor().

Parameters
g the graphics context

Protected Methods

protected void damage (Rectangle r)

Damages the area surrounding the caret to cause it to be repainted. If paint() is reimplemented, this method should also be reimplemented.

Parameters
r the current location of the caret, does nothing if null
See Also