Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a new undocked DockNode #7

Open
dyrlund opened this issue Sep 11, 2015 · 6 comments
Open

Create a new undocked DockNode #7

dyrlund opened this issue Sep 11, 2015 · 6 comments

Comments

@dyrlund
Copy link

dyrlund commented Sep 11, 2015

Hi

Is there a way to create a new DockNode which is floating? I tried the following:

final DockNode testDock = new DockNode(lineChart,"Example Line Chart 2");
testDock.setFloating(true);

But that returns the following NullPointerException:

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    at org.dockfx.DockNode.setFloating(DockNode.java:296)
    at org.dockfx.DockNode.setFloating(DockNode.java:340)

I also tried to dock the DockNode first and then undock it but in that case it is not visible (= it seems like nothing is happening). Do I have to set some value to make it show?

final DockNode testDock = new DockNode(lineChart,"Example Line Chart 2");
testDock.dock(mainDockPane, DockPos.RIGHT);
testDock.undock();
@dyrlund
Copy link
Author

dyrlund commented Sep 18, 2015

I can call testDock.setFloatable(true); without any error, but the window still does not float. Any suggestions?

@RobertBColton
Copy link
Owner

@dyrlund This is a legitimate bug, thank you for reporting this. It was working in the original release, I know what is causing it and will be able to fix it. For now I have the following temporary work around.

From the demo application, wrap your setFloatable call in a Runnable and make sure you dock the node first so that it gets a preferred size:

    // can be created and docked before or after the scene is created
    // and the stage is shown
    final DockNode treeDock = new DockNode(generateRandomTree(), "Tree Dock", new ImageView(dockImage));
    treeDock.setPrefSize(100, 100);
    treeDock.dock(dockPane, DockPos.LEFT);
    Platform.runLater(new Runnable() {

      @Override
      public void run() {
        treeDock.setFloating(true);
      }

    });

The cause is the use of a local to screen translation in setFloatable returning a null Point2D because the dock node has not yet received a layout pass. It will be very easy to fix.

The intended behavior is exactly as you described, when this is fixed you will not have to dock it first and will be able to simply set it floating.

@arunartzoom
Copy link

Is the bug fixed ??

@arunartzoom
Copy link

Hi,
First of all thank you for such a great framework. Really docking framework is something I think, should be part of the JavaFx itself. I am following and evaluating your framework for last few weeks. I am seeing the last commited date as aug 2015. I am concerned about this particular bug also. Could anyone please tell me the status of this bug and the dockfx project itself. Is it under active development ? I would really like to use dockfx for a project I am working on.

Thanks & Regards

@jasons2000
Copy link

jasons2000 commented Apr 24, 2016

there's a fair bit of development happening on fork https://github.com/hkmoon/DockFX/tree/hkmoon, this is the fork I'm using at the moment.

@arunartzoom
Copy link

Thanks @jasons2000 ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants