The docking library uses a SwComponentFactory to create the components of the docks, windows, headers, borders, etc... The component factory can be found in the docking manager.
The default component factory, that the docking manager uses, is a DefaultSwComponentFactory. If you want to change the components that the library uses, you have to give your own component factory to the docking manager.SwComponentFactory componentFactory = DockingManager.getComponentFactory();
The floating windows that the default component factory creates are undecorated.
If you want decorated windows, you have to create your own component factory like this:
Give this component factory to the docking manager:/** * This component factory creates decorated dialogs for the floating windows. * * @author Heidi Rakels. */ private class MyComponentFactory extends DefaultSwComponentFactory { public JDialog createJDialog(Window owner) { // Create the dialog. JDialog dialog = null; if (owner instanceof JDialog) { dialog = new JDialog((JDialog)owner, ((JDialog)owner).getTitle()); } else if (owner instanceof JFrame) { dialog = new JDialog((JFrame)owner, ((JFrame)owner).getTitle()); } else { dialog = new JDialog((JFrame)null, ""); } return dialog; } }
// Give our component factory to the docking manager. DockingManager.setComponentFactory(new MyComponentFactory());
The default splits of a javax.swing.JSplitPane are quite big.
If you want smaller divider for the split docks, you have to create your own component factory like this:
Give this component factory to the docking manager:/** * This component factory creates split panes with small dividers. * * @author Heidi Rakels. */ private class MyComponentFactory extends DefaultSwComponentFactory { public JSplitPane createJSplitPane() { JSplitPane splitPane = super.createJSplitPane(); splitPane.setDividerSize(3); return splitPane; } }
// Give our component factory to the docking manager. DockingManager.setComponentFactory(new MyComponentFactory());
The library uses a lot of headers. Leaf docks are using headers. Minimizers and maximizers are also using headers.
The header interfaces:
The headers of the leaf docks can be used for the following things:
The default headers created by the default component factory are:
DecoratedDialogs | Shows decorated floating windows. |
SmallDividerSplitDocks | Shows split docks with small dividers. |