1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package fr.ens.transcriptome.doelan.gui;
23
24 import java.awt.BorderLayout;
25 import java.awt.GridLayout;
26
27 import javax.swing.JLabel;
28 import javax.swing.JPanel;
29
30 /***
31 * The testsuite panel
32 * @author Laurent Jourdren
33 */
34 public class TestSuiteTabWidget extends JPanel {
35
36 private static TestSuiteTabWidget widget;
37 private JLabel chipTypeLabel = new JLabel();
38 private JLabel testSuiteLabel = new JLabel();
39 private JPanel labelPane = new JPanel();
40 private TestSuitePanel table = new TestSuitePanel();
41
42 /***
43 * Set the chip type to display.
44 * @param chipType The name of the chip type to display
45 */
46 public void setChipType(final String chipType) {
47
48 String msg = "Chip type: ";
49 if (chipType == null)
50 msg += "no chip type selected";
51 else
52 msg += chipType;
53
54 this.chipTypeLabel.setText(msg);
55 }
56
57 /***
58 * Set the test suite to display.
59 * @param testSuite The name of the test suite to display
60 */
61 public void setTestSuite(final String testSuite) {
62
63 String msg = "Test suite: ";
64 if (testSuite == null)
65 msg += "no testsuite selected";
66 else
67 msg += testSuite;
68
69 this.testSuiteLabel.setText(msg);
70 }
71
72 /***
73 * Get the table widget.
74 * @return The table widget
75 */
76 public TestSuitePanel getTable() {
77 return this.table;
78 }
79
80 private void init() {
81
82 chipTypeLabel.setHorizontalAlignment(JLabel.CENTER);
83 testSuiteLabel.setHorizontalAlignment(JLabel.CENTER);
84
85 labelPane.setLayout(new GridLayout(1, 2));
86 labelPane.add(chipTypeLabel);
87 labelPane.add(testSuiteLabel);
88
89 setLayout(new BorderLayout());
90 add(labelPane, BorderLayout.NORTH);
91 add(table, BorderLayout.CENTER);
92 }
93
94
95
96
97
98 public static TestSuiteTabWidget getTestSuiteTabWidget() {
99 return widget;
100 }
101
102
103
104
105
106 /***
107 * Public constructor
108 */
109 public TestSuiteTabWidget() {
110 widget = this;
111 init();
112 setChipType(null);
113 setTestSuite(null);
114 }
115
116 }