Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8133335

MOUSE_DRAGGED canceled by SceneGraph Change

XMLWordPrintable

      FULL PRODUCT VERSION :
      Microsoft Windows [Version 6.3.9600]
      (c) 2013 Microsoft Corporation. All rights reserved.

      C:\Users\Owner>java -version
      java version "1.8.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b26)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

      C:\Users\Owner>

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.3.9600]
      (c) 2013 Microsoft Corporation. All rights reserved.

      C:\Users\Owner>ver

      Microsoft Windows [Version 6.3.9600]

      C:\Users\Owner>

      A DESCRIPTION OF THE PROBLEM :
      This is an existing known, but unreported, bug. If during a MOUSE_DRAGGED the listener/EventHandler node is removed from the scene graph and immediately placed into a new scene it will no longer receive mouse events or events of any kind until the mouse button is released. This makes it impossible to implement custom press-drag-release of a node between scenes. I consider this to be an important issue because it is essential behavior to drag nodes between scenes.

      REGRESSION. Last worked in version 8u60

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a new JavaFX application with a default primary stage and scene. Add a node to the scene that listens for MOUSE_DRAGGED. The first time this node receives the event you should remove it from the scene and place it in a new scene in a new stage and then show this new stage. After this the node will no longer receive any mouse events or events in general (Event.ANY) until the mouse button that started the drag is released.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      It is expected that the node would continue to receive the MOUSE_DRAGGED events even after being placed in a new scene or that the MOUSE_DRAGGED event would end and the node would continue to receive at least other types of events. However the former is preferable for the functionality of a node being able to implement behavior that allows it to be dragged out of one scene and into another.
      ACTUAL -
      The node no longer receives ANY events until the mouse button is released.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      The only temporary but rather non ideal work around is to add a listener to the scene that the node was removed from and then remove it again when the mouse is released using its own listener for the mouse events. This however leads to rather tricky code and may not be possible if the original scene is destroyed.

      SUPPORT :
      YES

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: