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

Ability to load/save layouts #11

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

Ability to load/save layouts #11

SamCooper opened this issue Mar 12, 2016 · 10 comments

Comments

@SamCooper
Copy link

It would be nice to be able to persist the layout of the docked panes (and even the undocked ones) so that that it can be recreated when restarting an application.

@jasons2000
Copy link

I'm having to implement something like this for my application. We should consider creating a Dock Model separating it from the View and Control. This Dock Model would be a Tree like data structure capturing persist-able type state, including window size information and dock states. It would then be fairly trivial to persist this model, in addition this model structure could be mapped quite easily onto an FXML structure.

@jpiersol
Copy link

@jasons2000 Have you done any work on this? I'd be interested in using and/or helping develop.

@jasons2000
Copy link

Hi @jpiersol, I've implemented persistence for aspects of my GUI and this works well, but haven't yet started work on persisting the actual DockFX related attributes data. I'm probably a couple of weeks away from looking at this on my current project plan.

My original strategy was to do some thing quick and dirty as I think a proper solution would require creating a tree-like model representing the DockPane relationships separate from all the presentation and control code which might be a lot of change to the existing DockFX implementation.

In any case, once I start looking at persistence again I will be happy to share and work with you on it.

@mrjvijay
Copy link

mrjvijay commented Sep 8, 2016

Hi @jasons2000, I tried to implement persistence for my GUI using (x,y) coordinates but my nodes don't exactly display as how I wanted to see. It feels like they loose the positions when I dock them. Can you give me any inputs or ideas please?
Thanks

@jasons2000
Copy link

Have you looked at the latest ClearControl fork. That now contains a persistence mechanism for Windows.

@mrjvijay
Copy link

mrjvijay commented Sep 8, 2016

No not yet. I will check it out. Thanks so much.

@ValeriusGC
Copy link

Hi, excuse me, is this save/load mechanism implemented or nope? I had not found no trace of it in the source (searching by keywords save/load)...

@jasons2000
Copy link

i believe it's on one of the other forks, the Sam Cooper branch i think

@davidmoshal
Copy link

any updates on the ability to save/load dock state?

@sirolf2009
Copy link

I implemented this once for a project I was working one. You can find my save/load here: https://github.com/sirolf2009/caesar/blob/master/src/main/java/com/sirolf2009/caesar/MainController.java#L65
It uses kryo to serialize DockFX dashboards by saving the splitpane dividers and then turning them back into dashboards here: https://github.com/sirolf2009/caesar/blob/master/src/main/java/com/sirolf2009/caesar/component/DashboardTab.java

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

8 participants