Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package docking;
- import java.awt.Dimension;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import bibliothek.gui.dock.FlapDockStation;
- import bibliothek.gui.dock.common.CControl;
- import bibliothek.gui.dock.common.CLocation;
- import bibliothek.gui.dock.common.CWorkingArea;
- import bibliothek.gui.dock.common.DefaultSingleCDockable;
- import bibliothek.gui.dock.common.intern.DefaultCDockable;
- import bibliothek.gui.dock.common.theme.ThemeMap;
- public class DockingFocusFrame extends JFrame {
- private CControl dfControl;
- private CWorkingArea workArea;
- private ThemeMap dfThemes;
- private DefaultSingleCDockable dock1;
- private DefaultSingleCDockable dock2;
- public DockingFocusFrame() {
- this.dfControl = new CControl(this);
- this.dfControl.putProperty(FlapDockStation.MINIMUM_SIZE, new Dimension(0, 0));
- this.workArea = this.dfControl.createWorkingArea("workArea");
- this.dfThemes = this.dfControl.getThemes();
- this.dfThemes.select(ThemeMap.KEY_ECLIPSE_THEME);
- JPanel p = this.dfControl.getContentArea();
- this.workArea.setLocation(CLocation.base().normalRectangle(0, 0, 1, 1));
- this.workArea.setVisible(true);
- this.add(p);
- { // panel 1
- JPanel panel = new DockingFocusPanel("Panel 1");
- this.dock1 = new DefaultSingleCDockable("Panel 1", "Panel 1", panel);
- this.dock1.setLocation(CLocation.working(this.workArea).rectangle(0, 0, 1, 1));
- this.workArea.add(this.dock1);
- this.dock1.setVisible(true);
- ((DefaultCDockable) this.dock1).setCloseable(true);
- ((DefaultCDockable) this.dock1).setMinimizable(false);
- ((DefaultCDockable) this.dock1).setTitleShown(true);
- }
- { // panel 2
- JPanel panel = new DockingFocusPanel("Panel 2");
- this.dock2 = new DefaultSingleCDockable("Panel 2", "Panel 2", panel);
- this.dock2.setLocation(CLocation.working(this.workArea).rectangle(0, 0, 1, 1));
- this.workArea.add(this.dock2);
- this.dock2.setVisible(true);
- ((DefaultCDockable) this.dock2).setCloseable(true);
- ((DefaultCDockable) this.dock2).setMinimizable(false);
- ((DefaultCDockable) this.dock2).setTitleShown(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement