Package com.jidesoft.swing
Class AutoRepeatButtonUtils
java.lang.Object
com.jidesoft.swing.AutoRepeatButtonUtils
- All Implemented Interfaces:
ActionListener,MouseListener,EventListener
AutoRepeatButtonUtils is a utility class which can make a button automatically trigger action events
continuously. To enable this feature on any button, just call AutoRepeatButtonUtils.install(button) or
AutoRepeatButtonUtils.install(button, delay, initialDelay).-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) static voidinstall(AbstractButton button) Enable auto-repeat feature on the button.static voidinstall(AbstractButton button, int delay, int initialDelay) Enable auto-repeat feature on the button.protected voidinstallListeners(AbstractButton button, int delay, int initialDelay) voidvoidvoidvoidvoidstatic voiduninstall(AbstractButton button) Disabled the auto-repeat feature on the button which called install before.protected void
-
Field Details
-
AUTO_REPEAT
-
CLIENT_PROPERTY_AUTO_REPEAT
-
DEFAULT_DELAY
public static int DEFAULT_DELAY -
DEFAULT_INITIAL_DELAY
public static int DEFAULT_INITIAL_DELAY
-
-
Constructor Details
-
AutoRepeatButtonUtils
public AutoRepeatButtonUtils()
-
-
Method Details
-
install
Enable auto-repeat feature on the button.- Parameters:
button- the button.
-
install
Enable auto-repeat feature on the button.- Parameters:
button- the button.delay- the delay between action events, in ms.initialDelay- the initial delay, in ms. It is from the time mouse is pressed to the first action event.
-
uninstall
Disabled the auto-repeat feature on the button which called install before.- Parameters:
button- the button that has auto-repeat feature.
-
installListeners
-
uninstallListeners
protected void uninstallListeners() -
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-