javax.swing.text
Class JTextComponent.MutableCaretEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byjavax.swing.event.CaretEvent
          extended byjavax.swing.text.JTextComponent.MutableCaretEvent
All Implemented Interfaces:
ChangeListener, EventListener, FocusListener, MouseListener, Serializable
Enclosing class:
JTextComponent

static class JTextComponent.MutableCaretEvent
extends CaretEvent
implements ChangeListener, FocusListener, MouseListener

Event to use when firing a notification of change to caret position. This is mutable so that the event can be reused since caret events can be fairly high in bandwidth.


Field Summary
private  int dot
           
private  boolean dragActive
           
private  int mark
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
(package private) JTextComponent.MutableCaretEvent(JTextComponent c)
           
 
Method Summary
(package private)  void fire()
           
 void focusGained(FocusEvent fe)
          Invoked when a component gains the keyboard focus.
 void focusLost(FocusEvent fe)
          Invoked when a component loses the keyboard focus.
 int getDot()
          Fetches the location of the caret.
 int getMark()
          Fetches the location of other end of a logical selection.
 void mouseClicked(MouseEvent e)
          Invoked when the mouse button has been clicked (pressed and released) on a component.
 void mouseEntered(MouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(MouseEvent e)
          Invoked when the mouse exits a component.
 void mousePressed(MouseEvent e)
          Requests focus on the associated text component, and try to set the cursor position.
 void mouseReleased(MouseEvent e)
          Called when the mouse is released.
 void stateChanged(ChangeEvent e)
          Invoked when the target of the listener has changed its state.
 String toString()
          Returns a String representation of this EventObject.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dragActive

private boolean dragActive

dot

private int dot

mark

private int mark
Constructor Detail

JTextComponent.MutableCaretEvent

JTextComponent.MutableCaretEvent(JTextComponent c)
Method Detail

fire

final void fire()

toString

public final String toString()
Description copied from class: EventObject
Returns a String representation of this EventObject.

Overrides:
toString in class EventObject
Returns:
A a String representation of this EventObject.

getDot

public final int getDot()
Description copied from class: CaretEvent
Fetches the location of the caret.

Specified by:
getDot in class CaretEvent
Returns:
the dot >= 0

getMark

public final int getMark()
Description copied from class: CaretEvent
Fetches the location of other end of a logical selection. If there is no selection, this will be the same as dot.

Specified by:
getMark in class CaretEvent
Returns:
the mark >= 0

stateChanged

public final void stateChanged(ChangeEvent e)
Description copied from interface: ChangeListener
Invoked when the target of the listener has changed its state.

Specified by:
stateChanged in interface ChangeListener
Parameters:
e - a ChangeEvent object

focusGained

public void focusGained(FocusEvent fe)
Description copied from interface: FocusListener
Invoked when a component gains the keyboard focus.

Specified by:
focusGained in interface FocusListener

focusLost

public void focusLost(FocusEvent fe)
Description copied from interface: FocusListener
Invoked when a component loses the keyboard focus.

Specified by:
focusLost in interface FocusListener

mousePressed

public final void mousePressed(MouseEvent e)
Requests focus on the associated text component, and try to set the cursor position.

Specified by:
mousePressed in interface MouseListener
Parameters:
e - the mouse event
See Also:
MouseListener.mousePressed(java.awt.event.MouseEvent)

mouseReleased

public final void mouseReleased(MouseEvent e)
Called when the mouse is released.

Specified by:
mouseReleased in interface MouseListener
Parameters:
e - the mouse event
See Also:
MouseListener.mouseReleased(java.awt.event.MouseEvent)

mouseClicked

public final void mouseClicked(MouseEvent e)
Description copied from interface: MouseListener
Invoked when the mouse button has been clicked (pressed and released) on a component.

Specified by:
mouseClicked in interface MouseListener

mouseEntered

public final void mouseEntered(MouseEvent e)
Description copied from interface: MouseListener
Invoked when the mouse enters a component.

Specified by:
mouseEntered in interface MouseListener

mouseExited

public final void mouseExited(MouseEvent e)
Description copied from interface: MouseListener
Invoked when the mouse exits a component.

Specified by:
mouseExited in interface MouseListener