New in docking frames

Hi!

I just start using DockingFrames.
and first of well, they are really Cool! I saw the demos and it look so good.

how do I start working with them?

I liked the notes Example, and wanted to create something similar with different set of windows / panels - but got mixed up.

I saw in the docs - that usually Common is the way to use Docking Frames, but the notes uses only Core. so what is better to use?

and how to start doing it…? I read the documents Core.pdf / Common.pdf, and tried to start but didnt get a result that is close to the Notes…
I tried to follow up the code of the demo and got also mixed up…

please help me… thanks!

“Notes” was written before Common existed. Actually “Notes” is one of the oldest applications using the framework. The same is true for the “Help” and the “Chess” application. Today I would use Common for “Notes”.

Common offers nice default settings and features, Core offers more freedom. For a normal application the features of Common outweigh the freedom aspect.

As for starting… It’s hard giving an advice without knowing how much you understood. Personally I would copy the very simple applications from the help site and start expanding them. Perhaps you could tell me where exactly you got stuck?

Hi!

notes is the oldest? I liked it…

I got mix up specially with the settings of the locations on the frame.

I need to create something that have navigator on the left side, tabbed on the bottom, and dinamically tabbing in the center (somthing like the eclipse regular views).

and how to change the looks - that will look like the notes, let say. (with the round buttons, and the colors etc.).

thanks very much!

For the locations: I assume you now use Common. You can only set the initial layout, you have only a limited control of what the user does later. So we are only talking about the initial layout.

You might want to have a look at the „Paint“ application, it does almost the same thing as you just described.

dinamically tabbing in the center (somthing like the eclipse regular views)

There is a class called „CWorkingArea“ which behaves exactly like this eclipse-center-area. The CWorkingArea is itself a Dockable, so we can represent this center-area with the CWorkingArea.

Each CDockable is either a child of a working-area or not. The user cannot change this, a child of a working-area cannot be dragged outside, a non-child cannot be dragged inside a working-area. If the working-area has no children at all, it appears as an empty grey panel.

First you set up the empty frame, containing a CContentArea only:

CControl control = ...
CContentArea content = control.getContentArea();
frame.add( content );```

Assuming you already know which views to show, we can add them all at once. The class CGrid offers the necessary methods. (CGrid is a "helper class", it has no important role in the framework. It is just a collection of algorithms. We could produce the exact same result without it, but would need to write more code.)
```// create the standard-views
SingleCDockable navigator = new ....
SingleCDockable console = new ...
SingleCDockable help = new ...

// create the center
CWorkingArea center = control.createWorkingArea( "center-area" );

// use CGrid to register the views and to make the initial layout
CGrid grid = new CGrid( control );

// first the positions (x,y,width,height) of each element is stored ...
grid.add( 0, 0, 2, 10, navigator );
grid.add( 2, 0, 8, 6, center );
grid.add( 2, 6, 8, 4, console, help );

// ... then we make everything visible.
// Further changes to "grid" won't have any effect to "content"!
content.deploy( grid );

To open new views on the center-area, we have first to associate the new view with „center“, then make it visible:

MultipleCDockable view = new ...

// set its initial location: on "center", taking up as much space as possible
view.setLocation( CLocation.working( center).rectangle( 0, 0, 1, 1 ) );

// connect "center" with "view"
view.setWorkingArea( center );

// register the new view
control.add( view );

// make thew new view visible
view.setVisible( true );```

For the looks: [CControl.setTheme(String)](http://dock.javaforge.com/doc/bibliothek/gui/dock/common/CControl.html#setTheme(java.lang.String)) will do the trick. The name of theme used by Notes is [ThemeMap.KEY_BUBBLE_THEME](http://dock.javaforge.com/doc/bibliothek/gui/dock/common/layout/ThemeMap.html#KEY_BUBBLE_THEME).

The buttons itself are [CActions](http://dock.javaforge.com/doc/bibliothek/gui/dock/common/action/package-tree.html), e.g. a [CButton](http://dock.javaforge.com/doc/bibliothek/gui/dock/common/action/CButton.html) (each DefaultCDockable has a method "addAction"...).

hi,

thanks, I think I got the idea, and starting to get into it.
just one more question, if I may;

can I add also a toolBar? or a real JtoolBar, or a panel that allways stays up - even if I maximize one of the Dockables - it would go over the tool bar panel?

I mean ofcourse

can I add also a toolBar? or a real JtoolBar, or a panel that allways stays up - even if I maximize one of the Dockables - it would not go over the tool bar panel? :slight_smile:

and thanks again. :slight_smile:

Maximization of a Dockable is limited to a CContentArea, which is a JComponent. Anything that is not obscured by the CContentArae cannot be obscured by a Dockable. So yes, a JToolbar should not be possible.

hi!

i got the idea, and been successfull in writing my screen.
thank a lot for your help! :slight_smile: