2 |
26 Feb 07 |
jari |
1 |
/* |
2 |
26 Feb 07 |
jari |
Copyright @ 1999-2004, The Institute for Genomic Research (TIGR). |
2 |
26 Feb 07 |
jari |
All rights reserved. |
2 |
26 Feb 07 |
jari |
4 |
*/ |
2 |
26 Feb 07 |
jari |
5 |
/* |
2 |
26 Feb 07 |
jari |
* $RCSfile: EASEInitDialog.java,v $ |
2 |
26 Feb 07 |
jari |
* $Revision: 1.9 $ |
2 |
26 Feb 07 |
jari |
* $Date: 2006/02/23 20:59:50 $ |
2 |
26 Feb 07 |
jari |
* $Author: caliente $ |
2 |
26 Feb 07 |
jari |
* $State: Exp $ |
2 |
26 Feb 07 |
jari |
11 |
*/ |
2 |
26 Feb 07 |
jari |
12 |
/* |
2 |
26 Feb 07 |
jari |
* EaseInitDialog.java |
2 |
26 Feb 07 |
jari |
14 |
* |
2 |
26 Feb 07 |
jari |
* Created on August 25, 2003, 11:39 AM |
2 |
26 Feb 07 |
jari |
16 |
*/ |
2 |
26 Feb 07 |
jari |
17 |
|
2 |
26 Feb 07 |
jari |
18 |
package org.tigr.microarray.mev.cluster.gui.impl.ease; |
2 |
26 Feb 07 |
jari |
19 |
|
2 |
26 Feb 07 |
jari |
20 |
import java.awt.Color; |
2 |
26 Feb 07 |
jari |
21 |
import java.awt.Component; |
2 |
26 Feb 07 |
jari |
22 |
import java.awt.Dimension; |
2 |
26 Feb 07 |
jari |
23 |
import java.awt.Font; |
2 |
26 Feb 07 |
jari |
24 |
import java.awt.Frame; |
2 |
26 Feb 07 |
jari |
25 |
import java.awt.GridBagConstraints; |
2 |
26 Feb 07 |
jari |
26 |
import java.awt.GridBagLayout; |
2 |
26 Feb 07 |
jari |
27 |
import java.awt.Insets; |
2 |
26 Feb 07 |
jari |
28 |
import java.awt.Toolkit; |
2 |
26 Feb 07 |
jari |
29 |
import java.awt.event.ActionEvent; |
2 |
26 Feb 07 |
jari |
30 |
import java.awt.event.ActionListener; |
2 |
26 Feb 07 |
jari |
31 |
import java.awt.event.ItemEvent; |
2 |
26 Feb 07 |
jari |
32 |
import java.awt.event.ItemListener; |
2 |
26 Feb 07 |
jari |
33 |
import java.awt.event.WindowEvent; |
2 |
26 Feb 07 |
jari |
34 |
import java.io.File; |
2 |
26 Feb 07 |
jari |
35 |
import java.util.Vector; |
2 |
26 Feb 07 |
jari |
36 |
|
2 |
26 Feb 07 |
jari |
37 |
import javax.swing.BorderFactory; |
2 |
26 Feb 07 |
jari |
38 |
import javax.swing.ButtonGroup; |
2 |
26 Feb 07 |
jari |
39 |
import javax.swing.DefaultListCellRenderer; |
2 |
26 Feb 07 |
jari |
40 |
import javax.swing.DefaultListModel; |
2 |
26 Feb 07 |
jari |
41 |
import javax.swing.JButton; |
2 |
26 Feb 07 |
jari |
42 |
import javax.swing.JCheckBox; |
2 |
26 Feb 07 |
jari |
43 |
import javax.swing.JComboBox; |
2 |
26 Feb 07 |
jari |
44 |
import javax.swing.JFileChooser; |
2 |
26 Feb 07 |
jari |
45 |
import javax.swing.JFrame; |
2 |
26 Feb 07 |
jari |
46 |
import javax.swing.JLabel; |
2 |
26 Feb 07 |
jari |
47 |
import javax.swing.JList; |
2 |
26 Feb 07 |
jari |
48 |
import javax.swing.JOptionPane; |
2 |
26 Feb 07 |
jari |
49 |
import javax.swing.JPanel; |
2 |
26 Feb 07 |
jari |
50 |
import javax.swing.JRadioButton; |
2 |
26 Feb 07 |
jari |
51 |
import javax.swing.JScrollPane; |
2 |
26 Feb 07 |
jari |
52 |
import javax.swing.JTabbedPane; |
2 |
26 Feb 07 |
jari |
53 |
import javax.swing.JTextField; |
2 |
26 Feb 07 |
jari |
54 |
import javax.swing.JTextPane; |
2 |
26 Feb 07 |
jari |
55 |
import javax.swing.border.BevelBorder; |
2 |
26 Feb 07 |
jari |
56 |
import javax.swing.border.EtchedBorder; |
2 |
26 Feb 07 |
jari |
57 |
import javax.swing.border.TitledBorder; |
2 |
26 Feb 07 |
jari |
58 |
import javax.swing.event.ListSelectionEvent; |
2 |
26 Feb 07 |
jari |
59 |
import javax.swing.event.ListSelectionListener; |
2 |
26 Feb 07 |
jari |
60 |
|
2 |
26 Feb 07 |
jari |
61 |
import org.tigr.microarray.mev.TMEV; |
2 |
26 Feb 07 |
jari |
62 |
import org.tigr.microarray.mev.cluster.clusterUtil.Cluster; |
2 |
26 Feb 07 |
jari |
63 |
import org.tigr.microarray.mev.cluster.clusterUtil.ClusterRepository; |
2 |
26 Feb 07 |
jari |
64 |
import org.tigr.microarray.mev.cluster.gui.helpers.ClusterBrowser; |
2 |
26 Feb 07 |
jari |
65 |
import org.tigr.microarray.mev.cluster.gui.impl.dialogs.AlgorithmDialog; |
2 |
26 Feb 07 |
jari |
66 |
import org.tigr.microarray.mev.cluster.gui.impl.dialogs.DialogListener; |
2 |
26 Feb 07 |
jari |
67 |
import org.tigr.microarray.mev.cluster.gui.impl.dialogs.ParameterPanel; |
2 |
26 Feb 07 |
jari |
68 |
import org.tigr.microarray.mev.cluster.gui.impl.dialogs.dialogHelpUtil.HelpWindow; |
2 |
26 Feb 07 |
jari |
69 |
|
2 |
26 Feb 07 |
jari |
/** Accumulates parameters for execution of |
2 |
26 Feb 07 |
jari |
* EASE analysis. |
2 |
26 Feb 07 |
jari |
* @author braisted |
2 |
26 Feb 07 |
jari |
73 |
*/ |
2 |
26 Feb 07 |
jari |
74 |
public class EASEInitDialog extends AlgorithmDialog { |
2 |
26 Feb 07 |
jari |
75 |
|
2 |
26 Feb 07 |
jari |
/** Result when dialog is dismissed. |
2 |
26 Feb 07 |
jari |
77 |
*/ |
2 |
26 Feb 07 |
jari |
78 |
private int result = JOptionPane.CANCEL_OPTION; |
2 |
26 Feb 07 |
jari |
79 |
|
2 |
26 Feb 07 |
jari |
80 |
ConfigPanel configPanel; |
2 |
26 Feb 07 |
jari |
81 |
ModePanel modePanel; |
2 |
26 Feb 07 |
jari |
82 |
PopSelectionPanel popPanel; |
2 |
26 Feb 07 |
jari |
83 |
ClusterBrowser browser; |
2 |
26 Feb 07 |
jari |
84 |
EventListener listener; |
2 |
26 Feb 07 |
jari |
85 |
EaseParameterPanel easeParamPanel; |
2 |
26 Feb 07 |
jari |
86 |
AlphaPanel alphaPanel; |
2 |
26 Feb 07 |
jari |
87 |
JTabbedPane tabbedPane; |
2 |
26 Feb 07 |
jari |
88 |
Font font; |
2 |
26 Feb 07 |
jari |
89 |
String sep; |
2 |
26 Feb 07 |
jari |
90 |
Frame parent; |
2 |
26 Feb 07 |
jari |
91 |
|
2 |
26 Feb 07 |
jari |
/** Creates a new instance of EaseInitDialog |
2 |
26 Feb 07 |
jari |
* @param parent Parent Frame |
2 |
26 Feb 07 |
jari |
* @param repository Cluster repository to construct <CODE>ClusterBrowser</CODE> |
2 |
26 Feb 07 |
jari |
* @param annotationLabels Annotation types |
2 |
26 Feb 07 |
jari |
96 |
*/ |
2 |
26 Feb 07 |
jari |
97 |
public EASEInitDialog(Frame parent, ClusterRepository repository, String [] annotationLabels) { |
2 |
26 Feb 07 |
jari |
98 |
super(parent, "EASE: EASE Annotation Analysis", true); |
2 |
26 Feb 07 |
jari |
99 |
this.parent = parent; |
2 |
26 Feb 07 |
jari |
100 |
font = new Font("Dialog", Font.BOLD, 12); |
2 |
26 Feb 07 |
jari |
101 |
listener = new EventListener(); |
2 |
26 Feb 07 |
jari |
102 |
addWindowListener(listener); |
2 |
26 Feb 07 |
jari |
103 |
|
2 |
26 Feb 07 |
jari |
//Tabbed pane creation |
2 |
26 Feb 07 |
jari |
105 |
tabbedPane = new JTabbedPane(); |
2 |
26 Feb 07 |
jari |
106 |
|
2 |
26 Feb 07 |
jari |
//config panel |
2 |
26 Feb 07 |
jari |
108 |
configPanel = new ConfigPanel(); |
2 |
26 Feb 07 |
jari |
109 |
|
2 |
26 Feb 07 |
jari |
110 |
JPanel popNClusterPanel = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
111 |
popNClusterPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
112 |
popPanel = new PopSelectionPanel(); |
2 |
26 Feb 07 |
jari |
113 |
browser = new ClusterBrowser(repository); |
2 |
26 Feb 07 |
jari |
114 |
|
2 |
26 Feb 07 |
jari |
115 |
popNClusterPanel.add(popPanel, new GridBagConstraints(0,0,1,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
116 |
popNClusterPanel.add(browser, new GridBagConstraints(0,1,1,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
117 |
tabbedPane.add("Population and Cluster Selection", popNClusterPanel); |
2 |
26 Feb 07 |
jari |
118 |
|
2 |
26 Feb 07 |
jari |
119 |
easeParamPanel = new EaseParameterPanel(annotationLabels); |
2 |
26 Feb 07 |
jari |
120 |
tabbedPane.add("Annotation Parameters", easeParamPanel); |
2 |
26 Feb 07 |
jari |
121 |
|
2 |
26 Feb 07 |
jari |
122 |
alphaPanel = new AlphaPanel(); |
2 |
26 Feb 07 |
jari |
123 |
tabbedPane.add("Statistical Parameters", alphaPanel); |
2 |
26 Feb 07 |
jari |
124 |
|
2 |
26 Feb 07 |
jari |
125 |
JPanel parameters = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
126 |
parameters.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
127 |
|
2 |
26 Feb 07 |
jari |
//mode panel |
2 |
26 Feb 07 |
jari |
129 |
modePanel = new ModePanel(!(repository == null || repository.isEmpty())); |
2 |
26 Feb 07 |
jari |
130 |
|
2 |
26 Feb 07 |
jari |
131 |
parameters.add(configPanel, new GridBagConstraints(0,0,1,1,1.0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
132 |
parameters.add(modePanel, new GridBagConstraints(0,1,1,1,1.0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
133 |
parameters.add(tabbedPane, new GridBagConstraints(0,2,1,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
134 |
|
2 |
26 Feb 07 |
jari |
135 |
addContent(parameters); |
2 |
26 Feb 07 |
jari |
136 |
setActionListeners(listener); |
2 |
26 Feb 07 |
jari |
137 |
|
2 |
26 Feb 07 |
jari |
138 |
if(repository == null || repository.isEmpty()) { |
2 |
26 Feb 07 |
jari |
139 |
Component comp = tabbedPane.getComponentAt(0); |
2 |
26 Feb 07 |
jari |
140 |
JPanel panel = (JPanel)comp; |
2 |
26 Feb 07 |
jari |
141 |
panel.removeAll(); |
2 |
26 Feb 07 |
jari |
142 |
panel.validate(); |
2 |
26 Feb 07 |
jari |
143 |
panel.setOpaque(false); |
2 |
26 Feb 07 |
jari |
144 |
panel.add(new JLabel("Empty Cluster Repository"), new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(15,0,10,0),0,0)); |
2 |
26 Feb 07 |
jari |
145 |
panel.add(new JLabel("Only Annotation Survey is Enabled"), new GridBagConstraints(0,1,1,1,0,0,GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
146 |
tabbedPane.setSelectedIndex(1); |
2 |
26 Feb 07 |
jari |
147 |
} |
2 |
26 Feb 07 |
jari |
148 |
|
2 |
26 Feb 07 |
jari |
149 |
this.setSize(570,750); |
2 |
26 Feb 07 |
jari |
150 |
} |
2 |
26 Feb 07 |
jari |
151 |
|
2 |
26 Feb 07 |
jari |
/** Creates a new instance of EaseInitDialog |
2 |
26 Feb 07 |
jari |
* @param parent Parent Frame |
2 |
26 Feb 07 |
jari |
* @param repository Cluster repository to construct <CODE>ClusterBrowser</CODE> |
2 |
26 Feb 07 |
jari |
* @param annotationLabels Annotation types |
2 |
26 Feb 07 |
jari |
156 |
*/ |
2 |
26 Feb 07 |
jari |
157 |
public EASEInitDialog(Frame parent, String [] annotationLabels) { |
2 |
26 Feb 07 |
jari |
158 |
super(parent, "EASE: EASE Annotation Analysis", true); |
2 |
26 Feb 07 |
jari |
159 |
this.parent = parent; |
2 |
26 Feb 07 |
jari |
160 |
font = new Font("Dialog", Font.BOLD, 12); |
2 |
26 Feb 07 |
jari |
161 |
listener = new EventListener(); |
2 |
26 Feb 07 |
jari |
162 |
addWindowListener(listener); |
2 |
26 Feb 07 |
jari |
163 |
|
2 |
26 Feb 07 |
jari |
//Tabbed pane creation |
2 |
26 Feb 07 |
jari |
165 |
tabbedPane = new JTabbedPane(); |
2 |
26 Feb 07 |
jari |
166 |
|
2 |
26 Feb 07 |
jari |
//config panel |
2 |
26 Feb 07 |
jari |
168 |
configPanel = new ConfigPanel(); |
2 |
26 Feb 07 |
jari |
169 |
|
2 |
26 Feb 07 |
jari |
170 |
JPanel popNClusterPanel = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
171 |
popNClusterPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
172 |
popPanel = new PopSelectionPanel(); |
2 |
26 Feb 07 |
jari |
// browser = new ClusterBrowser(repository); |
2 |
26 Feb 07 |
jari |
174 |
|
2 |
26 Feb 07 |
jari |
175 |
JPanel emptyClusterPanel = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
176 |
String text = "<center><b>Note: When running EASE in script mode the cluster<br>"; |
2 |
26 Feb 07 |
jari |
177 |
text += "under analysis is determined by the preceding algorithm<br>"; |
2 |
26 Feb 07 |
jari |
178 |
text += "that feeds source data into EASE.</center>"; |
2 |
26 Feb 07 |
jari |
179 |
JTextPane textArea = new JTextPane(); |
2 |
26 Feb 07 |
jari |
180 |
textArea.setEditable(false); |
2 |
26 Feb 07 |
jari |
181 |
textArea.setBackground(Color.lightGray); |
2 |
26 Feb 07 |
jari |
182 |
textArea.setContentType("text/html"); |
2 |
26 Feb 07 |
jari |
183 |
textArea.setText(text); |
2 |
26 Feb 07 |
jari |
184 |
emptyClusterPanel.add(textArea, new GridBagConstraints(0,0,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
185 |
|
2 |
26 Feb 07 |
jari |
186 |
popNClusterPanel.add(popPanel, new GridBagConstraints(0,0,1,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
187 |
popNClusterPanel.add(emptyClusterPanel, new GridBagConstraints(0,1,1,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
188 |
tabbedPane.add("Population and Cluster Selection", popNClusterPanel); |
2 |
26 Feb 07 |
jari |
189 |
|
2 |
26 Feb 07 |
jari |
190 |
easeParamPanel = new EaseParameterPanel(annotationLabels); |
2 |
26 Feb 07 |
jari |
191 |
tabbedPane.add("Annotation Parameters", easeParamPanel); |
2 |
26 Feb 07 |
jari |
192 |
|
2 |
26 Feb 07 |
jari |
193 |
alphaPanel = new AlphaPanel(); |
2 |
26 Feb 07 |
jari |
194 |
tabbedPane.add("Statistical Parameters", alphaPanel); |
2 |
26 Feb 07 |
jari |
195 |
|
2 |
26 Feb 07 |
jari |
196 |
JPanel parameters = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
197 |
parameters.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
198 |
|
2 |
26 Feb 07 |
jari |
//mode panel |
2 |
26 Feb 07 |
jari |
200 |
modePanel = new ModePanel(true); |
2 |
26 Feb 07 |
jari |
201 |
|
2 |
26 Feb 07 |
jari |
202 |
parameters.add(configPanel, new GridBagConstraints(0,0,1,1,1.0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
203 |
parameters.add(modePanel, new GridBagConstraints(0,1,1,1,1.0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
204 |
parameters.add(tabbedPane, new GridBagConstraints(0,2,1,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
205 |
|
2 |
26 Feb 07 |
jari |
206 |
addContent(parameters); |
2 |
26 Feb 07 |
jari |
207 |
setActionListeners(listener); |
2 |
26 Feb 07 |
jari |
208 |
|
2 |
26 Feb 07 |
jari |
/* if(repository == null || repository.isEmpty()) { |
2 |
26 Feb 07 |
jari |
Component comp = tabbedPane.getComponentAt(0); |
2 |
26 Feb 07 |
jari |
JPanel panel = (JPanel)comp; |
2 |
26 Feb 07 |
jari |
panel.removeAll(); |
2 |
26 Feb 07 |
jari |
panel.validate(); |
2 |
26 Feb 07 |
jari |
panel.setOpaque(false); |
2 |
26 Feb 07 |
jari |
panel.add(new JLabel("Empty Cluster Repository"), new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(15,0,10,0),0,0)); |
2 |
26 Feb 07 |
jari |
panel.add(new JLabel("Only Annotation Survey is Enabled"), new GridBagConstraints(0,1,1,1,0,0,GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
tabbedPane.setSelectedIndex(1); |
2 |
26 Feb 07 |
jari |
218 |
} |
2 |
26 Feb 07 |
jari |
219 |
*/ |
2 |
26 Feb 07 |
jari |
220 |
this.setSize(570,750); |
2 |
26 Feb 07 |
jari |
221 |
} |
2 |
26 Feb 07 |
jari |
222 |
|
2 |
26 Feb 07 |
jari |
/** Shows the dialog. |
2 |
26 Feb 07 |
jari |
* @return */ |
2 |
26 Feb 07 |
jari |
225 |
public int showModal() { |
2 |
26 Feb 07 |
jari |
226 |
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); |
2 |
26 Feb 07 |
jari |
227 |
setLocation((screenSize.width - getSize().width)/2, (screenSize.height - getSize().height)/2); |
2 |
26 Feb 07 |
jari |
228 |
show(); |
2 |
26 Feb 07 |
jari |
229 |
return result; |
2 |
26 Feb 07 |
jari |
230 |
} |
2 |
26 Feb 07 |
jari |
231 |
|
2 |
26 Feb 07 |
jari |
/** Resets dialog controls. |
2 |
26 Feb 07 |
jari |
233 |
*/ |
2 |
26 Feb 07 |
jari |
234 |
private void resetControls(){ |
2 |
26 Feb 07 |
jari |
235 |
|
2 |
26 Feb 07 |
jari |
236 |
} |
2 |
26 Feb 07 |
jari |
237 |
|
2 |
26 Feb 07 |
jari |
/** Indicates if mode is cluster analysis, if not mode is annotation survey. |
2 |
26 Feb 07 |
jari |
* @return */ |
2 |
26 Feb 07 |
jari |
240 |
public boolean isClusterModeSelected(){ |
2 |
26 Feb 07 |
jari |
241 |
return this.modePanel.clusterAnalysisButton.isSelected(); |
2 |
26 Feb 07 |
jari |
242 |
} |
2 |
26 Feb 07 |
jari |
243 |
|
2 |
26 Feb 07 |
jari |
/** Returns the cluster selected for analysis. |
2 |
26 Feb 07 |
jari |
* @return */ |
2 |
26 Feb 07 |
jari |
246 |
public Cluster getSelectedCluster(){ |
2 |
26 Feb 07 |
jari |
247 |
return this.browser.getSelectedCluster(); |
2 |
26 Feb 07 |
jari |
248 |
} |
2 |
26 Feb 07 |
jari |
249 |
|
2 |
26 Feb 07 |
jari |
250 |
|
2 |
26 Feb 07 |
jari |
251 |
public boolean isPopFileModeSelected() { |
2 |
26 Feb 07 |
jari |
252 |
return popPanel.fileButton.isSelected(); |
2 |
26 Feb 07 |
jari |
253 |
} |
2 |
26 Feb 07 |
jari |
254 |
|
2 |
26 Feb 07 |
jari |
255 |
|
2 |
26 Feb 07 |
jari |
/** Returns the population fille to load |
2 |
26 Feb 07 |
jari |
257 |
*/ |
2 |
26 Feb 07 |
jari |
258 |
public String getPopulationFileName() { |
2 |
26 Feb 07 |
jari |
259 |
return this.popPanel.getPopFile(); |
2 |
26 Feb 07 |
jari |
260 |
} |
2 |
26 Feb 07 |
jari |
261 |
|
2 |
26 Feb 07 |
jari |
/** Returns the name of the converter file selected. |
2 |
26 Feb 07 |
jari |
* If none selected null is returned. |
2 |
26 Feb 07 |
jari |
264 |
*/ |
2 |
26 Feb 07 |
jari |
265 |
public String getConverterFileName(){ |
2 |
26 Feb 07 |
jari |
266 |
return easeParamPanel.getConverterFileName(); |
2 |
26 Feb 07 |
jari |
267 |
} |
2 |
26 Feb 07 |
jari |
268 |
|
2 |
26 Feb 07 |
jari |
/** Returns the minimum clusters size if trimming result. |
2 |
26 Feb 07 |
jari |
270 |
*/ |
2 |
26 Feb 07 |
jari |
271 |
public int getMinClusterSize() { |
2 |
26 Feb 07 |
jari |
272 |
String value = easeParamPanel.minClusterSizeField.getText(); |
2 |
26 Feb 07 |
jari |
273 |
try { |
2 |
26 Feb 07 |
jari |
274 |
int size = Integer.parseInt(value); |
2 |
26 Feb 07 |
jari |
275 |
return size; |
2 |
26 Feb 07 |
jari |
276 |
} catch (NumberFormatException e) { |
2 |
26 Feb 07 |
jari |
277 |
return 0; |
2 |
26 Feb 07 |
jari |
278 |
} |
2 |
26 Feb 07 |
jari |
279 |
} |
2 |
26 Feb 07 |
jari |
280 |
|
2 |
26 Feb 07 |
jari |
/** Returns the base file location for EASE file system |
2 |
26 Feb 07 |
jari |
282 |
*/ |
2 |
26 Feb 07 |
jari |
283 |
public String getBaseFileLocation() { |
2 |
26 Feb 07 |
jari |
284 |
return configPanel.getBaseFileLocation(); |
2 |
26 Feb 07 |
jari |
285 |
} |
2 |
26 Feb 07 |
jari |
286 |
|
2 |
26 Feb 07 |
jari |
/** Returns the annotation key type. |
2 |
26 Feb 07 |
jari |
288 |
*/ |
2 |
26 Feb 07 |
jari |
289 |
public String getAnnotationKeyType(){ |
2 |
26 Feb 07 |
jari |
290 |
return easeParamPanel.getAnnotationKeyType(); |
2 |
26 Feb 07 |
jari |
291 |
} |
2 |
26 Feb 07 |
jari |
292 |
|
2 |
26 Feb 07 |
jari |
293 |
|
2 |
26 Feb 07 |
jari |
/** Returns a list of file names corresponding to files mapping |
2 |
26 Feb 07 |
jari |
* indices to annotation terms (themes). |
2 |
26 Feb 07 |
jari |
296 |
*/ |
2 |
26 Feb 07 |
jari |
297 |
public String [] getAnnToGOFileList(){ |
2 |
26 Feb 07 |
jari |
298 |
return this.easeParamPanel.getAnnToGOFileList(); |
2 |
26 Feb 07 |
jari |
299 |
} |
2 |
26 Feb 07 |
jari |
300 |
|
2 |
26 Feb 07 |
jari |
/** Returns the stat to report. If true then EaseScore, else Fisher's Exact. |
2 |
26 Feb 07 |
jari |
302 |
*/ |
2 |
26 Feb 07 |
jari |
303 |
public boolean isEaseScoreSelected(){ |
2 |
26 Feb 07 |
jari |
304 |
return (this.alphaPanel.easeBox.isSelected()); |
2 |
26 Feb 07 |
jari |
305 |
} |
2 |
26 Feb 07 |
jari |
306 |
|
2 |
26 Feb 07 |
jari |
/** Returns true if multiplicity corrections are |
2 |
26 Feb 07 |
jari |
* selected. |
2 |
26 Feb 07 |
jari |
309 |
*/ |
2 |
26 Feb 07 |
jari |
310 |
public boolean isCorrectPvaluesSelected(){ |
2 |
26 Feb 07 |
jari |
311 |
return (this.isBonferroniSelected() || this.isStepDownBonferroniSelected() || this.isSidakSelected()); |
2 |
26 Feb 07 |
jari |
312 |
} |
2 |
26 Feb 07 |
jari |
313 |
|
2 |
26 Feb 07 |
jari |
/** Returns true if Bonferroni correction is selected. |
2 |
26 Feb 07 |
jari |
315 |
*/ |
2 |
26 Feb 07 |
jari |
316 |
public boolean isBonferroniSelected(){ |
2 |
26 Feb 07 |
jari |
317 |
return alphaPanel.bonferroniBox.isSelected(); |
2 |
26 Feb 07 |
jari |
318 |
} |
2 |
26 Feb 07 |
jari |
319 |
|
2 |
26 Feb 07 |
jari |
/** Returns true if step down Bonferroni is selected. |
2 |
26 Feb 07 |
jari |
321 |
*/ |
2 |
26 Feb 07 |
jari |
322 |
public boolean isStepDownBonferroniSelected(){ |
2 |
26 Feb 07 |
jari |
323 |
return alphaPanel.bonferroniStepBox.isSelected(); |
2 |
26 Feb 07 |
jari |
324 |
} |
2 |
26 Feb 07 |
jari |
325 |
|
2 |
26 Feb 07 |
jari |
/** Returns true is Sidak method correction is selected |
2 |
26 Feb 07 |
jari |
327 |
*/ |
2 |
26 Feb 07 |
jari |
328 |
public boolean isSidakSelected(){ |
2 |
26 Feb 07 |
jari |
329 |
return alphaPanel.sidakBox.isSelected(); |
2 |
26 Feb 07 |
jari |
330 |
} |
2 |
26 Feb 07 |
jari |
331 |
|
2 |
26 Feb 07 |
jari |
/** Returns true if bootstrapping permutations |
2 |
26 Feb 07 |
jari |
* are selected. |
2 |
26 Feb 07 |
jari |
334 |
*/ |
2 |
26 Feb 07 |
jari |
335 |
public boolean isPermutationAnalysisSelected(){ |
2 |
26 Feb 07 |
jari |
336 |
return alphaPanel.permBox.isSelected(); |
2 |
26 Feb 07 |
jari |
337 |
} |
2 |
26 Feb 07 |
jari |
338 |
|
2 |
26 Feb 07 |
jari |
/** Returns the number of permutations to perform. |
2 |
26 Feb 07 |
jari |
340 |
*/ |
2 |
26 Feb 07 |
jari |
341 |
public int getPermutationCount(){ |
2 |
26 Feb 07 |
jari |
342 |
return Integer.parseInt(alphaPanel.permField.getText()); |
2 |
26 Feb 07 |
jari |
343 |
} |
2 |
26 Feb 07 |
jari |
344 |
|
2 |
26 Feb 07 |
jari |
/** Returns the trim options as two strings. |
2 |
26 Feb 07 |
jari |
* The first string indicates the type of trim |
2 |
26 Feb 07 |
jari |
* NO_TRIM, N_TRIM, PERCENT_TRIM. The second string indicates the value to be applied. |
2 |
26 Feb 07 |
jari |
348 |
*/ |
2 |
26 Feb 07 |
jari |
349 |
public String [] getTrimOptions(){ |
2 |
26 Feb 07 |
jari |
350 |
String [] options = new String[2]; |
2 |
26 Feb 07 |
jari |
351 |
if ( alphaPanel.trimBox.isSelected() ){ |
2 |
26 Feb 07 |
jari |
352 |
if ( alphaPanel.trimPercentBox.isSelected() ){ |
2 |
26 Feb 07 |
jari |
353 |
options[0] = "PERCENT_TRIM"; |
2 |
26 Feb 07 |
jari |
354 |
options[1] = alphaPanel.trimPercentField.getText(); |
2 |
26 Feb 07 |
jari |
355 |
} else { |
2 |
26 Feb 07 |
jari |
356 |
options[0] = "N_TRIM"; |
2 |
26 Feb 07 |
jari |
357 |
options[1] = alphaPanel.trimNField.getText(); |
2 |
26 Feb 07 |
jari |
358 |
} |
2 |
26 Feb 07 |
jari |
359 |
} else { |
2 |
26 Feb 07 |
jari |
360 |
options[0] = "NO_TRIM"; |
2 |
26 Feb 07 |
jari |
361 |
options[1] = "0"; |
2 |
26 Feb 07 |
jari |
362 |
} |
2 |
26 Feb 07 |
jari |
363 |
return options; |
2 |
26 Feb 07 |
jari |
364 |
} |
2 |
26 Feb 07 |
jari |
365 |
|
2 |
26 Feb 07 |
jari |
/** Contains mode controls. (anal. or survey) |
2 |
26 Feb 07 |
jari |
367 |
*/ |
2 |
26 Feb 07 |
jari |
368 |
private class ModePanel extends JPanel { |
2 |
26 Feb 07 |
jari |
369 |
private JRadioButton clusterAnalysisButton; |
2 |
26 Feb 07 |
jari |
370 |
private JRadioButton slideSurveyButton; |
2 |
26 Feb 07 |
jari |
371 |
|
2 |
26 Feb 07 |
jari |
/** Constructs a mode panel. |
2 |
26 Feb 07 |
jari |
* @param haveClusters |
2 |
26 Feb 07 |
jari |
374 |
*/ |
2 |
26 Feb 07 |
jari |
375 |
public ModePanel(boolean haveClusters){ |
2 |
26 Feb 07 |
jari |
376 |
super(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
377 |
setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
378 |
setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
379 |
setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Mode Selection", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, font, Color.black)); |
2 |
26 Feb 07 |
jari |
380 |
|
2 |
26 Feb 07 |
jari |
381 |
ButtonGroup bg = new ButtonGroup(); |
2 |
26 Feb 07 |
jari |
382 |
clusterAnalysisButton = new JRadioButton("Cluster Analysis", haveClusters); |
2 |
26 Feb 07 |
jari |
383 |
clusterAnalysisButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
384 |
clusterAnalysisButton.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
385 |
clusterAnalysisButton.setHorizontalAlignment(JRadioButton.CENTER); |
2 |
26 Feb 07 |
jari |
386 |
clusterAnalysisButton.addActionListener(new ActionListener() { |
2 |
26 Feb 07 |
jari |
387 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
388 |
popPanel.setEnableControls(true); |
2 |
26 Feb 07 |
jari |
389 |
} |
2 |
26 Feb 07 |
jari |
390 |
}); |
2 |
26 Feb 07 |
jari |
391 |
bg.add(clusterAnalysisButton); |
2 |
26 Feb 07 |
jari |
392 |
|
2 |
26 Feb 07 |
jari |
393 |
slideSurveyButton = new JRadioButton("Annotation Survey"); |
2 |
26 Feb 07 |
jari |
394 |
slideSurveyButton.setToolTipText("Surveys annotation loaded in the CURRENT viewer."); |
2 |
26 Feb 07 |
jari |
395 |
slideSurveyButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
396 |
slideSurveyButton.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
397 |
slideSurveyButton.setHorizontalAlignment(JRadioButton.CENTER); |
2 |
26 Feb 07 |
jari |
398 |
slideSurveyButton.addActionListener(new ActionListener() { |
2 |
26 Feb 07 |
jari |
399 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
400 |
popPanel.setEnableControls(false); |
2 |
26 Feb 07 |
jari |
401 |
} |
2 |
26 Feb 07 |
jari |
402 |
}); |
2 |
26 Feb 07 |
jari |
403 |
bg.add(slideSurveyButton); |
2 |
26 Feb 07 |
jari |
404 |
|
2 |
26 Feb 07 |
jari |
405 |
if(!haveClusters){ |
2 |
26 Feb 07 |
jari |
406 |
slideSurveyButton.setSelected(true); |
2 |
26 Feb 07 |
jari |
407 |
clusterAnalysisButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
408 |
} |
2 |
26 Feb 07 |
jari |
409 |
|
2 |
26 Feb 07 |
jari |
410 |
add(clusterAnalysisButton, new GridBagConstraints(0,0,1,1,1.0,0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0), 0, 0)); |
2 |
26 Feb 07 |
jari |
411 |
add(slideSurveyButton, new GridBagConstraints(1,0,1,1,1.0,0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0), 0, 0)); |
2 |
26 Feb 07 |
jari |
412 |
} |
2 |
26 Feb 07 |
jari |
413 |
} |
2 |
26 Feb 07 |
jari |
414 |
|
2 |
26 Feb 07 |
jari |
415 |
private class PopSelectionPanel extends ParameterPanel { |
2 |
26 Feb 07 |
jari |
416 |
|
2 |
26 Feb 07 |
jari |
417 |
JRadioButton fileButton; |
2 |
26 Feb 07 |
jari |
418 |
JRadioButton dataButton; |
2 |
26 Feb 07 |
jari |
419 |
JTextField popField; |
2 |
26 Feb 07 |
jari |
420 |
JButton browseButton; |
2 |
26 Feb 07 |
jari |
421 |
JLabel fileLabel; |
2 |
26 Feb 07 |
jari |
422 |
|
2 |
26 Feb 07 |
jari |
423 |
public PopSelectionPanel() { |
2 |
26 Feb 07 |
jari |
424 |
super("Population Selection"); |
2 |
26 Feb 07 |
jari |
425 |
setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
426 |
|
2 |
26 Feb 07 |
jari |
427 |
ButtonGroup bg = new ButtonGroup(); |
2 |
26 Feb 07 |
jari |
428 |
fileButton = new JRadioButton("Population from File", true); |
2 |
26 Feb 07 |
jari |
429 |
fileButton.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
430 |
fileButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
431 |
bg.add(fileButton); |
2 |
26 Feb 07 |
jari |
432 |
|
2 |
26 Feb 07 |
jari |
433 |
fileButton.addActionListener(new ActionListener() { |
2 |
26 Feb 07 |
jari |
434 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
435 |
|
2 |
26 Feb 07 |
jari |
436 |
browseButton.setEnabled(fileButton.isSelected()); |
2 |
26 Feb 07 |
jari |
437 |
popField.setEnabled(fileButton.isSelected()); |
2 |
26 Feb 07 |
jari |
438 |
popField.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
439 |
fileLabel.setEnabled(fileButton.isSelected()); |
2 |
26 Feb 07 |
jari |
440 |
|
2 |
26 Feb 07 |
jari |
441 |
} |
2 |
26 Feb 07 |
jari |
442 |
}); |
2 |
26 Feb 07 |
jari |
443 |
|
2 |
26 Feb 07 |
jari |
444 |
dataButton = new JRadioButton("Population from Current Viewer"); |
2 |
26 Feb 07 |
jari |
445 |
dataButton.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
446 |
dataButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
447 |
bg.add(dataButton); |
2 |
26 Feb 07 |
jari |
448 |
dataButton.addActionListener(new ActionListener() { |
2 |
26 Feb 07 |
jari |
449 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
450 |
browseButton.setEnabled(fileButton.isSelected()); |
2 |
26 Feb 07 |
jari |
451 |
popField.setEnabled(fileButton.isSelected()); |
2 |
26 Feb 07 |
jari |
452 |
popField.setBackground(Color.lightGray); |
2 |
26 Feb 07 |
jari |
453 |
fileLabel.setEnabled(fileButton.isSelected()); |
2 |
26 Feb 07 |
jari |
454 |
|
2 |
26 Feb 07 |
jari |
455 |
} |
2 |
26 Feb 07 |
jari |
456 |
}); |
2 |
26 Feb 07 |
jari |
457 |
|
2 |
26 Feb 07 |
jari |
458 |
browseButton = new JButton("File Browser"); |
2 |
26 Feb 07 |
jari |
459 |
browseButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
460 |
browseButton.setPreferredSize(new Dimension(150, 25)); |
2 |
26 Feb 07 |
jari |
461 |
browseButton.setSize(150, 25); |
2 |
26 Feb 07 |
jari |
462 |
browseButton.addActionListener(new ActionListener() { |
2 |
26 Feb 07 |
jari |
463 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
464 |
JFileChooser chooser = new JFileChooser(TMEV.getFile("Data/")); |
2 |
26 Feb 07 |
jari |
465 |
chooser.setDialogTitle("Population File Selection"); |
2 |
26 Feb 07 |
jari |
466 |
chooser.setMultiSelectionEnabled(false); |
2 |
26 Feb 07 |
jari |
467 |
if(chooser.showOpenDialog(parent) == JOptionPane.OK_OPTION){ |
2 |
26 Feb 07 |
jari |
468 |
updatePopField(chooser.getSelectedFile().getPath()); |
2 |
26 Feb 07 |
jari |
469 |
} |
2 |
26 Feb 07 |
jari |
470 |
} |
2 |
26 Feb 07 |
jari |
471 |
}); |
2 |
26 Feb 07 |
jari |
472 |
|
2 |
26 Feb 07 |
jari |
473 |
fileLabel = new JLabel("File: "); |
2 |
26 Feb 07 |
jari |
474 |
popField = new JTextField(25); |
2 |
26 Feb 07 |
jari |
475 |
|
2 |
26 Feb 07 |
jari |
476 |
add(fileButton, new GridBagConstraints(0,0,3,1,1,0,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(10,30,0,0), 0,0)); |
2 |
26 Feb 07 |
jari |
477 |
add(fileLabel, new GridBagConstraints(0,1,1,1,0,0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5,30,0,0), 0,0)); |
2 |
26 Feb 07 |
jari |
478 |
add(popField, new GridBagConstraints(1,1,1,1,1,0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5,10,0,0), 0,0)); |
2 |
26 Feb 07 |
jari |
479 |
add(browseButton, new GridBagConstraints(2,1,1,1,0,0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5,25,0,20), 0,0)); |
2 |
26 Feb 07 |
jari |
480 |
|
2 |
26 Feb 07 |
jari |
481 |
add(dataButton, new GridBagConstraints(0,2,3,1,1,0,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(15,30,20,0), 0,0)); |
2 |
26 Feb 07 |
jari |
482 |
} |
2 |
26 Feb 07 |
jari |
483 |
|
2 |
26 Feb 07 |
jari |
484 |
private void setEnableControls(boolean enable) { |
2 |
26 Feb 07 |
jari |
485 |
fileButton.setEnabled(enable); |
2 |
26 Feb 07 |
jari |
486 |
dataButton.setEnabled(enable); |
2 |
26 Feb 07 |
jari |
487 |
popField.setEnabled(enable); |
2 |
26 Feb 07 |
jari |
488 |
browseButton.setEnabled(enable); |
2 |
26 Feb 07 |
jari |
489 |
fileLabel.setEnabled(enable); |
2 |
26 Feb 07 |
jari |
490 |
setOpaque(enable); |
2 |
26 Feb 07 |
jari |
491 |
tabbedPane.setEnabledAt(0, enable); |
2 |
26 Feb 07 |
jari |
492 |
} |
2 |
26 Feb 07 |
jari |
493 |
|
2 |
26 Feb 07 |
jari |
494 |
private void updatePopField(String file) { |
2 |
26 Feb 07 |
jari |
495 |
this.popField.setText(file); |
2 |
26 Feb 07 |
jari |
496 |
} |
2 |
26 Feb 07 |
jari |
497 |
|
2 |
26 Feb 07 |
jari |
498 |
private String getPopFile() { |
2 |
26 Feb 07 |
jari |
499 |
return popField.getText(); |
2 |
26 Feb 07 |
jari |
500 |
} |
2 |
26 Feb 07 |
jari |
501 |
} |
2 |
26 Feb 07 |
jari |
502 |
|
2 |
26 Feb 07 |
jari |
503 |
|
2 |
26 Feb 07 |
jari |
504 |
|
2 |
26 Feb 07 |
jari |
/** Contains annotation parameter controls. |
2 |
26 Feb 07 |
jari |
506 |
*/ |
2 |
26 Feb 07 |
jari |
507 |
private class EaseParameterPanel extends JPanel { |
2 |
26 Feb 07 |
jari |
508 |
|
2 |
26 Feb 07 |
jari |
509 |
JTextField converterFileField; |
2 |
26 Feb 07 |
jari |
510 |
JList fileList; |
2 |
26 Feb 07 |
jari |
511 |
JButton browserButton; |
2 |
26 Feb 07 |
jari |
512 |
JTextField minClusterSizeField; |
2 |
26 Feb 07 |
jari |
513 |
JComboBox fieldNamesBox; |
2 |
26 Feb 07 |
jari |
514 |
|
2 |
26 Feb 07 |
jari |
515 |
JList annFileList; |
2 |
26 Feb 07 |
jari |
516 |
Vector annVector; |
2 |
26 Feb 07 |
jari |
517 |
JButton removeButton; |
2 |
26 Feb 07 |
jari |
518 |
JCheckBox useAnnBox; |
2 |
26 Feb 07 |
jari |
519 |
JLabel fileLabel; |
2 |
26 Feb 07 |
jari |
520 |
|
2 |
26 Feb 07 |
jari |
/** Constructs a new EaseParameterPanel |
2 |
26 Feb 07 |
jari |
* @param fieldNames annotation types |
2 |
26 Feb 07 |
jari |
523 |
*/ |
2 |
26 Feb 07 |
jari |
524 |
public EaseParameterPanel(String [] fieldNames) { |
2 |
26 Feb 07 |
jari |
//Conversion File Panel |
2 |
26 Feb 07 |
jari |
526 |
JPanel convPanel = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
527 |
convPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
528 |
convPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Annotation Conversion File", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, font, Color.black)); |
2 |
26 Feb 07 |
jari |
529 |
useAnnBox = new JCheckBox("use annotation converter", false); |
2 |
26 Feb 07 |
jari |
530 |
useAnnBox.setActionCommand("use-converter-command"); |
2 |
26 Feb 07 |
jari |
531 |
useAnnBox.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
532 |
useAnnBox.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
533 |
useAnnBox.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
534 |
|
2 |
26 Feb 07 |
jari |
535 |
converterFileField = new JTextField(30); |
2 |
26 Feb 07 |
jari |
536 |
converterFileField.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.lightGray, Color.gray)); |
2 |
26 Feb 07 |
jari |
537 |
converterFileField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
538 |
converterFileField.setBackground(Color.lightGray); |
2 |
26 Feb 07 |
jari |
539 |
|
2 |
26 Feb 07 |
jari |
540 |
browserButton = new JButton("File Browser"); |
2 |
26 Feb 07 |
jari |
541 |
browserButton.setActionCommand("converter-file-browser-command"); |
2 |
26 Feb 07 |
jari |
542 |
browserButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
543 |
browserButton.setPreferredSize(new Dimension(150, 25)); |
2 |
26 Feb 07 |
jari |
544 |
browserButton.setSize(150, 25); |
2 |
26 Feb 07 |
jari |
545 |
browserButton.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
546 |
browserButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
547 |
|
2 |
26 Feb 07 |
jari |
548 |
fileLabel = new JLabel("File :"); |
2 |
26 Feb 07 |
jari |
549 |
fileLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
550 |
convPanel.add(useAnnBox, new GridBagConstraints(0,0,3,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.BOTH,new Insets(0,15,15,0),0,0)); |
2 |
26 Feb 07 |
jari |
551 |
convPanel.add(fileLabel, new GridBagConstraints(0,1,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,15,15,0),0,0)); |
2 |
26 Feb 07 |
jari |
552 |
convPanel.add(this.browserButton, new GridBagConstraints(0,2,3,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.VERTICAL,new Insets(0,15,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
553 |
convPanel.add(this.converterFileField, new GridBagConstraints(1,1,2,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,15,15,0),0,0)); |
2 |
26 Feb 07 |
jari |
554 |
|
2 |
26 Feb 07 |
jari |
//Annotation file panel |
2 |
26 Feb 07 |
jari |
556 |
JPanel annPanel = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
557 |
annPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
558 |
annPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Gene Annotation / Gene Ontology Linking Files", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, font, Color.black)); |
2 |
26 Feb 07 |
jari |
559 |
|
2 |
26 Feb 07 |
jari |
560 |
annVector = new Vector(); |
2 |
26 Feb 07 |
jari |
561 |
annFileList = new JList(new DefaultListModel()); |
2 |
26 Feb 07 |
jari |
562 |
annFileList.setCellRenderer(new ListRenderer()); |
2 |
26 Feb 07 |
jari |
563 |
annFileList.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); |
2 |
26 Feb 07 |
jari |
564 |
JScrollPane annPane = new JScrollPane(annFileList); |
2 |
26 Feb 07 |
jari |
565 |
|
2 |
26 Feb 07 |
jari |
566 |
JButton annButton = new JButton("Add Files"); |
2 |
26 Feb 07 |
jari |
567 |
annButton.setActionCommand("ann-file-browser-command"); |
2 |
26 Feb 07 |
jari |
568 |
annButton.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
569 |
annButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
570 |
annButton.setPreferredSize(new Dimension(150, 25)); |
2 |
26 Feb 07 |
jari |
571 |
annButton.setSize(150, 25); |
2 |
26 Feb 07 |
jari |
572 |
|
2 |
26 Feb 07 |
jari |
573 |
removeButton = new JButton("Remove Selected"); |
2 |
26 Feb 07 |
jari |
574 |
removeButton.setActionCommand("remove-ann-file-command"); |
2 |
26 Feb 07 |
jari |
575 |
removeButton.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
576 |
removeButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
577 |
removeButton.setPreferredSize(new Dimension(150, 25)); |
2 |
26 Feb 07 |
jari |
578 |
removeButton.setSize(150, 25); |
2 |
26 Feb 07 |
jari |
579 |
removeButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
580 |
|
2 |
26 Feb 07 |
jari |
581 |
JPanel fillPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
582 |
fillPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
583 |
annPanel.add(fillPanel, new GridBagConstraints(0,0,1,1,0.0,0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0), 0,0)); |
2 |
26 Feb 07 |
jari |
584 |
annPanel.add(annButton, new GridBagConstraints(1,0,1,1,0.0,0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0,0,10,5), 0,0)); |
2 |
26 Feb 07 |
jari |
585 |
annPanel.add(removeButton, new GridBagConstraints(2,0,1,1,0.0,0.0, GridBagConstraints.CENTER, GridBagConstraints.VERTICAL, new Insets(0,5,10,0), 0,0)); |
2 |
26 Feb 07 |
jari |
586 |
annPanel.add(new JLabel("Files: "), new GridBagConstraints(0,1,1,1,0.0,0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0,0,0,0), 0,0)); |
2 |
26 Feb 07 |
jari |
587 |
annPanel.add(annPane, new GridBagConstraints(1,1,2,1,0.0,1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0), 0,0)); |
2 |
26 Feb 07 |
jari |
588 |
|
2 |
26 Feb 07 |
jari |
589 |
sep = System.getProperty("file.separator"); |
2 |
26 Feb 07 |
jari |
590 |
File file = new File(getBaseFileLocation()+"/Data/Convert/"); |
2 |
26 Feb 07 |
jari |
591 |
String tempPath = file.getPath(); |
2 |
26 Feb 07 |
jari |
592 |
Vector fileVector = new Vector(); |
2 |
26 Feb 07 |
jari |
593 |
fileList = new JList(fileVector); |
2 |
26 Feb 07 |
jari |
594 |
if(file.exists()){ |
2 |
26 Feb 07 |
jari |
595 |
String [] listFileNames = file.list(); |
2 |
26 Feb 07 |
jari |
596 |
for(int i = 0; i < listFileNames.length; i++){ |
2 |
26 Feb 07 |
jari |
597 |
File tempFile = new File(tempPath+sep+listFileNames[i]); |
2 |
26 Feb 07 |
jari |
598 |
if(tempFile.isFile()) |
2 |
26 Feb 07 |
jari |
599 |
fileVector.add(listFileNames[i]); |
2 |
26 Feb 07 |
jari |
600 |
} |
2 |
26 Feb 07 |
jari |
601 |
if(fileVector.size() > 0){ |
2 |
26 Feb 07 |
jari |
602 |
converterFileField.setText(tempPath+sep+((String)fileVector.elementAt(0))); |
2 |
26 Feb 07 |
jari |
603 |
} |
2 |
26 Feb 07 |
jari |
604 |
} |
2 |
26 Feb 07 |
jari |
605 |
|
2 |
26 Feb 07 |
jari |
606 |
this.fieldNamesBox = new JComboBox(fieldNames); |
2 |
26 Feb 07 |
jari |
607 |
this.fieldNamesBox.setEditable(false); |
2 |
26 Feb 07 |
jari |
608 |
|
2 |
26 Feb 07 |
jari |
609 |
minClusterSizeField = new JTextField(5); |
2 |
26 Feb 07 |
jari |
610 |
minClusterSizeField.setText("5"); |
2 |
26 Feb 07 |
jari |
611 |
|
2 |
26 Feb 07 |
jari |
612 |
JPanel contentPanel = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
613 |
|
2 |
26 Feb 07 |
jari |
614 |
JPanel easeFilePanel = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
615 |
|
2 |
26 Feb 07 |
jari |
616 |
this.setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
617 |
|
2 |
26 Feb 07 |
jari |
618 |
JPanel annotKeyPanel = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
619 |
annotKeyPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
620 |
annotKeyPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "MeV Annotation Key (\"Unique ID\")", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, font, Color.black)); |
2 |
26 Feb 07 |
jari |
621 |
|
2 |
26 Feb 07 |
jari |
622 |
annotKeyPanel.add(new JLabel("Annotation Key: "), new GridBagConstraints(0,0,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
623 |
annotKeyPanel.add(this.fieldNamesBox, new GridBagConstraints(1,0,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
624 |
|
2 |
26 Feb 07 |
jari |
625 |
this.add(annotKeyPanel, new GridBagConstraints(0,0,1,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
626 |
this.add(convPanel, new GridBagConstraints(0,1,1,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
627 |
this.add(annPanel, new GridBagConstraints(0,2,1,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
628 |
} |
2 |
26 Feb 07 |
jari |
629 |
|
2 |
26 Feb 07 |
jari |
630 |
private void updateFileDirectoryField(){ |
2 |
26 Feb 07 |
jari |
631 |
|
2 |
26 Feb 07 |
jari |
632 |
File file = new File((String)this.fileList.getSelectedValue()); |
2 |
26 Feb 07 |
jari |
633 |
if(file == null) |
2 |
26 Feb 07 |
jari |
634 |
return; |
2 |
26 Feb 07 |
jari |
635 |
|
2 |
26 Feb 07 |
jari |
636 |
String tempPath = file.getParent(); |
2 |
26 Feb 07 |
jari |
637 |
int fileIndex = this.fileList.getSelectedIndex(); |
2 |
26 Feb 07 |
jari |
638 |
String fileName = (String)(this.fileList.getModel().getElementAt(this.fileList.getSelectedIndex())); |
2 |
26 Feb 07 |
jari |
639 |
this.converterFileField.setText(tempPath+sep+fileName); |
2 |
26 Feb 07 |
jari |
640 |
} |
2 |
26 Feb 07 |
jari |
641 |
|
2 |
26 Feb 07 |
jari |
642 |
private void updateAnnFileList(File [] files){ |
2 |
26 Feb 07 |
jari |
643 |
File file; |
2 |
26 Feb 07 |
jari |
644 |
for(int i = 0; i < files.length; i++){ |
2 |
26 Feb 07 |
jari |
645 |
file = files[i]; |
2 |
26 Feb 07 |
jari |
646 |
if(!((DefaultListModel) annFileList.getModel()).contains(file)){ |
2 |
26 Feb 07 |
jari |
647 |
((DefaultListModel) annFileList.getModel()).addElement(file); |
2 |
26 Feb 07 |
jari |
648 |
} |
2 |
26 Feb 07 |
jari |
649 |
} |
2 |
26 Feb 07 |
jari |
650 |
annFileList.validate(); |
2 |
26 Feb 07 |
jari |
651 |
} |
2 |
26 Feb 07 |
jari |
652 |
|
2 |
26 Feb 07 |
jari |
/** Returns the converter file name (or null if none) |
2 |
26 Feb 07 |
jari |
654 |
*/ |
2 |
26 Feb 07 |
jari |
655 |
public String getConverterFileName(){ |
2 |
26 Feb 07 |
jari |
656 |
if(this.useAnnBox.isSelected()) |
2 |
26 Feb 07 |
jari |
657 |
return converterFileField.getText(); |
2 |
26 Feb 07 |
jari |
658 |
return null; |
2 |
26 Feb 07 |
jari |
659 |
} |
2 |
26 Feb 07 |
jari |
660 |
|
2 |
26 Feb 07 |
jari |
/** Returns the annotation type string. |
2 |
26 Feb 07 |
jari |
662 |
*/ |
2 |
26 Feb 07 |
jari |
663 |
public String getAnnotationKeyType(){ |
2 |
26 Feb 07 |
jari |
664 |
return (String)this.fieldNamesBox.getSelectedItem(); |
2 |
26 Feb 07 |
jari |
665 |
} |
2 |
26 Feb 07 |
jari |
666 |
|
2 |
26 Feb 07 |
jari |
667 |
private class EaseListListener implements ListSelectionListener { |
2 |
26 Feb 07 |
jari |
668 |
public void valueChanged(ListSelectionEvent listSelectionEvent) { |
2 |
26 Feb 07 |
jari |
669 |
updateFileDirectoryField(); |
2 |
26 Feb 07 |
jari |
670 |
} |
2 |
26 Feb 07 |
jari |
671 |
} |
2 |
26 Feb 07 |
jari |
672 |
|
2 |
26 Feb 07 |
jari |
673 |
private void updateConverterFileField(String field){ |
2 |
26 Feb 07 |
jari |
674 |
this.converterFileField.setText(field); |
2 |
26 Feb 07 |
jari |
675 |
} |
2 |
26 Feb 07 |
jari |
676 |
|
2 |
26 Feb 07 |
jari |
/** Returns the list of annotation-theme mapping files. |
2 |
26 Feb 07 |
jari |
678 |
*/ |
2 |
26 Feb 07 |
jari |
679 |
public String [] getAnnToGOFileList(){ |
2 |
26 Feb 07 |
jari |
680 |
String [] fileNames = new String[((DefaultListModel) annFileList.getModel()).size()]; |
2 |
26 Feb 07 |
jari |
681 |
for(int i = 0; i < fileNames.length; i++){ |
2 |
26 Feb 07 |
jari |
682 |
fileNames[i] = ((File)(((DefaultListModel)annFileList.getModel()).elementAt(i))).getPath(); |
2 |
26 Feb 07 |
jari |
683 |
} |
2 |
26 Feb 07 |
jari |
684 |
return fileNames; |
2 |
26 Feb 07 |
jari |
685 |
} |
2 |
26 Feb 07 |
jari |
686 |
|
2 |
26 Feb 07 |
jari |
687 |
public void removeSelectedFiles(){ |
2 |
26 Feb 07 |
jari |
688 |
int [] indices = annFileList.getSelectedIndices(); |
2 |
26 Feb 07 |
jari |
689 |
|
2 |
26 Feb 07 |
jari |
690 |
for(int i = 0; i < indices.length; i++){ |
2 |
26 Feb 07 |
jari |
// annFileList.remove(indices[i]); |
2 |
26 Feb 07 |
jari |
692 |
((DefaultListModel)annFileList.getModel()).removeElementAt(indices[i]); |
2 |
26 Feb 07 |
jari |
693 |
} |
2 |
26 Feb 07 |
jari |
694 |
if(annFileList.getModel().getSize() < 1){ |
2 |
26 Feb 07 |
jari |
695 |
this.removeButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
696 |
okButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
697 |
} |
2 |
26 Feb 07 |
jari |
698 |
annFileList.validate(); |
2 |
26 Feb 07 |
jari |
699 |
} |
2 |
26 Feb 07 |
jari |
700 |
|
2 |
26 Feb 07 |
jari |
701 |
private class ListRenderer extends DefaultListCellRenderer { |
2 |
26 Feb 07 |
jari |
702 |
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
2 |
26 Feb 07 |
jari |
703 |
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
2 |
26 Feb 07 |
jari |
704 |
File file = (File) value; |
2 |
26 Feb 07 |
jari |
705 |
setText(file.getName()); |
2 |
26 Feb 07 |
jari |
706 |
return this; |
2 |
26 Feb 07 |
jari |
707 |
} |
2 |
26 Feb 07 |
jari |
708 |
} |
2 |
26 Feb 07 |
jari |
709 |
} |
2 |
26 Feb 07 |
jari |
710 |
|
2 |
26 Feb 07 |
jari |
/** Contains statistical parameter controls. |
2 |
26 Feb 07 |
jari |
712 |
*/ |
2 |
26 Feb 07 |
jari |
713 |
private class AlphaPanel extends JPanel{ |
2 |
26 Feb 07 |
jari |
714 |
|
2 |
26 Feb 07 |
jari |
//Stats |
2 |
26 Feb 07 |
jari |
716 |
private JCheckBox fisherBox; |
2 |
26 Feb 07 |
jari |
717 |
private JCheckBox easeBox; |
2 |
26 Feb 07 |
jari |
//mult. corrections |
2 |
26 Feb 07 |
jari |
719 |
private JCheckBox bonferroniBox; |
2 |
26 Feb 07 |
jari |
720 |
private JCheckBox sidakBox; |
2 |
26 Feb 07 |
jari |
721 |
private JCheckBox bonferroniStepBox; |
2 |
26 Feb 07 |
jari |
722 |
private JCheckBox permBox; |
2 |
26 Feb 07 |
jari |
723 |
private JTextField permField; |
2 |
26 Feb 07 |
jari |
724 |
private JLabel permLabel; |
2 |
26 Feb 07 |
jari |
//Trim params |
2 |
26 Feb 07 |
jari |
726 |
private JCheckBox trimBox; |
2 |
26 Feb 07 |
jari |
727 |
private JCheckBox trimNBox; |
2 |
26 Feb 07 |
jari |
728 |
private JLabel trimNLabel; |
2 |
26 Feb 07 |
jari |
729 |
private JTextField trimNField; |
2 |
26 Feb 07 |
jari |
730 |
private JCheckBox trimPercentBox; |
2 |
26 Feb 07 |
jari |
731 |
private JLabel trimPercentLabel; |
2 |
26 Feb 07 |
jari |
732 |
private JTextField trimPercentField; |
2 |
26 Feb 07 |
jari |
733 |
|
2 |
26 Feb 07 |
jari |
734 |
|
2 |
26 Feb 07 |
jari |
/** Constucts a new AlphaPanel. |
2 |
26 Feb 07 |
jari |
736 |
*/ |
2 |
26 Feb 07 |
jari |
737 |
public AlphaPanel(){ |
2 |
26 Feb 07 |
jari |
738 |
super(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
739 |
setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
740 |
|
2 |
26 Feb 07 |
jari |
//STAT PANEL |
2 |
26 Feb 07 |
jari |
742 |
JPanel statPanel = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
743 |
statPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
744 |
statPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Reported Statistic", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, font, Color.black)); |
2 |
26 Feb 07 |
jari |
745 |
|
2 |
26 Feb 07 |
jari |
746 |
ButtonGroup bg = new ButtonGroup(); |
2 |
26 Feb 07 |
jari |
747 |
fisherBox = new JCheckBox("Fisher Exact Probability", true); |
2 |
26 Feb 07 |
jari |
748 |
fisherBox.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
749 |
fisherBox.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
750 |
bg.add(fisherBox); |
2 |
26 Feb 07 |
jari |
751 |
|
2 |
26 Feb 07 |
jari |
752 |
easeBox = new JCheckBox("EASE Score", false); |
2 |
26 Feb 07 |
jari |
753 |
easeBox.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
754 |
easeBox.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
755 |
bg.add(easeBox); |
2 |
26 Feb 07 |
jari |
756 |
|
2 |
26 Feb 07 |
jari |
757 |
statPanel.add(fisherBox, new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
758 |
statPanel.add(easeBox, new GridBagConstraints(0,1,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,10,0),0,0)); |
2 |
26 Feb 07 |
jari |
759 |
|
2 |
26 Feb 07 |
jari |
760 |
|
2 |
26 Feb 07 |
jari |
//P-value Correction Panel |
2 |
26 Feb 07 |
jari |
762 |
JPanel correctionPanel = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
763 |
correctionPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
764 |
correctionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Multiplicity Corrections", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, font, Color.black)); |
2 |
26 Feb 07 |
jari |
765 |
|
2 |
26 Feb 07 |
jari |
766 |
bonferroniBox = new JCheckBox("Bonferroni Correction", false); |
2 |
26 Feb 07 |
jari |
767 |
bonferroniBox.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
768 |
bonferroniBox.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
769 |
|
2 |
26 Feb 07 |
jari |
770 |
bonferroniStepBox = new JCheckBox("Bonferroni Step Down Correction", false); |
2 |
26 Feb 07 |
jari |
771 |
bonferroniStepBox.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
772 |
bonferroniStepBox.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
773 |
|
2 |
26 Feb 07 |
jari |
774 |
sidakBox = new JCheckBox("Sidak Method", false); |
2 |
26 Feb 07 |
jari |
775 |
sidakBox.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
776 |
sidakBox.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
777 |
|
2 |
26 Feb 07 |
jari |
778 |
permBox = new JCheckBox("Resampling Probability Analysis", false); |
2 |
26 Feb 07 |
jari |
779 |
permBox.setActionCommand("permutation-analysis-command"); |
2 |
26 Feb 07 |
jari |
780 |
permBox.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
781 |
permBox.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
782 |
permBox.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
//permBox.setEnabled(false); |
2 |
26 Feb 07 |
jari |
784 |
|
2 |
26 Feb 07 |
jari |
785 |
permField = new JTextField("1000", 10); |
2 |
26 Feb 07 |
jari |
786 |
permField.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
//permField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
788 |
|
2 |
26 Feb 07 |
jari |
789 |
permLabel = new JLabel("Number of Permutations"); |
2 |
26 Feb 07 |
jari |
790 |
permLabel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
//permLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
792 |
|
2 |
26 Feb 07 |
jari |
793 |
correctionPanel.add(bonferroniBox, new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.WEST,GridBagConstraints.BOTH, new Insets(10,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
794 |
correctionPanel.add(sidakBox, new GridBagConstraints(1,0,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(10,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
795 |
correctionPanel.add(bonferroniStepBox, new GridBagConstraints(0,1,2,1,0,0,GridBagConstraints.WEST,GridBagConstraints.BOTH, new Insets(0,0,10,0),0,0)); |
2 |
26 Feb 07 |
jari |
796 |
correctionPanel.add(permBox, new GridBagConstraints(0,2,2,1,0,0,GridBagConstraints.WEST,GridBagConstraints.BOTH, new Insets(0,0,5,0),0,0)); |
2 |
26 Feb 07 |
jari |
797 |
correctionPanel.add(permLabel, new GridBagConstraints(0,3,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,15,0),0,0)); |
2 |
26 Feb 07 |
jari |
798 |
correctionPanel.add(permField, new GridBagConstraints(1,3,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.VERTICAL, new Insets(0,0,15,0),0,0)); |
2 |
26 Feb 07 |
jari |
799 |
|
2 |
26 Feb 07 |
jari |
//Trim Panel |
2 |
26 Feb 07 |
jari |
801 |
JPanel trimPanel = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
802 |
trimPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
803 |
trimPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Trim Parameters", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, font, Color.black)); |
2 |
26 Feb 07 |
jari |
804 |
|
2 |
26 Feb 07 |
jari |
805 |
trimBox = new JCheckBox("Trim Resulting Groups", false); |
2 |
26 Feb 07 |
jari |
806 |
trimBox.setActionCommand("trim-result-command"); |
2 |
26 Feb 07 |
jari |
807 |
trimBox.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
808 |
trimBox.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
809 |
trimBox.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); |
2 |
26 Feb 07 |
jari |
810 |
trimBox.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
811 |
|
2 |
26 Feb 07 |
jari |
812 |
bg = new ButtonGroup(); |
2 |
26 Feb 07 |
jari |
813 |
|
2 |
26 Feb 07 |
jari |
814 |
trimNBox = new JCheckBox("Select Minimum Hit Number", true); |
2 |
26 Feb 07 |
jari |
815 |
trimNBox.setActionCommand("trim-result-command"); |
2 |
26 Feb 07 |
jari |
816 |
trimNBox.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
817 |
trimNBox.setEnabled(false); |
2 |
26 Feb 07 |
jari |
818 |
trimNBox.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
819 |
trimNBox.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
820 |
bg.add(trimNBox); |
2 |
26 Feb 07 |
jari |
821 |
|
2 |
26 Feb 07 |
jari |
822 |
trimNLabel = new JLabel("Min. Hits"); |
2 |
26 Feb 07 |
jari |
823 |
trimNLabel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
824 |
trimNLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
825 |
|
2 |
26 Feb 07 |
jari |
826 |
trimNField = new JTextField("5", 10); |
2 |
26 Feb 07 |
jari |
827 |
trimNField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
828 |
|
2 |
26 Feb 07 |
jari |
829 |
trimPercentBox = new JCheckBox("Select Minimum Hit Percentage", false); |
2 |
26 Feb 07 |
jari |
830 |
trimPercentBox.setActionCommand("trim-result-command"); |
2 |
26 Feb 07 |
jari |
831 |
trimPercentBox.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
832 |
trimPercentBox.setEnabled(false); |
2 |
26 Feb 07 |
jari |
833 |
trimPercentBox.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
834 |
trimPercentBox.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
835 |
bg.add(trimPercentBox); |
2 |
26 Feb 07 |
jari |
836 |
|
2 |
26 Feb 07 |
jari |
837 |
trimPercentLabel = new JLabel("Percent Hits"); |
2 |
26 Feb 07 |
jari |
838 |
trimPercentLabel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
839 |
trimPercentLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
840 |
|
2 |
26 Feb 07 |
jari |
841 |
trimPercentField = new JTextField("5", 10); |
2 |
26 Feb 07 |
jari |
842 |
trimPercentField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
843 |
|
2 |
26 Feb 07 |
jari |
844 |
trimPanel.add(trimBox, new GridBagConstraints(0,0,3,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,20,0),0,0)); |
2 |
26 Feb 07 |
jari |
845 |
|
2 |
26 Feb 07 |
jari |
846 |
trimPanel.add(trimNBox, new GridBagConstraints(0,1,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
847 |
trimPanel.add(trimNLabel, new GridBagConstraints(1,1,1,1,0,0,GridBagConstraints.EAST,GridBagConstraints.BOTH, new Insets(0,20,0,15),0,0)); |
2 |
26 Feb 07 |
jari |
848 |
trimPanel.add(trimNField, new GridBagConstraints(2,1,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.NONE, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
849 |
|
2 |
26 Feb 07 |
jari |
850 |
trimPanel.add(trimPercentBox, new GridBagConstraints(0,2,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(10,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
851 |
trimPanel.add(trimPercentLabel, new GridBagConstraints(1,2,1,1,0,0,GridBagConstraints.EAST,GridBagConstraints.BOTH, new Insets(10,20,0,15),0,0)); |
2 |
26 Feb 07 |
jari |
852 |
trimPanel.add(trimPercentField, new GridBagConstraints(2,2,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.NONE, new Insets(10,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
853 |
|
2 |
26 Feb 07 |
jari |
//Add panels to main panel |
2 |
26 Feb 07 |
jari |
855 |
add(statPanel, new GridBagConstraints(0,0,1,1,1.0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
856 |
add(correctionPanel, new GridBagConstraints(0,1,1,1,1.0,0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
857 |
add(trimPanel, new GridBagConstraints(0,2,1,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
858 |
} |
2 |
26 Feb 07 |
jari |
859 |
|
2 |
26 Feb 07 |
jari |
/** Indicates if permutations are selected. |
2 |
26 Feb 07 |
jari |
861 |
*/ |
2 |
26 Feb 07 |
jari |
862 |
public boolean performPermutations(){ |
2 |
26 Feb 07 |
jari |
863 |
return permBox.isSelected(); |
2 |
26 Feb 07 |
jari |
864 |
} |
2 |
26 Feb 07 |
jari |
865 |
|
2 |
26 Feb 07 |
jari |
866 |
public void setEnablePermutations(){ |
2 |
26 Feb 07 |
jari |
867 |
permLabel.setEnabled(permBox.isSelected()); |
2 |
26 Feb 07 |
jari |
868 |
permField.setEnabled(permBox.isSelected()); |
2 |
26 Feb 07 |
jari |
869 |
} |
2 |
26 Feb 07 |
jari |
870 |
|
2 |
26 Feb 07 |
jari |
871 |
public void validateTrimOptions(){ |
2 |
26 Feb 07 |
jari |
872 |
if(this.trimBox.isSelected()){ |
2 |
26 Feb 07 |
jari |
873 |
trimNBox.setEnabled(true); |
2 |
26 Feb 07 |
jari |
874 |
trimPercentBox.setEnabled(true); |
2 |
26 Feb 07 |
jari |
875 |
|
2 |
26 Feb 07 |
jari |
876 |
trimNLabel.setEnabled(trimNBox.isSelected()); |
2 |
26 Feb 07 |
jari |
877 |
trimNField.setEnabled(trimNBox.isSelected()); |
2 |
26 Feb 07 |
jari |
878 |
trimPercentLabel.setEnabled(!trimNBox.isSelected()); |
2 |
26 Feb 07 |
jari |
879 |
trimPercentField.setEnabled(!trimNBox.isSelected()); |
2 |
26 Feb 07 |
jari |
880 |
} else { |
2 |
26 Feb 07 |
jari |
881 |
trimNBox.setEnabled(false); |
2 |
26 Feb 07 |
jari |
882 |
trimPercentBox.setEnabled(false); |
2 |
26 Feb 07 |
jari |
883 |
|
2 |
26 Feb 07 |
jari |
884 |
trimNLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
885 |
trimNField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
886 |
trimPercentLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
887 |
trimPercentField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
888 |
} |
2 |
26 Feb 07 |
jari |
889 |
} |
2 |
26 Feb 07 |
jari |
890 |
} |
2 |
26 Feb 07 |
jari |
891 |
|
2 |
26 Feb 07 |
jari |
892 |
private class ConfigPanel extends ParameterPanel { |
2 |
26 Feb 07 |
jari |
893 |
|
2 |
26 Feb 07 |
jari |
894 |
JTextField defaultFileBaseLocation; |
2 |
26 Feb 07 |
jari |
895 |
|
2 |
26 Feb 07 |
jari |
896 |
public ConfigPanel() { |
2 |
26 Feb 07 |
jari |
897 |
super("File Updates and Configuration"); |
2 |
26 Feb 07 |
jari |
898 |
setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
899 |
|
2 |
26 Feb 07 |
jari |
900 |
JButton updateFilesButton = new JButton("Update EASE File System"); |
2 |
26 Feb 07 |
jari |
901 |
updateFilesButton.setActionCommand("update-files-command"); |
2 |
26 Feb 07 |
jari |
902 |
updateFilesButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
903 |
updateFilesButton.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
904 |
updateFilesButton.setToolTipText("<html>Downloads EASE annotation files<br>for a selected species and array type.</html>"); |
2 |
26 Feb 07 |
jari |
905 |
JButton browseFileBaseButton = new JButton("Select EASE File System"); |
2 |
26 Feb 07 |
jari |
906 |
browseFileBaseButton.setActionCommand("select-file-base-command"); |
2 |
26 Feb 07 |
jari |
907 |
browseFileBaseButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
908 |
browseFileBaseButton.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
909 |
browseFileBaseButton.setToolTipText("<html>Helps select the EASE annotation file system<br>that corresponds the current species and array type.</html>"); |
2 |
26 Feb 07 |
jari |
910 |
defaultFileBaseLocation = new JTextField(TMEV.getFile("data/ease").getAbsolutePath(), 25); |
2 |
26 Feb 07 |
jari |
911 |
defaultFileBaseLocation.setEditable(true); |
2 |
26 Feb 07 |
jari |
912 |
|
2 |
26 Feb 07 |
jari |
913 |
add(browseFileBaseButton, new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5,0,5,0), 0, 0)); |
2 |
26 Feb 07 |
jari |
914 |
add(defaultFileBaseLocation, new GridBagConstraints(1,0,1,1,1,0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5,5,5,0), 0, 0)); |
2 |
26 Feb 07 |
jari |
915 |
add(updateFilesButton, new GridBagConstraints(0,1,1,1,0,0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,5,0), 0, 0)); |
2 |
26 Feb 07 |
jari |
916 |
} |
2 |
26 Feb 07 |
jari |
917 |
|
2 |
26 Feb 07 |
jari |
918 |
public void selectFileSystem() { |
2 |
26 Feb 07 |
jari |
919 |
String startDir = defaultFileBaseLocation.getText(); |
2 |
26 Feb 07 |
jari |
920 |
File file = new File(startDir); |
2 |
26 Feb 07 |
jari |
921 |
if(!file.exists()) { |
2 |
26 Feb 07 |
jari |
922 |
file = TMEV.getFile("data/ease"); |
2 |
26 Feb 07 |
jari |
923 |
if(file == null) { |
2 |
26 Feb 07 |
jari |
924 |
file = new File(System.getProperty("user.dir")); |
2 |
26 Feb 07 |
jari |
925 |
} |
2 |
26 Feb 07 |
jari |
926 |
} |
2 |
26 Feb 07 |
jari |
927 |
JFileChooser chooser = new JFileChooser(file); |
2 |
26 Feb 07 |
jari |
928 |
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); |
2 |
26 Feb 07 |
jari |
929 |
if(chooser.showOpenDialog(EASEInitDialog.this) == JOptionPane.OK_OPTION) { |
2 |
26 Feb 07 |
jari |
930 |
defaultFileBaseLocation.setText(chooser.getSelectedFile().getAbsolutePath()); |
2 |
26 Feb 07 |
jari |
931 |
} |
2 |
26 Feb 07 |
jari |
932 |
} |
2 |
26 Feb 07 |
jari |
933 |
|
2 |
26 Feb 07 |
jari |
934 |
public String getBaseFileLocation() { |
2 |
26 Feb 07 |
jari |
935 |
return defaultFileBaseLocation.getText(); |
2 |
26 Feb 07 |
jari |
936 |
} |
2 |
26 Feb 07 |
jari |
937 |
} |
2 |
26 Feb 07 |
jari |
938 |
|
2 |
26 Feb 07 |
jari |
939 |
/** |
2 |
26 Feb 07 |
jari |
* The class to listen to the dialog and check boxes items events. |
2 |
26 Feb 07 |
jari |
941 |
*/ |
2 |
26 Feb 07 |
jari |
942 |
private class EventListener extends DialogListener implements ItemListener { |
2 |
26 Feb 07 |
jari |
943 |
|
2 |
26 Feb 07 |
jari |
944 |
public void actionPerformed(ActionEvent e) { |
2 |
26 Feb 07 |
jari |
945 |
String command = e.getActionCommand(); |
2 |
26 Feb 07 |
jari |
946 |
if (command.equals("use-converter-command")) { |
2 |
26 Feb 07 |
jari |
947 |
if(easeParamPanel.useAnnBox.isSelected()){ |
2 |
26 Feb 07 |
jari |
948 |
easeParamPanel.browserButton.setEnabled(true); |
2 |
26 Feb 07 |
jari |
949 |
easeParamPanel.converterFileField.setEnabled(true); |
2 |
26 Feb 07 |
jari |
950 |
easeParamPanel.converterFileField.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
951 |
easeParamPanel.fileLabel.setEnabled(true); |
2 |
26 Feb 07 |
jari |
952 |
} else { |
2 |
26 Feb 07 |
jari |
953 |
easeParamPanel.browserButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
954 |
easeParamPanel.converterFileField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
955 |
easeParamPanel.converterFileField.setBackground(Color.lightGray); |
2 |
26 Feb 07 |
jari |
956 |
easeParamPanel.fileLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
957 |
} |
2 |
26 Feb 07 |
jari |
958 |
} else if (command.equals("converter-file-browser-command")){ |
2 |
26 Feb 07 |
jari |
959 |
File convertFile = new File(getBaseFileLocation()+"/Data/Convert"); |
2 |
26 Feb 07 |
jari |
960 |
JFileChooser chooser = new JFileChooser(convertFile); |
2 |
26 Feb 07 |
jari |
961 |
chooser.setDialogTitle("Annotation Converter Selection"); |
2 |
26 Feb 07 |
jari |
962 |
chooser.setMultiSelectionEnabled(false); |
2 |
26 Feb 07 |
jari |
963 |
if(chooser.showOpenDialog(parent) == JOptionPane.OK_OPTION){ |
2 |
26 Feb 07 |
jari |
964 |
easeParamPanel.updateConverterFileField(chooser.getSelectedFile().getPath()); |
2 |
26 Feb 07 |
jari |
965 |
} |
2 |
26 Feb 07 |
jari |
966 |
return; |
2 |
26 Feb 07 |
jari |
967 |
} else if (command.equals("ann-file-browser-command")){ |
2 |
26 Feb 07 |
jari |
968 |
|
2 |
26 Feb 07 |
jari |
969 |
File classFile = new File(getBaseFileLocation()+"/Data/Class/"); |
2 |
26 Feb 07 |
jari |
970 |
JFileChooser chooser = new JFileChooser(classFile); |
2 |
26 Feb 07 |
jari |
971 |
chooser.setDialogTitle("Annotation --> GO Term, File(s) Selection"); |
2 |
26 Feb 07 |
jari |
972 |
chooser.setMultiSelectionEnabled(true); |
2 |
26 Feb 07 |
jari |
973 |
if(chooser.showOpenDialog(parent) == JOptionPane.OK_OPTION){ |
2 |
26 Feb 07 |
jari |
974 |
easeParamPanel.updateAnnFileList(chooser.getSelectedFiles()); |
2 |
26 Feb 07 |
jari |
975 |
easeParamPanel.removeButton.setEnabled(true); |
2 |
26 Feb 07 |
jari |
976 |
okButton.setEnabled(true); |
2 |
26 Feb 07 |
jari |
977 |
} |
2 |
26 Feb 07 |
jari |
978 |
} else if (command.equals("remove-ann-file-command")){ |
2 |
26 Feb 07 |
jari |
979 |
easeParamPanel.removeSelectedFiles(); |
2 |
26 Feb 07 |
jari |
980 |
} else if (command.equals("permutation-analysis-command")){ |
2 |
26 Feb 07 |
jari |
981 |
alphaPanel.setEnablePermutations(); |
2 |
26 Feb 07 |
jari |
982 |
} else if (command.equals("trim-result-command")){ |
2 |
26 Feb 07 |
jari |
983 |
alphaPanel.validateTrimOptions(); |
2 |
26 Feb 07 |
jari |
984 |
} else if (command.equals("select-file-base-command")) { |
2 |
26 Feb 07 |
jari |
985 |
configPanel.selectFileSystem(); |
2 |
26 Feb 07 |
jari |
986 |
} else if (command.equals("update-files-command")) { |
2 |
26 Feb 07 |
jari |
987 |
EASEUpdateManager manager = new EASEUpdateManager((JFrame)parent); |
2 |
26 Feb 07 |
jari |
988 |
manager.updateFiles(); |
2 |
26 Feb 07 |
jari |
989 |
} else if (command.equals("ok-command")) { |
2 |
26 Feb 07 |
jari |
990 |
result = JOptionPane.OK_OPTION; |
2 |
26 Feb 07 |
jari |
991 |
if(isClusterModeSelected() && popPanel.fileButton.isSelected()) { |
2 |
26 Feb 07 |
jari |
992 |
String fileName = popPanel.popField.getText(); |
2 |
26 Feb 07 |
jari |
993 |
if(fileName == null || fileName.equals("") || fileName.equals(" ")) { |
2 |
26 Feb 07 |
jari |
994 |
JOptionPane.showMessageDialog(parent, "You have selected to use a population file but have not "+ |
2 |
26 Feb 07 |
jari |
995 |
"entered a file name. \nPlease enter a file or use the file browser to select a file.", "EASE Initialization: Missing Parameter", JOptionPane.WARNING_MESSAGE); |
2 |
26 Feb 07 |
jari |
996 |
tabbedPane.setSelectedIndex(0); |
2 |
26 Feb 07 |
jari |
997 |
popPanel.popField.grabFocus(); |
2 |
26 Feb 07 |
jari |
998 |
popPanel.popField.selectAll(); |
2 |
26 Feb 07 |
jari |
999 |
popPanel.popField.setCaretPosition(0); |
2 |
26 Feb 07 |
jari |
1000 |
return; |
2 |
26 Feb 07 |
jari |
1001 |
} |
2 |
26 Feb 07 |
jari |
1002 |
} |
2 |
26 Feb 07 |
jari |
1003 |
|
2 |
26 Feb 07 |
jari |
1004 |
if(getAnnToGOFileList().length == 0) { |
2 |
26 Feb 07 |
jari |
1005 |
JOptionPane.showMessageDialog(parent, "You have not selected any gene annotation/gene ontology linking files. \n"+ |
2 |
26 Feb 07 |
jari |
1006 |
"Please enter files or use the browser to select files.", "EASE Initialization: Missing Parameter", JOptionPane.WARNING_MESSAGE); |
2 |
26 Feb 07 |
jari |
1007 |
tabbedPane.setSelectedIndex(1); |
2 |
26 Feb 07 |
jari |
1008 |
easeParamPanel.browserButton.grabFocus(); |
2 |
26 Feb 07 |
jari |
1009 |
return; |
2 |
26 Feb 07 |
jari |
1010 |
} |
2 |
26 Feb 07 |
jari |
1011 |
|
2 |
26 Feb 07 |
jari |
1012 |
if(easeParamPanel.useAnnBox.isSelected()) { |
2 |
26 Feb 07 |
jari |
1013 |
String fileName = easeParamPanel.getConverterFileName(); |
2 |
26 Feb 07 |
jari |
1014 |
if( fileName == null || fileName.equals("") || fileName.equals(" ") ) { |
2 |
26 Feb 07 |
jari |
1015 |
JOptionPane.showMessageDialog(parent, "You have selected to use an annotation conversion file but have not made a file selection.\n" + |
2 |
26 Feb 07 |
jari |
1016 |
"Please enter a file name or browse to select a file.", "EASE Initialization: Missing Parameter", JOptionPane.WARNING_MESSAGE); |
2 |
26 Feb 07 |
jari |
1017 |
tabbedPane.setSelectedIndex(1); |
2 |
26 Feb 07 |
jari |
1018 |
easeParamPanel.browserButton.grabFocus(); |
2 |
26 Feb 07 |
jari |
1019 |
return; |
2 |
26 Feb 07 |
jari |
1020 |
} |
2 |
26 Feb 07 |
jari |
1021 |
} |
2 |
26 Feb 07 |
jari |
1022 |
dispose(); |
2 |
26 Feb 07 |
jari |
1023 |
} else if (command.equals("cancel-command")) { |
2 |
26 Feb 07 |
jari |
1024 |
result = JOptionPane.CANCEL_OPTION; |
2 |
26 Feb 07 |
jari |
1025 |
dispose(); |
2 |
26 Feb 07 |
jari |
1026 |
} else if (command.equals("reset-command")){ |
2 |
26 Feb 07 |
jari |
1027 |
resetControls(); |
2 |
26 Feb 07 |
jari |
1028 |
result = JOptionPane.CANCEL_OPTION; |
2 |
26 Feb 07 |
jari |
1029 |
return; |
2 |
26 Feb 07 |
jari |
1030 |
} else if (command.equals("info-command")){ |
2 |
26 Feb 07 |
jari |
1031 |
HelpWindow hw = new HelpWindow(EASEInitDialog.this, "EASE Initialization Dialog"); |
2 |
26 Feb 07 |
jari |
1032 |
result = JOptionPane.CANCEL_OPTION; |
2 |
26 Feb 07 |
jari |
1033 |
if(hw.getWindowContent()){ |
2 |
26 Feb 07 |
jari |
1034 |
hw.setSize(600,600); |
2 |
26 Feb 07 |
jari |
1035 |
hw.setLocation(); |
2 |
26 Feb 07 |
jari |
1036 |
hw.show(); |
2 |
26 Feb 07 |
jari |
1037 |
} |
2 |
26 Feb 07 |
jari |
1038 |
else { |
2 |
26 Feb 07 |
jari |
1039 |
hw.setVisible(false); |
2 |
26 Feb 07 |
jari |
1040 |
hw.dispose(); |
2 |
26 Feb 07 |
jari |
1041 |
} |
2 |
26 Feb 07 |
jari |
1042 |
} |
2 |
26 Feb 07 |
jari |
1043 |
} |
2 |
26 Feb 07 |
jari |
1044 |
|
2 |
26 Feb 07 |
jari |
1045 |
public void itemStateChanged(ItemEvent e) { |
2 |
26 Feb 07 |
jari |
//okButton.setEnabled(genes_box.isSelected() || cluster_box.isSelected()); |
2 |
26 Feb 07 |
jari |
1047 |
} |
2 |
26 Feb 07 |
jari |
1048 |
|
2 |
26 Feb 07 |
jari |
1049 |
public void windowClosing(WindowEvent e) { |
2 |
26 Feb 07 |
jari |
1050 |
result = JOptionPane.CLOSED_OPTION; |
2 |
26 Feb 07 |
jari |
1051 |
dispose(); |
2 |
26 Feb 07 |
jari |
1052 |
} |
2 |
26 Feb 07 |
jari |
1053 |
} |
2 |
26 Feb 07 |
jari |
1054 |
|
2 |
26 Feb 07 |
jari |
1055 |
public static void main(String [] args) { |
2 |
26 Feb 07 |
jari |
1056 |
String [] labels = new String [3]; |
2 |
26 Feb 07 |
jari |
1057 |
labels[0] = "TC#"; |
2 |
26 Feb 07 |
jari |
1058 |
labels[1] = "GB#"; |
2 |
26 Feb 07 |
jari |
1059 |
labels[2] = "Role"; |
2 |
26 Feb 07 |
jari |
1060 |
|
2 |
26 Feb 07 |
jari |
1061 |
EASEInitDialog eid = new EASEInitDialog(new JFrame(), labels); |
2 |
26 Feb 07 |
jari |
1062 |
eid.showModal(); |
2 |
26 Feb 07 |
jari |
1063 |
} |
2 |
26 Feb 07 |
jari |
1064 |
} |