com.jgoodies.looks.common
Class ExtBasicArrowButtonHandler
java.lang.Object
javax.swing.AbstractAction
com.jgoodies.looks.common.ExtBasicArrowButtonHandler
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.MouseListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
public final class ExtBasicArrowButtonHandler
- extends javax.swing.AbstractAction
- implements java.awt.event.MouseListener, java.awt.event.FocusListener
A handler for spinner arrow button mouse and action events. When
a left mouse pressed event occurs we look up the (enabled) spinner
that's the source of the event and start the autorepeat timer. The
timer fires action events until any button is released at which
point the timer is stopped and the reference to the spinner cleared.
The timer doesn't start until after a 300ms delay, so often the
source of the initial (and final) action event is just the button
logic for mouse released - which means that we're relying on the fact
that our mouse listener runs after the buttons mouse listener.
Note that one instance of this handler is shared by all slider previous
arrow buttons and likewise for all of the next buttons,
so it doesn't have any state that persists beyond the limits
of a single button pressed/released gesture.
Copied from javax.swing.BasicSpinnerUI
- Version:
- $Revision: 1.5 $
- See Also:
BasicSpinnerUI
,
Serialized Form
Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExtBasicArrowButtonHandler
public ExtBasicArrowButtonHandler(java.lang.String name,
boolean isNext)
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressed
in interface java.awt.event.MouseListener
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleased
in interface java.awt.event.MouseListener
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClicked
in interface java.awt.event.MouseListener
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
- Specified by:
mouseEntered
in interface java.awt.event.MouseListener
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Specified by:
mouseExited
in interface java.awt.event.MouseListener
focusGained
public void focusGained(java.awt.event.FocusEvent e)
- Specified by:
focusGained
in interface java.awt.event.FocusListener
focusLost
public void focusLost(java.awt.event.FocusEvent e)
- Specified by:
focusLost
in interface java.awt.event.FocusListener
Copyright © 2001-2008 JGoodies Karsten Lentzsch. All Rights Reserved.