Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.gtk.java.swing.plaf.gtk
Class GtkTextUI.GtkCaret  view GtkTextUI.GtkCaret download GtkTextUI.GtkCaret.java

java.lang.Object
  extended byjava.awt.geom.RectangularShape
      extended byjava.awt.geom.Rectangle2D
          extended byjava.awt.Rectangle
              extended byjavax.swing.text.DefaultCaret
                  extended byorg.gtk.java.swing.plaf.gtk.GtkTextUI.GtkCaret
All Implemented Interfaces:
javax.swing.text.Caret, java.lang.Cloneable, java.util.EventListener, java.awt.event.FocusListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.awt.Shape, javax.swing.plaf.UIResource
Enclosing class:
GtkTextUI

public static class GtkTextUI.GtkCaret
extends javax.swing.text.DefaultCaret
implements javax.swing.plaf.UIResource

The gtk 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.


Nested Class Summary
 
Nested classes inherited from class javax.swing.text.DefaultCaret
 
Nested classes inherited from class java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float
 
Field Summary
(package private) static int IBeamOverhang
           
 
Fields inherited from class javax.swing.text.DefaultCaret
ALWAYS_UPDATE, changeEvent, listenerList, NEVER_UPDATE, UPDATE_WHEN_ON_EDT
 
Fields inherited from class java.awt.Rectangle
height, width, x, y
 
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
 
Constructor Summary
GtkTextUI.GtkCaret()
           
 
Method Summary
protected  void damage(java.awt.Rectangle r)
          Damages the area surrounding the caret to cause it to be repainted.
 void focusGained(java.awt.event.FocusEvent e)
          Called when the component containing the caret gains focus.
 void focusLost(java.awt.event.FocusEvent e)
          Called when the component containing the caret loses focus.
 void paint(java.awt.Graphics g)
          Renders the caret as a vertical line.
 
Methods inherited from class javax.swing.text.DefaultCaret
addChangeListener, adjustVisibility, deinstall, fireStateChanged, getBlinkRate, getChangeListeners, getComponent, getDot, getListeners, getMagicCaretPosition, getMark, getSelectionPainter, getUpdatePolicy, install, isSelectionVisible, isVisible, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, moveCaret, moveDot, positionCaret, removeChangeListener, repaint, setBlinkRate, setDot, setMagicCaretPosition, setSelectionVisible, setUpdatePolicy, setVisible
 
Methods inherited from class java.awt.Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, union
 
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
 

Field Detail

IBeamOverhang

static final int IBeamOverhang
See Also:
Constant Field Values
Constructor Detail

GtkTextUI.GtkCaret

public GtkTextUI.GtkCaret()
Method Detail

focusGained

public void focusGained(java.awt.event.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.

Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Called when the component containing the caret loses focus. This is implemented to set the caret to visibility to false.

Specified by:
focusLost in interface java.awt.event.FocusListener

damage

protected void damage(java.awt.Rectangle r)
Damages the area surrounding the caret to cause it to be repainted. If paint() is reimplemented, this method should also be reimplemented.


paint

public void paint(java.awt.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().

Specified by:
paint in interface javax.swing.text.Caret