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

Programatically control pane size better #12

Open
SamCooper opened this issue Mar 12, 2016 · 3 comments
Open

Programatically control pane size better #12

SamCooper opened this issue Mar 12, 2016 · 3 comments
Labels

Comments

@SamCooper
Copy link

At the moment I think I can only specify dock position, it would be nice to be able to specify initial docked size too. For example when creating an initial layout for something like an IDE having the docked logging window at the bottom only using a small (maybe 10%) of the height of the application window.

@RobertBColton
Copy link
Owner

This should already be possible with setPrefSize

tableDock.setPrefSize(300, 100);

Please correct me if it does not work however.

@SamCooper
Copy link
Author

I've modified your demo code to illustrate the problem:

    private void launchDemo(Stage primaryStage) {
        primaryStage.setTitle("DockFX");

        // create a dock pane that will manage our dock nodes and handle the layout
        DockPane dockPane = new DockPane();
        Scene scene = new Scene(dockPane, 800, 500);
        NodeManager nodeManager = new NodeManager(dockPane);

        DockNode buttons = nodeManager.getDockNode(new VBox(), "Left");
        buttons.setPrefSize(100, 450);
        buttons.dock(dockPane, DockPos.TOP);

        DockNode log = nodeManager.getDockNode(new VBox(), "Bottom");
        log.setPrefSize(800, 50);
        log.dock(dockPane, DockPos.BOTTOM);

        //DockNode canvas = nodeManager.getDockNode(new VBox(), "Middle");
        //canvas.setPrefSize(600, 450);
        //canvas.dock(dockPane, DockPos.RIGHT, buttons);
        //
        //DockNode param = nodeManager.getDockNode(new VBox(), "Right");
        //param.setPrefSize(100, 450);
        //param.dock(dockPane, DockPos.RIGHT, canvas);

        primaryStage.setScene(scene);
        primaryStage.sizeToScene();
        primaryStage.show();

        Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA);
        DockPane.initializeDefaultUserAgentStylesheet();
    }

Run it like that and you can see the desired proportions.

Add in the uncommented extra panes and I get it that it reverts the bottom pane to 50% of the total height.

@jamesgopinath
Copy link

Is there any work around available for this issue? or is there any plan to fix this?

TheDoctorOne added a commit to TheDoctorOne/DockFX that referenced this issue Mar 19, 2022
…rtBColton#12)

Added support for getDockNode to DockableNode interface which gets updated by BasicFXMLDockPaneAdapter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants