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 TypeMethodDescriptionvoid
actionPerformed
(ActionEvent event) static void
install
(AbstractButton button) Enable auto-repeat feature on the button.static void
install
(AbstractButton button, int delay, int initialDelay) Enable auto-repeat feature on the button.protected void
installListeners
(AbstractButton button, int delay, int initialDelay) void
void
void
void
void
static void
uninstall
(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:
mousePressed
in interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-