javax.swing.plaf.basic
public class BasicButtonListener extends Object implements MouseListener, MouseMotionListener, FocusListener, ChangeListener, PropertyChangeListener
Constructor and Description |
---|
BasicButtonListener(AbstractButton b) |
Modifier and Type | Method and Description |
---|---|
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) |
public BasicButtonListener(AbstractButton b)
public void propertyChange(PropertyChangeEvent e)
PropertyChangeListener
propertyChange
in interface PropertyChangeListener
e
- the change (containing the old and new values)protected void checkOpacity(AbstractButton b)
contentAreaFilled
property and updates the
opaque property of the button.b
- the button to checkpublic void focusGained(FocusEvent e)
FocusListener
focusGained
in interface FocusListener
e
- the FocusEvent
indicating that focus was gainedpublic void focusLost(FocusEvent e)
FocusListener
focusLost
in interface FocusListener
e
- the FocusEvent
indicating that focus was lostpublic void installKeyboardActions(JComponent c)
public void uninstallKeyboardActions(JComponent c)
public void stateChanged(ChangeEvent e)
ChangeListener
event
identifies the
source
of the event, allowing the listener to differentiate
when it is listening for changes in multiple sources.stateChanged
in interface ChangeListener
e
- the change event.public void mouseMoved(MouseEvent e)
MouseMotionListener
mouseMoved
in interface MouseMotionListener
e
- the MouseEvent
indicating the motionpublic void mouseDragged(MouseEvent e)
MouseMotionListener
mouseDragged
in interface MouseMotionListener
e
- the MouseEvent
indicating the motionpublic void mouseClicked(MouseEvent e)
MouseListener
mouseClicked
in interface MouseListener
e
- the MouseEvent
indicating the clickpublic void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
e
- The mouse press event to acceptpublic void mouseReleased(MouseEvent e)
true
, if the model
is armed. If the model is not armed, ignore the event.mouseReleased
in interface MouseListener
e
- The mouse release event to acceptpublic void mouseEntered(MouseEvent e)
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.mouseEntered
in interface MouseListener
e
- The mouse enter event to acceptpublic void mouseExited(MouseEvent e)
false
, if it's "rolloverEnabled" property is
true
. Also disarm the button.mouseExited
in interface MouseListener
e
- The mouse exit event to accept