java.lang.Object
qupath.fx.controls.InputDisplay
- All Implemented Interfaces:
EventListener,javafx.event.EventHandler<javafx.scene.input.InputEvent>
public class InputDisplay
extends Object
implements javafx.event.EventHandler<javafx.scene.input.InputEvent>
Control to display mouse and keyboard input when interacting with a window.
This is useful for demos and tutorials where shortcut keys are used.
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ObjectProperty<javafx.util.Duration>Property to control how quickly key presses fade after the keys have been released.javafx.beans.property.DoublePropertyProperty to control the final opacity after fading out keypresses.javafx.beans.property.BooleanPropertyWhether the input display is currently showing or not.javafx.beans.property.BooleanPropertyProperty to control whether modifier keys are shown using symbols or short forms, where available.javafx.beans.property.BooleanPropertyProperty to control whether keypresses are displayed when typing is performed within a text input control (e.g. -
Constructor Summary
ConstructorsConstructorDescriptionInputDisplay(javafx.stage.Window owner) Create an input display with the specified owner window.InputDisplay(javafx.stage.Window owner, javafx.collections.ObservableList<? extends javafx.stage.Window> windows) Create an input display with the specified owner window and list of windows to listen to. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.ObjectProperty<javafx.util.Duration>Property to control how quickly key presses fade after the keys have been released.javafx.beans.property.DoublePropertyProperty to control the final opacity after fading out keypresses.javafx.util.DurationGet the value offadeDurationProperty().doubleGet the value offadeToProperty().booleanGet the value ofshowSymbolsProperty().booleanGet the value ofskipTextInputControlsProperty().voidhandle(javafx.scene.input.InputEvent event) voidhide()Hide the input display.voidsetFadeDuration(javafx.util.Duration duration) Set the value offadeDurationProperty().voidsetFadeTo(double opacity) Set the value offadeToProperty().voidsetShowSymbols(boolean showSymbols) Set the value ofshowSymbolsProperty().voidsetSkipTextInputControls(boolean skip) Set the value ofskipTextInputControlsProperty().voidshow()Show the input display.javafx.beans.property.BooleanPropertyWhether the input display is currently showing or not.javafx.beans.property.BooleanPropertyProperty to control whether modifier keys are shown using symbols or short forms, where available.javafx.beans.property.BooleanPropertyProperty to control whether keypresses are displayed when typing is performed within a text input control (e.g.
-
Property Details
-
show
public javafx.beans.property.BooleanProperty showPropertyWhether the input display is currently showing or not. -
skipTextInputControls
public javafx.beans.property.BooleanProperty skipTextInputControlsPropertyProperty to control whether keypresses are displayed when typing is performed within a text input control (e.g. text field, text area). -
showSymbols
public javafx.beans.property.BooleanProperty showSymbolsPropertyProperty to control whether modifier keys are shown using symbols or short forms, where available.- See Also:
-
fadeDuration
public javafx.beans.property.ObjectProperty<javafx.util.Duration> fadeDurationPropertyProperty to control how quickly key presses fade after the keys have been released.- See Also:
-
fadeTo
public javafx.beans.property.DoubleProperty fadeToPropertyProperty to control the final opacity after fading out keypresses. This should be between 0 (completely transparent) and 1 (completely opaque). It can be used to control whether keypresses remain visible indefinitely after the key has been released.- See Also:
-
-
Constructor Details
-
InputDisplay
public InputDisplay(javafx.stage.Window owner) Create an input display with the specified owner window.- Parameters:
owner- the owner used to position the input display, and when listening to input events. If null, an input display is created to listen to all windows but without any owner.
-
InputDisplay
public InputDisplay(javafx.stage.Window owner, javafx.collections.ObservableList<? extends javafx.stage.Window> windows) Create an input display with the specified owner window and list of windows to listen to. To listen to input across all windows, useWindow.getWindows().- Parameters:
owner- the owner used to position the input display.windows- the windows to listen to.
-
-
Method Details
-
showProperty
public javafx.beans.property.BooleanProperty showProperty()Whether the input display is currently showing or not. -
show
public void show()Show the input display. -
hide
public void hide()Hide the input display. -
skipTextInputControlsProperty
public javafx.beans.property.BooleanProperty skipTextInputControlsProperty()Property to control whether keypresses are displayed when typing is performed within a text input control (e.g. text field, text area). -
setSkipTextInputControls
public void setSkipTextInputControls(boolean skip) Set the value ofskipTextInputControlsProperty().- Parameters:
skip- true to skip key presses within input controls, false to display them
-
getSkipTextInputControls
public boolean getSkipTextInputControls()Get the value ofskipTextInputControlsProperty().- Returns:
-
showSymbolsProperty
public javafx.beans.property.BooleanProperty showSymbolsProperty()Property to control whether modifier keys are shown using symbols or short forms, where available.- See Also:
-
setShowSymbols
public void setShowSymbols(boolean showSymbols) Set the value ofshowSymbolsProperty().- Parameters:
showSymbols- true to show symbols where available, false to display text names
-
getShowSymbols
public boolean getShowSymbols()Get the value ofshowSymbolsProperty().- Returns:
- true if symbols should be shown, false otherwise
-
fadeDurationProperty
public javafx.beans.property.ObjectProperty<javafx.util.Duration> fadeDurationProperty()Property to control how quickly key presses fade after the keys have been released.- See Also:
-
setFadeDuration
public void setFadeDuration(javafx.util.Duration duration) Set the value offadeDurationProperty().- Parameters:
duration- ) the new fade duration to use
-
getFadeDuration
public javafx.util.Duration getFadeDuration()Get the value offadeDurationProperty().- Returns:
- the current fade duration
-
fadeToProperty
public javafx.beans.property.DoubleProperty fadeToProperty()Property to control the final opacity after fading out keypresses. This should be between 0 (completely transparent) and 1 (completely opaque). It can be used to control whether keypresses remain visible indefinitely after the key has been released.- See Also:
-
setFadeTo
public void setFadeTo(double opacity) Set the value offadeToProperty().- Parameters:
opacity- ) the new fade opacity to use
-
getFadeTo
public double getFadeTo()Get the value offadeToProperty().- Returns:
- the current fade to opacity value
-
handle
public void handle(javafx.scene.input.InputEvent event) - Specified by:
handlein interfacejavafx.event.EventHandler<javafx.scene.input.InputEvent>
-