javax.swing.plaf.basic
Class BasicButtonListener

java.lang.Object
  extended by javax.swing.plaf.basic.BasicButtonListener
All Implemented Interfaces:
FocusListener, MouseListener, MouseMotionListener, PropertyChangeListener, EventListener, ChangeListener

public class BasicButtonListener
extends Object
implements MouseListener, MouseMotionListener, FocusListener, ChangeListener, PropertyChangeListener


Constructor Summary
BasicButtonListener(AbstractButton b)
           
 
Method Summary
protected  void checkOpacity(AbstractButton b)
          Checks the contentAreaFilled property and updates the opaque property of the button.
 void focusGained(FocusEvent e)
          This method is called when a component gains the keyboard focus.
 void focusLost(FocusEvent e)
          This method is invoked when a component loses the keyboard focus.
 void installKeyboardActions(JComponent c)
           
 void mouseClicked(MouseEvent e)
          This method is called when the mouse is clicked (pressed and released in short succession) on a component.
 void mouseDragged(MouseEvent e)
          This method is called when the mouse is moved over a component while a button has been pressed.
 void mouseEntered(MouseEvent e)
          Accept a mouse enter event and set the button's "rollover" property to true, if the button's "rolloverEnabled" property is true.
 void mouseExited(MouseEvent e)
          Accept a mouse exit event and set the button's model's "rollover" property to false, if it's "rolloverEnabled" property is true.
 void mouseMoved(MouseEvent e)
          This method is called when the mouse is moved over a component while no button is pressed.
 void mousePressed(MouseEvent e)
          Accept a mouse press event and arm the button.
 void mouseReleased(MouseEvent e)
          Accept a mouse release event and set the button's "pressed" property to true, if the model is armed.
 void propertyChange(PropertyChangeEvent e)
          Fired after a Bean's property has changed.
 void stateChanged(ChangeEvent e)
          Called by an object to notify the listener that the object's state has changed.
 void uninstallKeyboardActions(JComponent c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicButtonListener

public BasicButtonListener(AbstractButton b)
Method Detail

propertyChange

public void propertyChange(PropertyChangeEvent e)
Description copied from interface: PropertyChangeListener
Fired after a Bean's property has changed.

Specified by:
propertyChange in interface PropertyChangeListener
Parameters:
e - the change (containing the old and new values)

checkOpacity

protected void checkOpacity(AbstractButton b)
Checks the contentAreaFilled property and updates the opaque property of the button.

Parameters:
b - the button to check

focusGained

public void focusGained(FocusEvent e)
Description copied from interface: FocusListener
This method is called when a component gains the keyboard focus.

Specified by:
focusGained in interface FocusListener
Parameters:
e - the FocusEvent indicating that focus was gained

focusLost

public void focusLost(FocusEvent e)
Description copied from interface: FocusListener
This method is invoked when a component loses the keyboard focus.

Specified by:
focusLost in interface FocusListener
Parameters:
e - the FocusEvent indicating that focus was lost

installKeyboardActions

public void installKeyboardActions(JComponent c)

uninstallKeyboardActions

public void uninstallKeyboardActions(JComponent c)

stateChanged

public void stateChanged(ChangeEvent e)
Description copied from interface: ChangeListener
Called by an object to notify the listener that the object's state has changed. The incoming event identifies the source of the event, allowing the listener to differentiate when it is listening for changes in multiple sources.

Specified by:
stateChanged in interface ChangeListener
Parameters:
e - the change event.

mouseMoved

public void mouseMoved(MouseEvent e)
Description copied from interface: MouseMotionListener
This method is called when the mouse is moved over a component while no button is pressed.

Specified by:
mouseMoved in interface MouseMotionListener
Parameters:
e - the MouseEvent indicating the motion

mouseDragged

public void mouseDragged(MouseEvent e)
Description copied from interface: MouseMotionListener
This method is called when the mouse is moved over a component while a button has been pressed.

Specified by:
mouseDragged in interface MouseMotionListener
Parameters:
e - the MouseEvent indicating the motion

mouseClicked

public void mouseClicked(MouseEvent e)
Description copied from interface: MouseListener
This method is called when the mouse is clicked (pressed and released in short succession) on a component.

Specified by:
mouseClicked in interface MouseListener
Parameters:
e - the MouseEvent indicating the click

mousePressed

public void mousePressed(MouseEvent e)
Accept a mouse press event and arm the button.

Specified by:
mousePressed in interface MouseListener
Parameters:
e - The mouse press event to accept

mouseReleased

public void mouseReleased(MouseEvent e)
Accept a mouse release event and set the button's "pressed" property to true, if the model is armed. If the model is not armed, ignore the event.

Specified by:
mouseReleased in interface MouseListener
Parameters:
e - The mouse release event to accept

mouseEntered

public void mouseEntered(MouseEvent e)
Accept a mouse enter event and set the button's "rollover" property to true, if the button's "rolloverEnabled" property is true. If the button is currently armed and the mouse button is not held down, this enter event will also disarm the model.

Specified by:
mouseEntered in interface MouseListener
Parameters:
e - The mouse enter event to accept

mouseExited

public void mouseExited(MouseEvent e)
Accept a mouse exit event and set the button's model's "rollover" property to false, if it's "rolloverEnabled" property is true. Also disarm the button.

Specified by:
mouseExited in interface MouseListener
Parameters:
e - The mouse exit event to accept