1
2 package org.catacomb.druid.gui.base;
3
4
5
6 import org.catacomb.druid.event.PanelListener;
7 import org.catacomb.druid.swing.DTabbedPane;
8 import org.catacomb.report.E;
9
10 import java.awt.Color;
11
12 import java.util.HashMap;
13
14
15 public class DruTabbedPanel extends DruPanel implements PanelListener {
16 static final long serialVersionUID = 1001;
17
18 DTabbedPane dTabbedPane;
19
20 HashMap<Object, DruPanel> panelsDtoDru;
21
22 public DruTabbedPanel() {
23
24 super();
25
26 panelsDtoDru = new HashMap<Object, DruPanel>();
27
28 dTabbedPane = new DTabbedPane();
29 setGridLayout(1, 1, 2, 2);
30 addDComponent(dTabbedPane);
31
32 dTabbedPane.setPanelListener(this);
33 }
34
35
36 public DruTabbedPanel(String s) {
37 this();
38 }
39
40
41 public static void applyUIColors(Color c) {
42 DTabbedPane.applyUIColors(c);
43 }
44
45
46 public void panelShown(Object obj) {
47 if (panelsDtoDru.containsKey(obj)) {
48 DruPanel drup = panelsDtoDru.get(obj);
49 drup.exportInfo();
50
51 } else {
52 E.info("dru tabbed panel called panelShown on unknown" + obj);
53 }
54 }
55
56
57 public void setBg(Color c) {
58 dTabbedPane.setBg(c);
59 super.setBg(c);
60 }
61
62 public void setFg(Color c) {
63 dTabbedPane.setFg(c);
64 super.setFg(c);
65 }
66
67
68
69 public void addPanel(DruPanel axp) {
70 panelsDtoDru.put(axp.getGUIPeer(), axp);
71
72 dTabbedPane.addTab(axp.getTitle(), axp.getGUIPeer(), axp.getTip());
73 }
74
75
76
77 public void showTab(String s) {
78 dTabbedPane.showTab(s);
79
80 }
81
82 }
83