View Javadoc

1   /*
2    *                Doelan development code
3    *
4    * This code may be freely distributed and modified under the
5    * terms of the GNU General Public Licence.  This should
6    * be distributed with the code. If you do not have a copy,
7    * see:
8    *
9    *      http://www.gnu.org/copyleft/gpl.txt
10   *
11   * Copyright (c) 2004-2005 ENS Microarray Platform
12   * Copyright for this code is held jointly by the individual
13   * authors.  These should be listed in @author doc comments.
14   *
15   * For more information on the Doelan project and its aims,
16   * or to join the Doelan mailing list, visit the home page
17   * at:
18   *
19   *      http://www.transcriptome.ens.fr/doelan
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    // Static method
96    //
97  
98    public static TestSuiteTabWidget getTestSuiteTabWidget() {
99      return widget;
100   }
101 
102   //
103   // Constructor
104   //
105 
106   /***
107    * Public constructor
108    */
109   public TestSuiteTabWidget() {
110     widget = this;
111     init();
112     setChipType(null);
113     setTestSuite(null);
114   }
115 
116 }