Class DragSupport

java.lang.Object
eu.mihosoft.vrl.v3d.ext.openjfx.utils3d.DragSupport

public class DragSupport extends Object
Utility class that binds simple mouse gestures to number properties so that their values can be controlled with mouse drag events.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    javafx.event.EventHandler<javafx.scene.input.KeyEvent>
     
    javafx.event.EventHandler<javafx.scene.input.MouseEvent>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DragSupport(javafx.scene.Scene target, javafx.scene.input.KeyCode modifier, javafx.geometry.Orientation orientation, javafx.beans.property.Property<Number> property)
    Creates DragSupport instance that attaches EventHandlers to the given scene and responds to mouse and keyboard events in order to change given property values according to mouse drag events of given orientation
    DragSupport(javafx.scene.Scene target, javafx.scene.input.KeyCode modifier, javafx.geometry.Orientation orientation, javafx.beans.property.Property<Number> property, double factor)
    Creates DragSupport instance that attaches EventHandlers to the given scene and responds to mouse and keyboard events in order to change given property values according to mouse drag events of given orientation.
    DragSupport(javafx.scene.Scene target, javafx.scene.input.KeyCode modifier, javafx.scene.input.MouseButton mouseButton, javafx.geometry.Orientation orientation, javafx.beans.property.Property<Number> property)
     
    DragSupport(javafx.scene.Scene target, javafx.scene.input.KeyCode modifier, javafx.scene.input.MouseButton mouseButton, javafx.geometry.Orientation orientation, javafx.beans.property.Property<Number> property, double factor)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes event handlers of this DragSupport instance from the target scene

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • keyboardEventHandler

      public javafx.event.EventHandler<javafx.scene.input.KeyEvent> keyboardEventHandler
    • mouseEventHandler

      public javafx.event.EventHandler<javafx.scene.input.MouseEvent> mouseEventHandler
  • Constructor Details

    • DragSupport

      public DragSupport(javafx.scene.Scene target, javafx.scene.input.KeyCode modifier, javafx.geometry.Orientation orientation, javafx.beans.property.Property<Number> property)
      Creates DragSupport instance that attaches EventHandlers to the given scene and responds to mouse and keyboard events in order to change given property values according to mouse drag events of given orientation
      Parameters:
      target - scene
      modifier - null if no modifier needed
      orientation - vertical or horizontal
      property - number property to control
      See Also:
    • DragSupport

      public DragSupport(javafx.scene.Scene target, javafx.scene.input.KeyCode modifier, javafx.scene.input.MouseButton mouseButton, javafx.geometry.Orientation orientation, javafx.beans.property.Property<Number> property)
    • DragSupport

      public DragSupport(javafx.scene.Scene target, javafx.scene.input.KeyCode modifier, javafx.geometry.Orientation orientation, javafx.beans.property.Property<Number> property, double factor)
      Creates DragSupport instance that attaches EventHandlers to the given scene and responds to mouse and keyboard events in order to change given property values according to mouse drag events of given orientation. Mouse movement amount is multiplied by given factor.
      Parameters:
      target - scene
      modifier - null if no modifier needed
      orientation - vertical or horizontal
      property - number property to control
      factor - multiplier for mouse movement amount
    • DragSupport

      public DragSupport(javafx.scene.Scene target, javafx.scene.input.KeyCode modifier, javafx.scene.input.MouseButton mouseButton, javafx.geometry.Orientation orientation, javafx.beans.property.Property<Number> property, double factor)
  • Method Details

    • detach

      public void detach()
      Removes event handlers of this DragSupport instance from the target scene