Programmatically moving dockable

Is it possible to move (drag etc.) dockables programmatically? I am trying to integrate DockingFrames with JavaFX.

Currently I have JFXPanels as dockable contents. My plan would be to use my own DisplayerFactory to hide the default frames and simulate the dragging programmatically as I drag a JavaFX panel. I can’t figure out how to simulate the drag events though.

Don’t know much about JavaFX, but there are two ways to influence the drag and drop operations:

  • If you still have some kind of java.awt.Component available, you can implement the interface “DockElementRepresentative”. Register the object with “DockController.addRepresentative” and the controller will add MouseListeners which allow drag and drop.
  • Or you call “DockController.getRelocator().createRemote”. This gives you a “remote”, an object which you can feed with fake MouseEvents. If these fake MouseEvents look like a drag and drop operation, then the framework will actually perform the operation.

[Edit: I can’t tell you if your plan is going to work, if you need help there you’ll have to give me a bit more information on what exactly you are doing.]

Thanks for the quick reply, I’ll try to play with those.

Thank you for the advice, I got it working easily using RemoteRelocator.