mihosoft
Programming, Art, Linux, Free Software…
mihosoft
Navigation
  • Home
  • VRL-Studio
  • About
  • Imprint
You are here: Home › Featured › Draggable Nodes With Just One Method Call!

Draggable Nodes With Just One Method Call!

February 27, 2013 | Filed under: Featured, JavaFX, Uncategorized

How do you make nodes draggable? If you search for draggable nodes you will find lots of code samples. But most of them don’t consider transformations. Transformations can be applied to nodes to scale them down etc. This is an important feature of JavaFX that unfortunately is not considered by many developers.

Don’t waste so much of JavaFX’s potential!

When I developed the window control I wanted to create draggable nodes that can also be dragged if the node or its parent was scaled. To simplify things, I added a class called MouseControlUtil to the JFXtras. It provides the method

MouseControlUtil.makeDraggable(final Node n);

This is all you need to do to make nodes draggable. Pretty cool, huh?

In the video tutorial I show a sample project that demonstrates how to create lots of draggable rectangles inside of a window control that contains scalable content. We’ll discuss what happens with the mouse pointer if you don’t consider transformations.

Sample project: MakeNodesDraggable01.

What features would you like to see in the future?

Do you need rotation support? What about 3D user interfaces? Tell me your ideas!

Did you like this article? Share it with your friends!

Tweet

Written by miho

Visit my Website Follow me on Twitter

3 Responses to "Draggable Nodes With Just One Method Call!"

  1. Java desktop links of the week, March 4 | Jonathan Giles says:
    March 3, 2013 at 21:44

    [...] mihosoft has a blog up about making it possible to easily drag nodes in a JavaFX application. [...]

    Reply
  2. Mircea says:
    March 4, 2013 at 22:11

    Wow wow wow. I didn’t know. Thank you so much.

    Reply
  3. TBM says:
    May 19, 2013 at 13:26

    Nice

    Reply

Leave a Reply Cancel reply

Pages

  • About
  • Imprint

Categories

  • Any-Key
  • Featured
  • Java
  • JavaFX
  • Linux
  • Linux on Apple Hardware
  • Linux: Daily Usage Tips
  • Mobile Apps
  • Mobile Devices
  • Repair Things
  • Uncategorized
  • Virtual Reality
  • VRL

Tags

3D Any-Key Apple Art Custom Kernel dryer fix it graph iOS Java JavaFX JavaFX 8 JFXtras JInternalFrame JVM Label Linux MacBook MDI mobile apps O2 Open Source openSUSE Painting Performance Reame repair things robovm samsung Simplex Calculator Surfstick Swing UMTS USB Drive Virtual Reality Virtual World VRL VRL-Studio window control Window Node Window System workflow workflows wvdial X11

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Follow @mihosoft

Recent Posts

  • Java & Gradle for iOS via RoboVM
  • Workflow Visualization With VWorkflows & JavaFX [Part 2]
  • Workflow Visualization With VWorkflows & JavaFX [Part 1]
  • JavaFX 3D & Window Control
  • JavaFX 8 Performance

Recent Comments

  • miho on Java & Gradle for iOS via RoboVM
  • TBM on Draggable Nodes With Just One Method Call!
  • TPC Mobile on Java & Gradle for iOS via RoboVM
  • miho on Java & Gradle for iOS via RoboVM
  • ntherning on Java & Gradle for iOS via RoboVM

Archives

  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • November 2010
  • February 2010
  • November 2009
  • October 2009
  • February 2009
  • August 2008
  • May 2008
  • April 2008
  • March 2008

© 2013 mihosoft