public class AutoRepeatButtonUtils
extends java.lang.Object
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, initialDelay, interval).| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AUTO_REPEAT |
static java.lang.String |
CLIENT_PROPERTY_AUTO_REPEAT |
static javafx.util.Duration |
DEFAULT_DELAY |
static javafx.util.Duration |
DEFAULT_INITIAL_DELAY |
| Constructor and Description |
|---|
AutoRepeatButtonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
install(javafx.scene.control.ButtonBase button)
Enable auto-repeat feature on the button.
|
static void |
install(javafx.scene.control.ButtonBase button,
javafx.util.Duration initialDelay,
javafx.util.Duration interval)
Enable auto-repeat feature on the button.
|
protected void |
installListeners(javafx.scene.control.ButtonBase button,
javafx.util.Duration initialDelay,
javafx.util.Duration interval) |
static void |
uninstall(javafx.scene.control.ButtonBase button)
Disabled the auto-repeat feature on the button which called install before.
|
protected void |
uninstallListeners() |
public static final java.lang.String AUTO_REPEAT
public static final java.lang.String CLIENT_PROPERTY_AUTO_REPEAT
public static final javafx.util.Duration DEFAULT_DELAY
public static final javafx.util.Duration DEFAULT_INITIAL_DELAY
public static void install(javafx.scene.control.ButtonBase button)
button - the button.public static void install(javafx.scene.control.ButtonBase button,
javafx.util.Duration initialDelay,
javafx.util.Duration interval)
button - the button.initialDelay - the initial delay. It is from the time mouse is pressed to the first action event.interval - the interval between action events.public static void uninstall(javafx.scene.control.ButtonBase button)
button - the button that has auto-repeat feature.protected void installListeners(javafx.scene.control.ButtonBase button,
javafx.util.Duration initialDelay,
javafx.util.Duration interval)
protected void uninstallListeners()