MouseEvent dragX and dragY
Pavel Safrata
pavel.safrata at oracle.com
Wed Jul 4 04:47:52 PDT 2012
Hello,
it was removed based on a request from our architects: The dragX, dragY,
dragAnchorX, and dragAnchorY were added to MouseEvent way back in the
1.0 days as an attempt to do some of the book keeping necessary for
handling simple "dragging the node around" type of support. But as it
turns out, none of these four properties are actually useful for that
use case. The simplest code is to not use them, just record the location
at which the press occurred prior to the drag as well as the origin of
the node being dragged, and then place the node at the new location
during the drag event. We could add something back in later to make this
use case easier, but for now, it is better to omit API.
If I remember correctly there was one more reason for the removal - to
report the values in transformed node's coordinates, the logic was
really complex and used values stored to all nodes which was pretty ugly
and non-effective, so this feature would need a complete rewrite anyway.
There is already an open issue that requests to reintroduce the fields -
I'm considering your email as a vote in favor of this issue:
http://javafx-jira.kenai.com/browse/RT-16292
With regards,
Pavel
On 4.7.2012 3:05, Pedro Duque Vieira wrote:
> Hi,
>
> I just remembered to ask why where dragX and dragY properties removed from
> MouseEvent. I believe they stopped existing when the migration javafx 1.3
> -> javafx 2 occurred.
>
> They where good additions that helped remove some boiler plate code.
>
> Thanks, best regards,
>
More information about the openjfx-dev
mailing list