2 |
26 Feb 07 |
jari |
1 |
/* |
2 |
26 Feb 07 |
jari |
Copyright @ 1999-2005, 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 |
* KNNCInitDialog.java |
2 |
26 Feb 07 |
jari |
7 |
* |
2 |
26 Feb 07 |
jari |
* Created on September 3, 2003, 2:32 PM |
2 |
26 Feb 07 |
jari |
9 |
*/ |
2 |
26 Feb 07 |
jari |
10 |
|
2 |
26 Feb 07 |
jari |
11 |
package org.tigr.microarray.mev.cluster.gui.impl.knnc; |
2 |
26 Feb 07 |
jari |
12 |
|
2 |
26 Feb 07 |
jari |
13 |
import java.awt.Color; |
2 |
26 Feb 07 |
jari |
14 |
import java.awt.Dimension; |
2 |
26 Feb 07 |
jari |
15 |
import java.awt.GridBagConstraints; |
2 |
26 Feb 07 |
jari |
16 |
import java.awt.GridBagLayout; |
2 |
26 Feb 07 |
jari |
17 |
import java.awt.Toolkit; |
2 |
26 Feb 07 |
jari |
18 |
import java.awt.event.ActionEvent; |
2 |
26 Feb 07 |
jari |
19 |
import java.awt.event.ActionListener; |
2 |
26 Feb 07 |
jari |
20 |
import java.awt.event.ItemEvent; |
2 |
26 Feb 07 |
jari |
21 |
import java.awt.event.ItemListener; |
2 |
26 Feb 07 |
jari |
22 |
import java.awt.event.WindowAdapter; |
2 |
26 Feb 07 |
jari |
23 |
|
2 |
26 Feb 07 |
jari |
24 |
import javax.swing.ButtonGroup; |
2 |
26 Feb 07 |
jari |
25 |
import javax.swing.JButton; |
2 |
26 Feb 07 |
jari |
26 |
import javax.swing.JCheckBox; |
2 |
26 Feb 07 |
jari |
27 |
import javax.swing.JComboBox; |
2 |
26 Feb 07 |
jari |
28 |
import javax.swing.JFrame; |
2 |
26 Feb 07 |
jari |
29 |
import javax.swing.JLabel; |
2 |
26 Feb 07 |
jari |
30 |
import javax.swing.JPanel; |
2 |
26 Feb 07 |
jari |
31 |
import javax.swing.JRadioButton; |
2 |
26 Feb 07 |
jari |
32 |
import javax.swing.JTabbedPane; |
2 |
26 Feb 07 |
jari |
33 |
import javax.swing.JTextField; |
2 |
26 Feb 07 |
jari |
34 |
import javax.swing.border.TitledBorder; |
2 |
26 Feb 07 |
jari |
35 |
|
2 |
26 Feb 07 |
jari |
36 |
import org.tigr.microarray.mev.cluster.gui.Experiment; |
2 |
26 Feb 07 |
jari |
37 |
import org.tigr.microarray.mev.cluster.gui.IFramework; |
2 |
26 Feb 07 |
jari |
38 |
import org.tigr.microarray.mev.cluster.gui.impl.dialogs.AlgorithmDialog; |
2 |
26 Feb 07 |
jari |
39 |
import org.tigr.microarray.mev.cluster.gui.impl.dialogs.HCLSelectionPanel; |
2 |
26 Feb 07 |
jari |
40 |
import org.tigr.microarray.mev.cluster.gui.impl.dialogs.dialogHelpUtil.HelpWindow; |
2 |
26 Feb 07 |
jari |
41 |
|
2 |
26 Feb 07 |
jari |
42 |
/** |
2 |
26 Feb 07 |
jari |
43 |
* |
2 |
26 Feb 07 |
jari |
* @author nbhagaba |
2 |
26 Feb 07 |
jari |
45 |
*/ |
2 |
26 Feb 07 |
jari |
46 |
public class KNNCInitDialog extends AlgorithmDialog { |
2 |
26 Feb 07 |
jari |
47 |
|
2 |
26 Feb 07 |
jari |
48 |
boolean okPressed = false; |
2 |
26 Feb 07 |
jari |
49 |
JRadioButton genesButton, expsButton, createNewTrgSetButton, useExistTrgSetButton, trgSetFromCurrent, trgSetNotFromCurrent; |
2 |
26 Feb 07 |
jari |
50 |
JButton classEditorButton, browseTrgFileButton, previewTrgSetButton; |
2 |
26 Feb 07 |
jari |
51 |
JCheckBox useVarianceFilterBox, useCorrelFilterBox; |
2 |
26 Feb 07 |
jari |
52 |
JTextField numGenesField, pValueField, numClassesField, numNeighborsField, pathFileField; |
2 |
26 Feb 07 |
jari |
53 |
JComboBox annotSelectBox; |
2 |
26 Feb 07 |
jari |
54 |
JLabel varLabel, corrLabel, pathLabel, questionLabel; |
2 |
26 Feb 07 |
jari |
55 |
JPanel trgSetSpecPanel; |
2 |
26 Feb 07 |
jari |
56 |
JTabbedPane classifyOrValidatePane; |
2 |
26 Feb 07 |
jari |
57 |
|
2 |
26 Feb 07 |
jari |
58 |
HCLSelectionPanel hclOpsPanel; |
2 |
26 Feb 07 |
jari |
59 |
|
2 |
26 Feb 07 |
jari |
60 |
IFramework framework; |
2 |
26 Feb 07 |
jari |
61 |
Experiment experiment; |
2 |
26 Feb 07 |
jari |
62 |
KNNClassificationEditor knnEditor; |
2 |
26 Feb 07 |
jari |
63 |
|
2 |
26 Feb 07 |
jari |
64 |
int numExps, numGenes; |
2 |
26 Feb 07 |
jari |
65 |
|
2 |
26 Feb 07 |
jari |
/** Creates a new instance of KNNCInitDialog */ |
2 |
26 Feb 07 |
jari |
67 |
public KNNCInitDialog(JFrame parentFrame, boolean modality, IFramework framework_1) { |
2 |
26 Feb 07 |
jari |
68 |
super(parentFrame, "KNN Classification", modality); |
2 |
26 Feb 07 |
jari |
69 |
setBounds(0, 0, 550, 800); |
2 |
26 Feb 07 |
jari |
70 |
setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
71 |
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); |
2 |
26 Feb 07 |
jari |
72 |
|
2 |
26 Feb 07 |
jari |
73 |
this.framework = framework_1; |
2 |
26 Feb 07 |
jari |
74 |
this.experiment = framework.getData().getExperiment(); |
2 |
26 Feb 07 |
jari |
75 |
this.knnEditor = new KNNClassificationEditor(framework, true, 5); |
2 |
26 Feb 07 |
jari |
76 |
|
2 |
26 Feb 07 |
jari |
77 |
numExps = experiment.getNumberOfSamples(); |
2 |
26 Feb 07 |
jari |
78 |
numGenes = experiment.getNumberOfGenes(); |
2 |
26 Feb 07 |
jari |
79 |
|
2 |
26 Feb 07 |
jari |
80 |
GridBagLayout gridbag = new GridBagLayout(); |
2 |
26 Feb 07 |
jari |
81 |
GridBagConstraints constraints = new GridBagConstraints(); |
2 |
26 Feb 07 |
jari |
//constraints.fill = GridBagConstraints.BOTH; |
2 |
26 Feb 07 |
jari |
83 |
|
2 |
26 Feb 07 |
jari |
84 |
JPanel mainPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
85 |
mainPanel.setLayout(gridbag); |
2 |
26 Feb 07 |
jari |
86 |
|
2 |
26 Feb 07 |
jari |
87 |
JPanel classifyPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
88 |
GridBagLayout classGrid = new GridBagLayout(); |
2 |
26 Feb 07 |
jari |
89 |
classifyPanel.setLayout(classGrid); |
2 |
26 Feb 07 |
jari |
90 |
|
2 |
26 Feb 07 |
jari |
91 |
|
2 |
26 Feb 07 |
jari |
92 |
JPanel genesOrExpsPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
93 |
genesOrExpsPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
94 |
genesOrExpsPanel.setBorder(new TitledBorder("Classify genes or samples")); |
2 |
26 Feb 07 |
jari |
95 |
GridBagLayout grid1 = new GridBagLayout(); |
2 |
26 Feb 07 |
jari |
96 |
genesOrExpsPanel.setLayout(grid1); |
2 |
26 Feb 07 |
jari |
97 |
|
2 |
26 Feb 07 |
jari |
98 |
genesButton = new JRadioButton("Classify genes", true); |
2 |
26 Feb 07 |
jari |
99 |
genesButton.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
100 |
expsButton = new JRadioButton("Classify samples", false); |
2 |
26 Feb 07 |
jari |
101 |
expsButton.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
102 |
ButtonGroup genesOrExpsGroup = new ButtonGroup(); |
2 |
26 Feb 07 |
jari |
103 |
genesOrExpsGroup.add(genesButton); |
2 |
26 Feb 07 |
jari |
104 |
genesOrExpsGroup.add(expsButton); |
2 |
26 Feb 07 |
jari |
105 |
|
2 |
26 Feb 07 |
jari |
106 |
buildConstraints(constraints, 0, 0, 1, 1, 50, 100); |
2 |
26 Feb 07 |
jari |
107 |
grid1.setConstraints(genesButton, constraints); |
2 |
26 Feb 07 |
jari |
108 |
genesOrExpsPanel.add(genesButton); |
2 |
26 Feb 07 |
jari |
109 |
|
2 |
26 Feb 07 |
jari |
110 |
buildConstraints(constraints, 1, 0, 1, 1, 50, 0); |
2 |
26 Feb 07 |
jari |
111 |
grid1.setConstraints(expsButton, constraints); |
2 |
26 Feb 07 |
jari |
112 |
genesOrExpsPanel.add(expsButton); |
2 |
26 Feb 07 |
jari |
113 |
|
2 |
26 Feb 07 |
jari |
114 |
buildConstraints(constraints, 0, 0, 1, 1, 100, 10); |
2 |
26 Feb 07 |
jari |
115 |
constraints.fill = GridBagConstraints.BOTH; |
2 |
26 Feb 07 |
jari |
116 |
classGrid.setConstraints(genesOrExpsPanel, constraints); |
2 |
26 Feb 07 |
jari |
117 |
classifyPanel.add(genesOrExpsPanel); |
2 |
26 Feb 07 |
jari |
118 |
|
2 |
26 Feb 07 |
jari |
119 |
constraints.fill = GridBagConstraints.NONE; |
2 |
26 Feb 07 |
jari |
120 |
|
2 |
26 Feb 07 |
jari |
121 |
JPanel variancePanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
122 |
variancePanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
123 |
variancePanel.setBorder(new TitledBorder("Variance filter")); |
2 |
26 Feb 07 |
jari |
124 |
GridBagLayout grid3 = new GridBagLayout(); |
2 |
26 Feb 07 |
jari |
125 |
variancePanel.setLayout(grid3); |
2 |
26 Feb 07 |
jari |
126 |
|
2 |
26 Feb 07 |
jari |
127 |
useVarianceFilterBox = new JCheckBox("Use variance filter (if unchecked, use all vectors)", false); |
2 |
26 Feb 07 |
jari |
128 |
useVarianceFilterBox.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
129 |
varLabel = new JLabel("Use only the following number of highest-variance vectors: "); |
2 |
26 Feb 07 |
jari |
130 |
varLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
131 |
numGenesField = new JTextField("1000",7); |
2 |
26 Feb 07 |
jari |
132 |
numGenesField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
133 |
numGenesField.setBackground(Color.gray); |
2 |
26 Feb 07 |
jari |
134 |
|
2 |
26 Feb 07 |
jari |
135 |
useVarianceFilterBox.addItemListener(new ItemListener() { |
2 |
26 Feb 07 |
jari |
136 |
public void itemStateChanged(ItemEvent evt) { |
2 |
26 Feb 07 |
jari |
137 |
if (evt.getStateChange() == ItemEvent.DESELECTED) { |
2 |
26 Feb 07 |
jari |
138 |
varLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
139 |
numGenesField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
140 |
numGenesField.setBackground(Color.gray); |
2 |
26 Feb 07 |
jari |
141 |
} else { |
2 |
26 Feb 07 |
jari |
142 |
varLabel.setEnabled(true); |
2 |
26 Feb 07 |
jari |
143 |
numGenesField.setEnabled(true); |
2 |
26 Feb 07 |
jari |
144 |
numGenesField.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
145 |
} |
2 |
26 Feb 07 |
jari |
146 |
} |
2 |
26 Feb 07 |
jari |
147 |
}); |
2 |
26 Feb 07 |
jari |
148 |
|
2 |
26 Feb 07 |
jari |
149 |
constraints.anchor = GridBagConstraints.WEST; |
2 |
26 Feb 07 |
jari |
150 |
buildConstraints(constraints, 0, 0, 1, 1, 100, 50); |
2 |
26 Feb 07 |
jari |
151 |
grid3.setConstraints(useVarianceFilterBox, constraints); |
2 |
26 Feb 07 |
jari |
152 |
variancePanel.add(useVarianceFilterBox); |
2 |
26 Feb 07 |
jari |
153 |
|
2 |
26 Feb 07 |
jari |
//JLabel varLabel = new JLabel("Use only the following number of highest-variance vectors: "); |
2 |
26 Feb 07 |
jari |
155 |
buildConstraints(constraints, 0, 1, 1, 1, 70, 50); |
2 |
26 Feb 07 |
jari |
156 |
grid3.setConstraints(varLabel, constraints); |
2 |
26 Feb 07 |
jari |
157 |
variancePanel.add(varLabel); |
2 |
26 Feb 07 |
jari |
158 |
|
2 |
26 Feb 07 |
jari |
//numGenesField = new JTextField(7); |
2 |
26 Feb 07 |
jari |
160 |
buildConstraints(constraints, 1, 1, 1, 1, 30, 0); |
2 |
26 Feb 07 |
jari |
161 |
grid3.setConstraints(numGenesField, constraints); |
2 |
26 Feb 07 |
jari |
162 |
variancePanel.add(numGenesField); |
2 |
26 Feb 07 |
jari |
163 |
|
2 |
26 Feb 07 |
jari |
//constraints.anchor = GridBagConstraints.CENTER; |
2 |
26 Feb 07 |
jari |
165 |
|
2 |
26 Feb 07 |
jari |
166 |
buildConstraints(constraints, 0, 1, 1, 1, 100, 10); |
2 |
26 Feb 07 |
jari |
167 |
constraints.fill = GridBagConstraints.BOTH; |
2 |
26 Feb 07 |
jari |
168 |
classGrid.setConstraints(variancePanel, constraints); |
2 |
26 Feb 07 |
jari |
169 |
classifyPanel.add(variancePanel); |
2 |
26 Feb 07 |
jari |
170 |
|
2 |
26 Feb 07 |
jari |
171 |
constraints.fill = GridBagConstraints.NONE; |
2 |
26 Feb 07 |
jari |
172 |
|
2 |
26 Feb 07 |
jari |
173 |
|
2 |
26 Feb 07 |
jari |
174 |
JPanel correlPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
175 |
correlPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
176 |
correlPanel.setBorder(new TitledBorder("Correlation filter")); |
2 |
26 Feb 07 |
jari |
177 |
GridBagLayout grid2 = new GridBagLayout(); |
2 |
26 Feb 07 |
jari |
178 |
correlPanel.setLayout(grid2); |
2 |
26 Feb 07 |
jari |
179 |
|
2 |
26 Feb 07 |
jari |
180 |
useCorrelFilterBox = new JCheckBox("Use correlation filter", false); |
2 |
26 Feb 07 |
jari |
181 |
useCorrelFilterBox.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
182 |
corrLabel = new JLabel("Cutoff p-value for correlation: "); |
2 |
26 Feb 07 |
jari |
183 |
corrLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
184 |
pValueField = new JTextField("0.01",7); |
2 |
26 Feb 07 |
jari |
185 |
pValueField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
186 |
pValueField.setBackground(Color.gray); |
2 |
26 Feb 07 |
jari |
187 |
|
2 |
26 Feb 07 |
jari |
188 |
useCorrelFilterBox.addItemListener(new ItemListener() { |
2 |
26 Feb 07 |
jari |
189 |
public void itemStateChanged(ItemEvent evt) { |
2 |
26 Feb 07 |
jari |
190 |
if (evt.getStateChange() == ItemEvent.DESELECTED) { |
2 |
26 Feb 07 |
jari |
191 |
corrLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
192 |
pValueField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
193 |
pValueField.setBackground(Color.gray); |
2 |
26 Feb 07 |
jari |
194 |
} else { |
2 |
26 Feb 07 |
jari |
195 |
corrLabel.setEnabled(true); |
2 |
26 Feb 07 |
jari |
196 |
pValueField.setEnabled(true); |
2 |
26 Feb 07 |
jari |
197 |
pValueField.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
198 |
} |
2 |
26 Feb 07 |
jari |
199 |
} |
2 |
26 Feb 07 |
jari |
200 |
}); |
2 |
26 Feb 07 |
jari |
201 |
|
2 |
26 Feb 07 |
jari |
202 |
buildConstraints(constraints, 0, 0, 1, 1, 100, 50); |
2 |
26 Feb 07 |
jari |
203 |
grid2.setConstraints(useCorrelFilterBox, constraints); |
2 |
26 Feb 07 |
jari |
204 |
correlPanel.add(useCorrelFilterBox); |
2 |
26 Feb 07 |
jari |
205 |
|
2 |
26 Feb 07 |
jari |
//corrLabel = new JLabel("Cutoff p-value for correlation: "); |
2 |
26 Feb 07 |
jari |
207 |
buildConstraints(constraints, 0, 1, 1, 1, 70, 50); |
2 |
26 Feb 07 |
jari |
208 |
grid2.setConstraints(corrLabel, constraints); |
2 |
26 Feb 07 |
jari |
209 |
correlPanel.add(corrLabel); |
2 |
26 Feb 07 |
jari |
210 |
|
2 |
26 Feb 07 |
jari |
//pValueField = new JTextField(7); |
2 |
26 Feb 07 |
jari |
212 |
buildConstraints(constraints, 1, 1, 1, 1, 30, 0); |
2 |
26 Feb 07 |
jari |
213 |
grid2.setConstraints(pValueField, constraints); |
2 |
26 Feb 07 |
jari |
214 |
correlPanel.add(pValueField); |
2 |
26 Feb 07 |
jari |
215 |
|
2 |
26 Feb 07 |
jari |
216 |
buildConstraints(constraints, 0, 2, 1, 1, 100, 10); |
2 |
26 Feb 07 |
jari |
217 |
constraints.fill = GridBagConstraints.BOTH; |
2 |
26 Feb 07 |
jari |
218 |
classGrid.setConstraints(correlPanel, constraints); |
2 |
26 Feb 07 |
jari |
219 |
classifyPanel.add(correlPanel); |
2 |
26 Feb 07 |
jari |
220 |
|
2 |
26 Feb 07 |
jari |
221 |
constraints.fill = GridBagConstraints.NONE; |
2 |
26 Feb 07 |
jari |
222 |
|
2 |
26 Feb 07 |
jari |
223 |
|
2 |
26 Feb 07 |
jari |
224 |
JPanel knnParamPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
225 |
knnParamPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
226 |
knnParamPanel.setBorder(new TitledBorder("KNN classification parameters")); |
2 |
26 Feb 07 |
jari |
227 |
GridBagLayout grid4 = new GridBagLayout(); |
2 |
26 Feb 07 |
jari |
228 |
knnParamPanel.setLayout(grid4); |
2 |
26 Feb 07 |
jari |
229 |
|
2 |
26 Feb 07 |
jari |
230 |
JLabel numClassesLabel = new JLabel("Number of classes"); |
2 |
26 Feb 07 |
jari |
231 |
buildConstraints(constraints, 0, 0, 1, 1, 50, 50); |
2 |
26 Feb 07 |
jari |
232 |
grid4.setConstraints(numClassesLabel, constraints); |
2 |
26 Feb 07 |
jari |
233 |
knnParamPanel.add(numClassesLabel); |
2 |
26 Feb 07 |
jari |
234 |
|
2 |
26 Feb 07 |
jari |
235 |
numClassesField = new JTextField("5", 7); |
2 |
26 Feb 07 |
jari |
236 |
buildConstraints(constraints, 1, 0, 1, 1, 50, 0); |
2 |
26 Feb 07 |
jari |
237 |
grid4.setConstraints(numClassesField, constraints); |
2 |
26 Feb 07 |
jari |
238 |
knnParamPanel.add(numClassesField); |
2 |
26 Feb 07 |
jari |
239 |
|
2 |
26 Feb 07 |
jari |
240 |
JLabel numNeighborsLabel = new JLabel("Number of neighbors"); |
2 |
26 Feb 07 |
jari |
241 |
buildConstraints(constraints, 0, 1, 1, 1, 50, 50); |
2 |
26 Feb 07 |
jari |
242 |
grid4.setConstraints(numNeighborsLabel, constraints); |
2 |
26 Feb 07 |
jari |
243 |
knnParamPanel.add(numNeighborsLabel); |
2 |
26 Feb 07 |
jari |
244 |
|
2 |
26 Feb 07 |
jari |
245 |
numNeighborsField = new JTextField("3", 7); |
2 |
26 Feb 07 |
jari |
246 |
buildConstraints(constraints, 1, 1, 1, 1, 50, 0); |
2 |
26 Feb 07 |
jari |
247 |
grid4.setConstraints(numNeighborsField, constraints); |
2 |
26 Feb 07 |
jari |
248 |
knnParamPanel.add(numNeighborsField); |
2 |
26 Feb 07 |
jari |
249 |
|
2 |
26 Feb 07 |
jari |
250 |
buildConstraints(constraints, 0, 3, 1, 1, 100, 10); |
2 |
26 Feb 07 |
jari |
251 |
constraints.fill = GridBagConstraints.BOTH; |
2 |
26 Feb 07 |
jari |
252 |
classGrid.setConstraints(knnParamPanel, constraints); |
2 |
26 Feb 07 |
jari |
253 |
classifyPanel.add(knnParamPanel); |
2 |
26 Feb 07 |
jari |
254 |
|
2 |
26 Feb 07 |
jari |
255 |
constraints.fill = GridBagConstraints.NONE; |
2 |
26 Feb 07 |
jari |
256 |
|
2 |
26 Feb 07 |
jari |
257 |
|
2 |
26 Feb 07 |
jari |
258 |
JPanel makeTrainingSetPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
259 |
makeTrainingSetPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
260 |
makeTrainingSetPanel.setBorder(new TitledBorder("Create / import training set")); |
2 |
26 Feb 07 |
jari |
261 |
GridBagLayout grid5 = new GridBagLayout(); |
2 |
26 Feb 07 |
jari |
262 |
makeTrainingSetPanel.setLayout(grid5); |
2 |
26 Feb 07 |
jari |
263 |
|
2 |
26 Feb 07 |
jari |
264 |
trgSetSpecPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
265 |
trgSetSpecPanel.setBackground(Color.gray); |
2 |
26 Feb 07 |
jari |
266 |
trgSetSpecPanel.setBorder(new TitledBorder("Training file specifications")); |
2 |
26 Feb 07 |
jari |
267 |
GridBagLayout grid6 = new GridBagLayout(); |
2 |
26 Feb 07 |
jari |
268 |
trgSetSpecPanel.setLayout(grid6); |
2 |
26 Feb 07 |
jari |
269 |
|
2 |
26 Feb 07 |
jari |
270 |
questionLabel = new JLabel("Was training file created from current data set?"); |
2 |
26 Feb 07 |
jari |
271 |
buildConstraints(constraints, 0, 0, 1, 1, 100, 25); |
2 |
26 Feb 07 |
jari |
272 |
grid6.setConstraints(questionLabel, constraints); |
2 |
26 Feb 07 |
jari |
273 |
trgSetSpecPanel.add(questionLabel); |
2 |
26 Feb 07 |
jari |
274 |
|
2 |
26 Feb 07 |
jari |
275 |
String[] annotFields = {"field1", "field2", "field3", "field4"}; // for now |
2 |
26 Feb 07 |
jari |
276 |
annotSelectBox = new JComboBox(annotFields); |
2 |
26 Feb 07 |
jari |
277 |
annotSelectBox.setEnabled(false); |
2 |
26 Feb 07 |
jari |
278 |
|
2 |
26 Feb 07 |
jari |
279 |
trgSetFromCurrent = new JRadioButton("Yes", true); |
2 |
26 Feb 07 |
jari |
280 |
trgSetFromCurrent.setBackground(Color.gray); |
2 |
26 Feb 07 |
jari |
281 |
trgSetNotFromCurrent = new JRadioButton("No - select annotation column of current data set to match to: ", false); |
2 |
26 Feb 07 |
jari |
282 |
trgSetNotFromCurrent.setBackground(Color.gray); |
2 |
26 Feb 07 |
jari |
283 |
|
2 |
26 Feb 07 |
jari |
284 |
trgSetFromCurrent.addItemListener(new ItemListener() { |
2 |
26 Feb 07 |
jari |
285 |
public void itemStateChanged(ItemEvent evt) { |
2 |
26 Feb 07 |
jari |
286 |
if (evt.getStateChange() == ItemEvent.SELECTED) { |
2 |
26 Feb 07 |
jari |
287 |
annotSelectBox.setEnabled(false); |
2 |
26 Feb 07 |
jari |
288 |
} else { |
2 |
26 Feb 07 |
jari |
289 |
annotSelectBox.setEnabled(true); |
2 |
26 Feb 07 |
jari |
290 |
} |
2 |
26 Feb 07 |
jari |
291 |
} |
2 |
26 Feb 07 |
jari |
292 |
}); |
2 |
26 Feb 07 |
jari |
293 |
|
2 |
26 Feb 07 |
jari |
294 |
ButtonGroup currentOrNot = new ButtonGroup(); |
2 |
26 Feb 07 |
jari |
295 |
currentOrNot.add(trgSetFromCurrent); |
2 |
26 Feb 07 |
jari |
296 |
currentOrNot.add(trgSetNotFromCurrent); |
2 |
26 Feb 07 |
jari |
297 |
|
2 |
26 Feb 07 |
jari |
298 |
buildConstraints(constraints, 0, 1, 1, 1, 100, 25); |
2 |
26 Feb 07 |
jari |
299 |
grid6.setConstraints(trgSetFromCurrent, constraints); |
2 |
26 Feb 07 |
jari |
300 |
trgSetSpecPanel.add(trgSetFromCurrent); |
2 |
26 Feb 07 |
jari |
301 |
|
2 |
26 Feb 07 |
jari |
302 |
buildConstraints(constraints, 0, 2, 1, 1, 80, 25); |
2 |
26 Feb 07 |
jari |
303 |
grid6.setConstraints(trgSetNotFromCurrent, constraints); |
2 |
26 Feb 07 |
jari |
304 |
trgSetSpecPanel.add(trgSetNotFromCurrent); |
2 |
26 Feb 07 |
jari |
305 |
|
2 |
26 Feb 07 |
jari |
//String[] annotFields = {"field1", "field2", "field3", "field4"}; // for now |
2 |
26 Feb 07 |
jari |
//annotSelectBox = new JComboBox(annotFields); |
2 |
26 Feb 07 |
jari |
308 |
buildConstraints(constraints, 1, 2, 1, 1, 20, 0); |
2 |
26 Feb 07 |
jari |
309 |
grid6.setConstraints(annotSelectBox, constraints); |
2 |
26 Feb 07 |
jari |
310 |
trgSetSpecPanel.add(annotSelectBox); |
2 |
26 Feb 07 |
jari |
311 |
|
2 |
26 Feb 07 |
jari |
312 |
previewTrgSetButton = new JButton("View / modify training set assignments from file"); |
2 |
26 Feb 07 |
jari |
313 |
constraints.anchor = GridBagConstraints.CENTER; |
2 |
26 Feb 07 |
jari |
314 |
buildConstraints(constraints, 0, 3, 1, 1, 100, 25); |
2 |
26 Feb 07 |
jari |
315 |
grid6.setConstraints(previewTrgSetButton, constraints); |
2 |
26 Feb 07 |
jari |
316 |
trgSetSpecPanel.add(previewTrgSetButton); |
2 |
26 Feb 07 |
jari |
317 |
|
2 |
26 Feb 07 |
jari |
318 |
|
2 |
26 Feb 07 |
jari |
319 |
|
2 |
26 Feb 07 |
jari |
320 |
createNewTrgSetButton = new JRadioButton("Create new training set from data >>", true); |
2 |
26 Feb 07 |
jari |
321 |
createNewTrgSetButton.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
322 |
useExistTrgSetButton = new JRadioButton("Use previously created training set from file >>", false); |
2 |
26 Feb 07 |
jari |
323 |
useExistTrgSetButton.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
324 |
|
2 |
26 Feb 07 |
jari |
325 |
classEditorButton = new JButton("Classificaton editor ..."); |
2 |
26 Feb 07 |
jari |
326 |
classEditorButton.addActionListener(new ActionListener() { |
2 |
26 Feb 07 |
jari |
327 |
public void actionPerformed(ActionEvent evt) { |
2 |
26 Feb 07 |
jari |
328 |
knnEditor = new KNNClassificationEditor(framework, classifyGenes(), getNumClasses()); |
2 |
26 Feb 07 |
jari |
329 |
knnEditor.setVisible(true); |
2 |
26 Feb 07 |
jari |
330 |
} |
2 |
26 Feb 07 |
jari |
331 |
}); |
2 |
26 Feb 07 |
jari |
332 |
browseTrgFileButton = new JButton("Browse files ..."); |
2 |
26 Feb 07 |
jari |
333 |
pathLabel = new JLabel("Selected file: "); |
2 |
26 Feb 07 |
jari |
334 |
pathFileField = new JTextField(80); |
2 |
26 Feb 07 |
jari |
335 |
|
2 |
26 Feb 07 |
jari |
336 |
browseTrgFileButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
337 |
pathLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
338 |
pathFileField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
339 |
questionLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
340 |
trgSetFromCurrent.setEnabled(false); |
2 |
26 Feb 07 |
jari |
341 |
trgSetNotFromCurrent.setEnabled(false); |
2 |
26 Feb 07 |
jari |
342 |
annotSelectBox.setEnabled(false); |
2 |
26 Feb 07 |
jari |
343 |
previewTrgSetButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
344 |
|
2 |
26 Feb 07 |
jari |
345 |
createNewTrgSetButton.addItemListener(new ItemListener() { |
2 |
26 Feb 07 |
jari |
346 |
public void itemStateChanged(ItemEvent evt) { |
2 |
26 Feb 07 |
jari |
347 |
if (evt.getStateChange() == ItemEvent.SELECTED) { |
2 |
26 Feb 07 |
jari |
348 |
trgSetSpecPanel.setBackground(Color.gray); |
2 |
26 Feb 07 |
jari |
349 |
browseTrgFileButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
350 |
pathLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
351 |
pathFileField.setEnabled(false); |
2 |
26 Feb 07 |
jari |
352 |
questionLabel.setEnabled(false); |
2 |
26 Feb 07 |
jari |
353 |
trgSetFromCurrent.setEnabled(false); |
2 |
26 Feb 07 |
jari |
354 |
trgSetFromCurrent.setBackground(Color.gray); |
2 |
26 Feb 07 |
jari |
355 |
trgSetNotFromCurrent.setEnabled(false); |
2 |
26 Feb 07 |
jari |
356 |
trgSetNotFromCurrent.setBackground(Color.gray); |
2 |
26 Feb 07 |
jari |
357 |
annotSelectBox.setEnabled(false); |
2 |
26 Feb 07 |
jari |
358 |
previewTrgSetButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
359 |
} else { |
2 |
26 Feb 07 |
jari |
360 |
trgSetSpecPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
361 |
browseTrgFileButton.setEnabled(true); |
2 |
26 Feb 07 |
jari |
362 |
pathLabel.setEnabled(true); |
2 |
26 Feb 07 |
jari |
363 |
pathFileField.setEnabled(true); |
2 |
26 Feb 07 |
jari |
364 |
questionLabel.setEnabled(true); |
2 |
26 Feb 07 |
jari |
365 |
trgSetFromCurrent.setEnabled(true); |
2 |
26 Feb 07 |
jari |
366 |
trgSetFromCurrent.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
367 |
trgSetNotFromCurrent.setEnabled(true); |
2 |
26 Feb 07 |
jari |
368 |
trgSetNotFromCurrent.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
369 |
if (trgSetFromCurrent.isSelected()) { |
2 |
26 Feb 07 |
jari |
370 |
annotSelectBox.setEnabled(false); |
2 |
26 Feb 07 |
jari |
371 |
} else { |
2 |
26 Feb 07 |
jari |
372 |
annotSelectBox.setEnabled(true); |
2 |
26 Feb 07 |
jari |
373 |
} |
2 |
26 Feb 07 |
jari |
374 |
previewTrgSetButton.setEnabled(true); |
2 |
26 Feb 07 |
jari |
375 |
} |
2 |
26 Feb 07 |
jari |
376 |
} |
2 |
26 Feb 07 |
jari |
377 |
}); |
2 |
26 Feb 07 |
jari |
378 |
|
2 |
26 Feb 07 |
jari |
379 |
useExistTrgSetButton.addItemListener(new ItemListener() { |
2 |
26 Feb 07 |
jari |
380 |
public void itemStateChanged(ItemEvent evt) { |
2 |
26 Feb 07 |
jari |
381 |
if (evt.getStateChange() == ItemEvent.SELECTED) { |
2 |
26 Feb 07 |
jari |
382 |
classEditorButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
383 |
} else { |
2 |
26 Feb 07 |
jari |
384 |
classEditorButton.setEnabled(true); |
2 |
26 Feb 07 |
jari |
385 |
} |
2 |
26 Feb 07 |
jari |
386 |
} |
2 |
26 Feb 07 |
jari |
387 |
}); |
2 |
26 Feb 07 |
jari |
388 |
|
2 |
26 Feb 07 |
jari |
389 |
ButtonGroup newOrExisting = new ButtonGroup(); |
2 |
26 Feb 07 |
jari |
390 |
newOrExisting.add(createNewTrgSetButton); |
2 |
26 Feb 07 |
jari |
391 |
newOrExisting.add(useExistTrgSetButton); |
2 |
26 Feb 07 |
jari |
392 |
|
2 |
26 Feb 07 |
jari |
393 |
buildConstraints(constraints, 0, 0, 1, 1, 50, 10); |
2 |
26 Feb 07 |
jari |
394 |
grid5.setConstraints(createNewTrgSetButton, constraints); |
2 |
26 Feb 07 |
jari |
395 |
makeTrainingSetPanel.add(createNewTrgSetButton); |
2 |
26 Feb 07 |
jari |
396 |
|
2 |
26 Feb 07 |
jari |
//classEditorButton = new JButton("Classificaton editor ..."); |
2 |
26 Feb 07 |
jari |
398 |
buildConstraints(constraints, 1, 0, 1, 1, 50, 0); |
2 |
26 Feb 07 |
jari |
399 |
grid5.setConstraints(classEditorButton, constraints); |
2 |
26 Feb 07 |
jari |
400 |
makeTrainingSetPanel.add(classEditorButton); |
2 |
26 Feb 07 |
jari |
401 |
|
2 |
26 Feb 07 |
jari |
402 |
buildConstraints(constraints, 0, 1, 1, 1, 50, 10); |
2 |
26 Feb 07 |
jari |
403 |
grid5.setConstraints(useExistTrgSetButton, constraints); |
2 |
26 Feb 07 |
jari |
404 |
makeTrainingSetPanel.add(useExistTrgSetButton); |
2 |
26 Feb 07 |
jari |
405 |
|
2 |
26 Feb 07 |
jari |
//browseTrgFileButton = new JButton("Browse files ..."); |
2 |
26 Feb 07 |
jari |
407 |
buildConstraints(constraints, 1, 1, 1, 1, 50, 0); |
2 |
26 Feb 07 |
jari |
408 |
grid5.setConstraints(browseTrgFileButton, constraints); |
2 |
26 Feb 07 |
jari |
409 |
makeTrainingSetPanel.add(browseTrgFileButton); |
2 |
26 Feb 07 |
jari |
410 |
|
2 |
26 Feb 07 |
jari |
//pathLabel = new JLabel("Selected file: "); |
2 |
26 Feb 07 |
jari |
412 |
constraints.anchor = GridBagConstraints.WEST; |
2 |
26 Feb 07 |
jari |
413 |
buildConstraints(constraints, 0, 2, 1, 1, 100, 5); |
2 |
26 Feb 07 |
jari |
414 |
grid5.setConstraints(pathLabel, constraints); |
2 |
26 Feb 07 |
jari |
415 |
makeTrainingSetPanel.add(pathLabel); |
2 |
26 Feb 07 |
jari |
416 |
|
2 |
26 Feb 07 |
jari |
//pathFileField = new JTextField(60); |
2 |
26 Feb 07 |
jari |
418 |
pathFileField.setBackground(Color.lightGray); |
2 |
26 Feb 07 |
jari |
419 |
pathFileField.setEditable(false); |
2 |
26 Feb 07 |
jari |
420 |
pathFileField.setText("No file currently selected"); |
2 |
26 Feb 07 |
jari |
421 |
constraints.fill = GridBagConstraints.BOTH; |
2 |
26 Feb 07 |
jari |
422 |
constraints.anchor = GridBagConstraints.WEST; |
2 |
26 Feb 07 |
jari |
423 |
buildConstraints(constraints, 0, 3, 2, 1, 100, 5); |
2 |
26 Feb 07 |
jari |
424 |
grid5.setConstraints(pathFileField, constraints); |
2 |
26 Feb 07 |
jari |
425 |
makeTrainingSetPanel.add(pathFileField); |
2 |
26 Feb 07 |
jari |
426 |
|
2 |
26 Feb 07 |
jari |
427 |
constraints.fill = GridBagConstraints.NONE; |
2 |
26 Feb 07 |
jari |
//constraints.anchor = GridBagConstraints.CENTER; |
2 |
26 Feb 07 |
jari |
429 |
|
2 |
26 Feb 07 |
jari |
430 |
/* |
2 |
26 Feb 07 |
jari |
JPanel trgSetSpecPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
trgSetSpecPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
trgSetSpecPanel.setBorder(new TitledBorder("Training file specifications")); |
2 |
26 Feb 07 |
jari |
GridBagLayout grid6 = new GridBagLayout(); |
2 |
26 Feb 07 |
jari |
trgSetSpecPanel.setLayout(grid6); |
2 |
26 Feb 07 |
jari |
436 |
|
2 |
26 Feb 07 |
jari |
JLabel questionLabel = new JLabel("Was training file created from current data set?"); |
2 |
26 Feb 07 |
jari |
buildConstraints(constraints, 0, 0, 1, 1, 100, 25); |
2 |
26 Feb 07 |
jari |
grid6.setConstraints(questionLabel, constraints); |
2 |
26 Feb 07 |
jari |
trgSetSpecPanel.add(questionLabel); |
2 |
26 Feb 07 |
jari |
441 |
|
2 |
26 Feb 07 |
jari |
trgSetFromCurrent = new JRadioButton("Yes", true); |
2 |
26 Feb 07 |
jari |
trgSetFromCurrent.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
trgSetNotFromCurrent = new JRadioButton("No - select annotation column of current data set to match to: ", false); |
2 |
26 Feb 07 |
jari |
trgSetNotFromCurrent.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
ButtonGroup currentOrNot = new ButtonGroup(); |
2 |
26 Feb 07 |
jari |
currentOrNot.add(trgSetFromCurrent); |
2 |
26 Feb 07 |
jari |
currentOrNot.add(trgSetNotFromCurrent); |
2 |
26 Feb 07 |
jari |
449 |
|
2 |
26 Feb 07 |
jari |
buildConstraints(constraints, 0, 1, 1, 1, 100, 25); |
2 |
26 Feb 07 |
jari |
grid6.setConstraints(trgSetFromCurrent, constraints); |
2 |
26 Feb 07 |
jari |
trgSetSpecPanel.add(trgSetFromCurrent); |
2 |
26 Feb 07 |
jari |
453 |
|
2 |
26 Feb 07 |
jari |
buildConstraints(constraints, 0, 2, 1, 1, 80, 25); |
2 |
26 Feb 07 |
jari |
grid6.setConstraints(trgSetNotFromCurrent, constraints); |
2 |
26 Feb 07 |
jari |
trgSetSpecPanel.add(trgSetNotFromCurrent); |
2 |
26 Feb 07 |
jari |
457 |
|
2 |
26 Feb 07 |
jari |
String[] annotFields = {"field1", "field2", "field3", "field4"}; // for now |
2 |
26 Feb 07 |
jari |
annotSelectBox = new JComboBox(annotFields); |
2 |
26 Feb 07 |
jari |
buildConstraints(constraints, 1, 2, 1, 1, 20, 0); |
2 |
26 Feb 07 |
jari |
grid6.setConstraints(annotSelectBox, constraints); |
2 |
26 Feb 07 |
jari |
trgSetSpecPanel.add(annotSelectBox); |
2 |
26 Feb 07 |
jari |
463 |
|
2 |
26 Feb 07 |
jari |
previewTrgSetButton = new JButton("View / modify training set assignments from file"); |
2 |
26 Feb 07 |
jari |
constraints.anchor = GridBagConstraints.CENTER; |
2 |
26 Feb 07 |
jari |
buildConstraints(constraints, 0, 3, 1, 1, 100, 25); |
2 |
26 Feb 07 |
jari |
grid6.setConstraints(previewTrgSetButton, constraints); |
2 |
26 Feb 07 |
jari |
trgSetSpecPanel.add(previewTrgSetButton); |
2 |
26 Feb 07 |
jari |
469 |
*/ |
2 |
26 Feb 07 |
jari |
470 |
|
2 |
26 Feb 07 |
jari |
471 |
buildConstraints(constraints, 0, 4, 2, 1, 100, 70); |
2 |
26 Feb 07 |
jari |
472 |
constraints.fill = GridBagConstraints.BOTH; |
2 |
26 Feb 07 |
jari |
473 |
constraints.anchor = GridBagConstraints.EAST; |
2 |
26 Feb 07 |
jari |
474 |
grid5.setConstraints(trgSetSpecPanel, constraints); |
2 |
26 Feb 07 |
jari |
475 |
makeTrainingSetPanel.add(trgSetSpecPanel); |
2 |
26 Feb 07 |
jari |
476 |
|
2 |
26 Feb 07 |
jari |
477 |
constraints.fill = GridBagConstraints.NONE; |
2 |
26 Feb 07 |
jari |
478 |
constraints.anchor = GridBagConstraints.WEST; |
2 |
26 Feb 07 |
jari |
479 |
|
2 |
26 Feb 07 |
jari |
480 |
buildConstraints(constraints, 0, 4, 1, 1, 100, 50); |
2 |
26 Feb 07 |
jari |
481 |
constraints.fill = GridBagConstraints.BOTH; |
2 |
26 Feb 07 |
jari |
482 |
classGrid.setConstraints(makeTrainingSetPanel, constraints); |
2 |
26 Feb 07 |
jari |
483 |
classifyPanel.add(makeTrainingSetPanel); |
2 |
26 Feb 07 |
jari |
484 |
|
2 |
26 Feb 07 |
jari |
485 |
constraints.fill = GridBagConstraints.NONE; |
2 |
26 Feb 07 |
jari |
486 |
|
2 |
26 Feb 07 |
jari |
487 |
hclOpsPanel = new HCLSelectionPanel(); |
2 |
26 Feb 07 |
jari |
488 |
buildConstraints(constraints, 0, 5, 1, 1, 100, 10); |
2 |
26 Feb 07 |
jari |
489 |
constraints.fill = GridBagConstraints.BOTH; |
2 |
26 Feb 07 |
jari |
490 |
classGrid.setConstraints(hclOpsPanel, constraints); |
2 |
26 Feb 07 |
jari |
491 |
classifyPanel.add(hclOpsPanel); |
2 |
26 Feb 07 |
jari |
492 |
|
2 |
26 Feb 07 |
jari |
493 |
constraints.fill = GridBagConstraints.NONE; |
2 |
26 Feb 07 |
jari |
494 |
|
2 |
26 Feb 07 |
jari |
495 |
classifyOrValidatePane = new JTabbedPane(); |
2 |
26 Feb 07 |
jari |
496 |
classifyOrValidatePane.add("Classify", classifyPanel); |
2 |
26 Feb 07 |
jari |
497 |
constraints.fill = GridBagConstraints.BOTH; |
2 |
26 Feb 07 |
jari |
498 |
buildConstraints(constraints, 0, 0, 1, 1, 100, 100); |
2 |
26 Feb 07 |
jari |
499 |
gridbag.setConstraints(classifyOrValidatePane, constraints); |
2 |
26 Feb 07 |
jari |
500 |
mainPanel.add(classifyOrValidatePane); |
2 |
26 Feb 07 |
jari |
501 |
|
2 |
26 Feb 07 |
jari |
502 |
constraints.fill = GridBagConstraints.NONE; |
2 |
26 Feb 07 |
jari |
503 |
|
2 |
26 Feb 07 |
jari |
504 |
|
2 |
26 Feb 07 |
jari |
505 |
|
2 |
26 Feb 07 |
jari |
506 |
addContent(mainPanel); |
2 |
26 Feb 07 |
jari |
507 |
EventListener listener = new EventListener(); |
2 |
26 Feb 07 |
jari |
508 |
setActionListeners(listener); |
2 |
26 Feb 07 |
jari |
509 |
this.addWindowListener(listener); |
2 |
26 Feb 07 |
jari |
510 |
} |
2 |
26 Feb 07 |
jari |
511 |
|
2 |
26 Feb 07 |
jari |
512 |
public void setVisible(boolean visible) { |
2 |
26 Feb 07 |
jari |
513 |
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); |
2 |
26 Feb 07 |
jari |
514 |
setLocation((screenSize.width - getSize().width)/2, (screenSize.height - getSize().height)/2); |
2 |
26 Feb 07 |
jari |
515 |
|
2 |
26 Feb 07 |
jari |
516 |
super.setVisible(visible); |
2 |
26 Feb 07 |
jari |
517 |
} |
2 |
26 Feb 07 |
jari |
518 |
|
2 |
26 Feb 07 |
jari |
519 |
void buildConstraints(GridBagConstraints gbc, int gx, int gy, |
2 |
26 Feb 07 |
jari |
520 |
int gw, int gh, int wx, int wy) { |
2 |
26 Feb 07 |
jari |
521 |
|
2 |
26 Feb 07 |
jari |
522 |
gbc.gridx = gx; |
2 |
26 Feb 07 |
jari |
523 |
gbc.gridy = gy; |
2 |
26 Feb 07 |
jari |
524 |
gbc.gridwidth = gw; |
2 |
26 Feb 07 |
jari |
525 |
gbc.gridheight = gh; |
2 |
26 Feb 07 |
jari |
526 |
gbc.weightx = wx; |
2 |
26 Feb 07 |
jari |
527 |
gbc.weighty = wy; |
2 |
26 Feb 07 |
jari |
528 |
} |
2 |
26 Feb 07 |
jari |
529 |
|
2 |
26 Feb 07 |
jari |
530 |
public boolean isOkPressed() { |
2 |
26 Feb 07 |
jari |
531 |
return okPressed; |
2 |
26 Feb 07 |
jari |
532 |
} |
2 |
26 Feb 07 |
jari |
533 |
|
2 |
26 Feb 07 |
jari |
534 |
public boolean drawTrees() { |
2 |
26 Feb 07 |
jari |
535 |
return this.hclOpsPanel.isHCLSelected(); |
2 |
26 Feb 07 |
jari |
536 |
} |
2 |
26 Feb 07 |
jari |
537 |
|
2 |
26 Feb 07 |
jari |
538 |
public boolean classifyGenes() { |
2 |
26 Feb 07 |
jari |
539 |
return genesButton.isSelected(); |
2 |
26 Feb 07 |
jari |
540 |
} |
2 |
26 Feb 07 |
jari |
541 |
|
2 |
26 Feb 07 |
jari |
542 |
public int getNumClasses() { |
2 |
26 Feb 07 |
jari |
543 |
String s = numClassesField.getText(); |
2 |
26 Feb 07 |
jari |
544 |
return Integer.parseInt(s); |
2 |
26 Feb 07 |
jari |
545 |
} |
2 |
26 Feb 07 |
jari |
546 |
|
2 |
26 Feb 07 |
jari |
547 |
public class EventListener extends WindowAdapter implements ActionListener{ |
2 |
26 Feb 07 |
jari |
548 |
|
2 |
26 Feb 07 |
jari |
549 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
550 |
String command = ae.getActionCommand(); |
2 |
26 Feb 07 |
jari |
551 |
if(command.equals("ok-command")){ |
2 |
26 Feb 07 |
jari |
552 |
okPressed = true; |
2 |
26 Feb 07 |
jari |
553 |
dispose(); |
2 |
26 Feb 07 |
jari |
554 |
} else if (command.equals("reset-command")) { |
2 |
26 Feb 07 |
jari |
555 |
okPressed = false; |
2 |
26 Feb 07 |
jari |
556 |
genesButton.setSelected(true); |
2 |
26 Feb 07 |
jari |
557 |
expsButton.setSelected(false); |
2 |
26 Feb 07 |
jari |
558 |
useVarianceFilterBox.setSelected(false); |
2 |
26 Feb 07 |
jari |
559 |
useCorrelFilterBox.setSelected(false); |
2 |
26 Feb 07 |
jari |
560 |
numClassesField.setText("5"); |
2 |
26 Feb 07 |
jari |
561 |
numNeighborsField.setText("3"); |
2 |
26 Feb 07 |
jari |
562 |
trgSetFromCurrent.setSelected(true); |
2 |
26 Feb 07 |
jari |
563 |
createNewTrgSetButton.setSelected(true); |
2 |
26 Feb 07 |
jari |
564 |
annotSelectBox.setSelectedIndex(0); |
2 |
26 Feb 07 |
jari |
565 |
hclOpsPanel.setHCLSelected(false); |
2 |
26 Feb 07 |
jari |
566 |
} else if (command.equals("cancel-command")) { |
2 |
26 Feb 07 |
jari |
567 |
okPressed = false; |
2 |
26 Feb 07 |
jari |
568 |
dispose(); |
2 |
26 Feb 07 |
jari |
569 |
} else if (command.equals("info-command")){ |
2 |
26 Feb 07 |
jari |
570 |
|
2 |
26 Feb 07 |
jari |
571 |
HelpWindow hw = new HelpWindow(KNNCInitDialog.this, "KNNC Parameter Selections"); |
2 |
26 Feb 07 |
jari |
572 |
okPressed = false; |
2 |
26 Feb 07 |
jari |
573 |
if(hw.getWindowContent()){ |
2 |
26 Feb 07 |
jari |
574 |
hw.setSize(450,600); |
2 |
26 Feb 07 |
jari |
575 |
hw.setLocation(); |
2 |
26 Feb 07 |
jari |
576 |
hw.show(); |
2 |
26 Feb 07 |
jari |
577 |
return; |
2 |
26 Feb 07 |
jari |
578 |
} |
2 |
26 Feb 07 |
jari |
579 |
else { |
2 |
26 Feb 07 |
jari |
580 |
hw.setVisible(false); |
2 |
26 Feb 07 |
jari |
581 |
hw.dispose(); |
2 |
26 Feb 07 |
jari |
582 |
return; |
2 |
26 Feb 07 |
jari |
583 |
} |
2 |
26 Feb 07 |
jari |
584 |
|
2 |
26 Feb 07 |
jari |
585 |
} |
2 |
26 Feb 07 |
jari |
586 |
} |
2 |
26 Feb 07 |
jari |
587 |
|
2 |
26 Feb 07 |
jari |
588 |
} |
2 |
26 Feb 07 |
jari |
589 |
|
2 |
26 Feb 07 |
jari |
590 |
public static void main(String[] args) { |
2 |
26 Feb 07 |
jari |
591 |
|
2 |
26 Feb 07 |
jari |
// KNNCInitDialog kDialog = new KNNCInitDialog(new JFrame(), true); |
2 |
26 Feb 07 |
jari |
// kDialog.setVisible(true); |
2 |
26 Feb 07 |
jari |
594 |
|
2 |
26 Feb 07 |
jari |
595 |
} |
2 |
26 Feb 07 |
jari |
596 |
|
2 |
26 Feb 07 |
jari |
597 |
} |