Module qupath.fx

Class InputDisplay

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 Details

    • show

      public javafx.beans.property.BooleanProperty showProperty
      Whether the input display is currently showing or not.
    • skipTextInputControls

      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).
      See Also:
    • showSymbols

      public javafx.beans.property.BooleanProperty showSymbolsProperty
      Property 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> fadeDurationProperty
      Property to control how quickly key presses fade after the keys have been released.
      See Also:
    • fadeTo

      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:
  • 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, use Window.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).
      See Also:
    • setSkipTextInputControls

      public void setSkipTextInputControls(boolean skip)
      Parameters:
      skip - true to skip key presses within input controls, false to display them
    • getSkipTextInputControls

      public boolean getSkipTextInputControls()
      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 of showSymbolsProperty().
      Parameters:
      showSymbols - true to show symbols where available, false to display text names
    • getShowSymbols

      public boolean getShowSymbols()
      Get the value of showSymbolsProperty().
      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 of fadeDurationProperty().
      Parameters:
      duration - ) the new fade duration to use
    • getFadeDuration

      public javafx.util.Duration getFadeDuration()
      Get the value of fadeDurationProperty().
      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 of fadeToProperty().
      Parameters:
      opacity - ) the new fade opacity to use
    • getFadeTo

      public double getFadeTo()
      Get the value of fadeToProperty().
      Returns:
      the current fade to opacity value
    • handle

      public void handle(javafx.scene.input.InputEvent event)
      Specified by:
      handle in interface javafx.event.EventHandler<javafx.scene.input.InputEvent>