Advertisement
Guest User

DockingFocusFrame

a guest
Jul 19th, 2011
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. package docking;
  2.  
  3. import java.awt.Dimension;
  4.  
  5. import javax.swing.JFrame;
  6. import javax.swing.JPanel;
  7.  
  8. import bibliothek.gui.dock.FlapDockStation;
  9. import bibliothek.gui.dock.common.CControl;
  10. import bibliothek.gui.dock.common.CLocation;
  11. import bibliothek.gui.dock.common.CWorkingArea;
  12. import bibliothek.gui.dock.common.DefaultSingleCDockable;
  13. import bibliothek.gui.dock.common.intern.DefaultCDockable;
  14. import bibliothek.gui.dock.common.theme.ThemeMap;
  15.  
  16. public class DockingFocusFrame extends JFrame {
  17.  
  18. private CControl dfControl;
  19.  
  20. private CWorkingArea workArea;
  21.  
  22. private ThemeMap dfThemes;
  23.  
  24. private DefaultSingleCDockable dock1;
  25.  
  26. private DefaultSingleCDockable dock2;
  27.  
  28. public DockingFocusFrame() {
  29. this.dfControl = new CControl(this);
  30. this.dfControl.putProperty(FlapDockStation.MINIMUM_SIZE, new Dimension(0, 0));
  31. this.workArea = this.dfControl.createWorkingArea("workArea");
  32. this.dfThemes = this.dfControl.getThemes();
  33. this.dfThemes.select(ThemeMap.KEY_ECLIPSE_THEME);
  34.  
  35. JPanel p = this.dfControl.getContentArea();
  36. this.workArea.setLocation(CLocation.base().normalRectangle(0, 0, 1, 1));
  37. this.workArea.setVisible(true);
  38. this.add(p);
  39.  
  40. { // panel 1
  41. JPanel panel = new DockingFocusPanel("Panel 1");
  42. this.dock1 = new DefaultSingleCDockable("Panel 1", "Panel 1", panel);
  43. this.dock1.setLocation(CLocation.working(this.workArea).rectangle(0, 0, 1, 1));
  44. this.workArea.add(this.dock1);
  45. this.dock1.setVisible(true);
  46. ((DefaultCDockable) this.dock1).setCloseable(true);
  47. ((DefaultCDockable) this.dock1).setMinimizable(false);
  48. ((DefaultCDockable) this.dock1).setTitleShown(true);
  49. }
  50.  
  51. { // panel 2
  52. JPanel panel = new DockingFocusPanel("Panel 2");
  53. this.dock2 = new DefaultSingleCDockable("Panel 2", "Panel 2", panel);
  54. this.dock2.setLocation(CLocation.working(this.workArea).rectangle(0, 0, 1, 1));
  55. this.workArea.add(this.dock2);
  56. this.dock2.setVisible(true);
  57. ((DefaultCDockable) this.dock2).setCloseable(true);
  58. ((DefaultCDockable) this.dock2).setMinimizable(false);
  59. ((DefaultCDockable) this.dock2).setTitleShown(true);
  60. }
  61. }
  62.  
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement