1 /***
2 *
3 */
4 package base.jdbs.ui;
5
6 import java.awt.BorderLayout;
7
8 import javax.swing.JPanel;
9 import javax.swing.JSplitPane;
10
11 import base.jdbs.ui.panel.JDBSTabbedPanel;
12 import base.jdbs.ui.panel.PeerPanel;
13
14 /***
15 * @author skunk
16 *
17 */
18 @SuppressWarnings("serial")
19 public class JDBSMainPanel extends JPanel{
20
21 private JSplitPane splitPanel;
22 private JPanel westContentPanel;
23 private JPanel eastContentPanel;
24
25 public JDBSMainPanel(){
26 initialize();
27 }
28
29 protected void initialize(){
30 this.setLayout(new BorderLayout());
31 this.add(this.getSplitPanel(),BorderLayout.CENTER);
32 }
33
34 /***
35 * @return the westContentPanel
36 */
37 protected JPanel getWestContentPanel() {
38 if(this.westContentPanel == null){
39 this.westContentPanel = new JPanel();
40
41 this.westContentPanel.setLayout(new BorderLayout());
42 this.westContentPanel.add(new PeerPanel(),BorderLayout.CENTER);
43 }
44 return westContentPanel;
45 }
46
47 /***
48 * @return the eastContentPanel
49 */
50 protected JPanel getEastContentPanel() {
51 if(this.eastContentPanel == null){
52 this.eastContentPanel = new JPanel();
53
54 this.eastContentPanel.setLayout(new BorderLayout());
55 this.eastContentPanel.add(new JDBSTabbedPanel(),BorderLayout.CENTER);
56
57 }
58 return eastContentPanel;
59 }
60
61 /***
62 * @return the splitPanel
63 */
64 protected JSplitPane getSplitPanel() {
65 if(this.splitPanel == null){
66 this.splitPanel = new JSplitPane();
67 this.splitPanel.setDividerLocation(300);
68 this.splitPanel.setLeftComponent(this.getWestContentPanel());
69 this.splitPanel.setRightComponent(this.getEastContentPanel());
70 }
71 return splitPanel;
72 }
73 }