Add MOUSE_DRAG_DONE event type

XMLWordPrintable

    • Type: CSR
    • Resolution: Approved
    • Priority: P3
    • jfx26
    • Component/s: javafx
    • None
    • source
    • minimal
    • In theory an application could subclass Scene and implement methods that clash with the newly added methods, but it is highly unlikely.
    • Java API
    • JDK

      Summary

      Add a MouseDragEvent#MOUSE_DRAG_DONE event type and handlers to indicate when a full press-drag-release chain is done.

      Problem

      There is no current way for the user to know when a full press-drag-release chain is done. This is unlike the Drag-n-Drop chain of DragEvent that has a DRAG_DONE event type.

      Solution

      Add a MouseDragEvent#MOUSE_DRAG_DONE event type. Convenience handlers for Node and Scene are added as well to align with the other event types.

      Specification

      Field added to javafx.scene.input.MouseDragEvent:

      /**
       * This event occurs when the gesture ends. It is delivered exactly once to the gesture source, and is always the
       * last event in the full press-drag-release process. It is delivered even when the mouse is outside the window.
       *
       * @since 26
       */
      public static final EventType<MouseDragEvent> MOUSE_DRAG_DONE
      

      Methods added to javafx.scene.Node:

      public final void setOnMouseDragDone(EventHandler<? super MouseDragEvent> value)
      
      public final EventHandler<? super MouseDragEvent> getOnMouseDragDone()
      
      /**
       * Defines a function to be called when a full press-drag-release gesture ends with this node as its source.
       *
       * @return the event handler that is called when a full press-drag-release finishes
       * @see MouseDragEvent#MOUSE_DRAG_DONE
       * @since 26
       */
      public final ObjectProperty<EventHandler<? super MouseDragEvent>> onMouseDragDoneProperty()
      

      Methods added to javafx.scene.Scene:

      /**
       * Defines a function to be called when a full press-drag-release gesture ends.
       *
       * @see MouseDragEvent#MOUSE_DRAG_DONE
       * @since 26
       */
      private ObjectProperty<EventHandler<? super MouseDragEvent>> onMouseDragDone;
      
      public final void setOnMouseDragDone(EventHandler<? super MouseDragEvent> value)
      
      public final EventHandler<? super MouseDragEvent> getOnMouseDragDone()
      
      public final ObjectProperty<EventHandler<? super MouseDragEvent>> onMouseDragDoneProperty()
      

            Assignee:
            Nir Lisker
            Reporter:
            Nir Lisker
            Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: