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: SearchResultDialog.java,v $ |
2 |
26 Feb 07 |
jari |
* $Revision: 1.3 $ |
2 |
26 Feb 07 |
jari |
* $Date: 2006/02/23 20:59:41 $ |
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 |
* SearchResultDialog.java |
2 |
26 Feb 07 |
jari |
14 |
* |
2 |
26 Feb 07 |
jari |
* Created on September 8, 2004, 3:56 PM |
2 |
26 Feb 07 |
jari |
16 |
*/ |
2 |
26 Feb 07 |
jari |
17 |
|
2 |
26 Feb 07 |
jari |
18 |
package org.tigr.microarray.mev; |
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.GridBagConstraints; |
2 |
26 Feb 07 |
jari |
24 |
import java.awt.GridBagLayout; |
2 |
26 Feb 07 |
jari |
25 |
import java.awt.Insets; |
2 |
26 Feb 07 |
jari |
26 |
import java.awt.Toolkit; |
2 |
26 Feb 07 |
jari |
27 |
import java.awt.event.ActionEvent; |
2 |
26 Feb 07 |
jari |
28 |
import java.awt.event.ActionListener; |
2 |
26 Feb 07 |
jari |
29 |
import java.util.Hashtable; |
2 |
26 Feb 07 |
jari |
30 |
import java.util.Vector; |
2 |
26 Feb 07 |
jari |
31 |
|
2 |
26 Feb 07 |
jari |
32 |
import javax.swing.BorderFactory; |
2 |
26 Feb 07 |
jari |
33 |
import javax.swing.JButton; |
2 |
26 Feb 07 |
jari |
34 |
import javax.swing.JCheckBox; |
2 |
26 Feb 07 |
jari |
35 |
import javax.swing.JFrame; |
2 |
26 Feb 07 |
jari |
36 |
import javax.swing.JLabel; |
2 |
26 Feb 07 |
jari |
37 |
import javax.swing.JList; |
2 |
26 Feb 07 |
jari |
38 |
import javax.swing.JOptionPane; |
2 |
26 Feb 07 |
jari |
39 |
import javax.swing.JPanel; |
2 |
26 Feb 07 |
jari |
40 |
import javax.swing.JScrollPane; |
2 |
26 Feb 07 |
jari |
41 |
import javax.swing.JTable; |
2 |
26 Feb 07 |
jari |
42 |
import javax.swing.JTree; |
2 |
26 Feb 07 |
jari |
43 |
import javax.swing.event.ListSelectionEvent; |
2 |
26 Feb 07 |
jari |
44 |
import javax.swing.event.ListSelectionListener; |
2 |
26 Feb 07 |
jari |
45 |
import javax.swing.event.TreeSelectionEvent; |
2 |
26 Feb 07 |
jari |
46 |
import javax.swing.event.TreeSelectionListener; |
2 |
26 Feb 07 |
jari |
47 |
import javax.swing.table.AbstractTableModel; |
2 |
26 Feb 07 |
jari |
48 |
import javax.swing.table.TableCellRenderer; |
2 |
26 Feb 07 |
jari |
49 |
import javax.swing.tree.DefaultMutableTreeNode; |
2 |
26 Feb 07 |
jari |
50 |
import javax.swing.tree.TreeNode; |
2 |
26 Feb 07 |
jari |
51 |
|
2 |
26 Feb 07 |
jari |
52 |
import org.tigr.microarray.mev.cluster.algorithm.AlgorithmData; |
2 |
26 Feb 07 |
jari |
53 |
import org.tigr.microarray.mev.cluster.gui.IData; |
2 |
26 Feb 07 |
jari |
54 |
import org.tigr.microarray.mev.cluster.gui.IFramework; |
2 |
26 Feb 07 |
jari |
55 |
import org.tigr.microarray.mev.cluster.gui.impl.dialogs.AlgorithmDialog; |
2 |
26 Feb 07 |
jari |
56 |
import org.tigr.microarray.mev.cluster.gui.impl.dialogs.ParameterPanel; |
2 |
26 Feb 07 |
jari |
57 |
import org.tigr.microarray.mev.cluster.gui.impl.dialogs.dialogHelpUtil.HelpWindow; |
2 |
26 Feb 07 |
jari |
58 |
|
2 |
26 Feb 07 |
jari |
59 |
/** |
2 |
26 Feb 07 |
jari |
60 |
* |
2 |
26 Feb 07 |
jari |
* @author braisted |
2 |
26 Feb 07 |
jari |
62 |
*/ |
2 |
26 Feb 07 |
jari |
63 |
public class SearchResultDialog extends AlgorithmDialog { |
2 |
26 Feb 07 |
jari |
64 |
|
2 |
26 Feb 07 |
jari |
65 |
private int result = JOptionPane.CANCEL_OPTION; |
2 |
26 Feb 07 |
jari |
66 |
|
2 |
26 Feb 07 |
jari |
67 |
private IFramework framework; |
2 |
26 Feb 07 |
jari |
68 |
private JTree nodeTree; |
2 |
26 Feb 07 |
jari |
69 |
private JList expViewNodeList; |
2 |
26 Feb 07 |
jari |
70 |
private JList tableViewNodeList; |
2 |
26 Feb 07 |
jari |
71 |
private Hashtable expViewHash; |
2 |
26 Feb 07 |
jari |
72 |
private Hashtable tableViewHash; |
2 |
26 Feb 07 |
jari |
73 |
private int [] indices; |
2 |
26 Feb 07 |
jari |
74 |
private boolean geneResult; |
2 |
26 Feb 07 |
jari |
75 |
private ResultTable resultTable; |
2 |
26 Feb 07 |
jari |
76 |
private boolean noViewers = false; |
2 |
26 Feb 07 |
jari |
77 |
private AlgorithmData searchCriteria; |
2 |
26 Feb 07 |
jari |
78 |
private String [] inputIds; |
2 |
26 Feb 07 |
jari |
79 |
private boolean isListImportResult = false; |
2 |
26 Feb 07 |
jari |
80 |
|
2 |
26 Feb 07 |
jari |
/** Creates a new instance of SearchResultDialog */ |
2 |
26 Feb 07 |
jari |
82 |
public SearchResultDialog(IFramework framework, AlgorithmData searchCriteria, JTree resultTree, Hashtable expViewNodeHash, Hashtable tableViewNodeHash, int [] indices) { |
2 |
26 Feb 07 |
jari |
83 |
super(framework.getFrame(), "Search Result", false); |
2 |
26 Feb 07 |
jari |
84 |
this.framework = framework; |
2 |
26 Feb 07 |
jari |
85 |
nodeTree = resultTree; |
2 |
26 Feb 07 |
jari |
86 |
this.indices = indices; |
2 |
26 Feb 07 |
jari |
87 |
this.searchCriteria = searchCriteria; |
2 |
26 Feb 07 |
jari |
88 |
this.geneResult = searchCriteria.getParams().getBoolean("gene-search"); |
2 |
26 Feb 07 |
jari |
89 |
|
2 |
26 Feb 07 |
jari |
90 |
TreeListener listener = new TreeListener(); |
2 |
26 Feb 07 |
jari |
91 |
|
2 |
26 Feb 07 |
jari |
92 |
nodeTree.addTreeSelectionListener(listener); |
2 |
26 Feb 07 |
jari |
93 |
|
2 |
26 Feb 07 |
jari |
94 |
this.expViewHash = expViewNodeHash; |
2 |
26 Feb 07 |
jari |
95 |
this.tableViewHash = tableViewNodeHash; |
2 |
26 Feb 07 |
jari |
96 |
|
2 |
26 Feb 07 |
jari |
97 |
if(resultTree.getModel().getRoot() == null || ((TreeNode)resultTree.getModel().getRoot()).getChildCount() < 1) |
2 |
26 Feb 07 |
jari |
98 |
initElementOnlyResult(); |
2 |
26 Feb 07 |
jari |
99 |
else { |
2 |
26 Feb 07 |
jari |
100 |
initFullResult(); |
2 |
26 Feb 07 |
jari |
101 |
|
2 |
26 Feb 07 |
jari |
102 |
expViewNodeList.addListSelectionListener(listener); |
2 |
26 Feb 07 |
jari |
103 |
tableViewNodeList.addListSelectionListener(listener); |
2 |
26 Feb 07 |
jari |
104 |
} |
2 |
26 Feb 07 |
jari |
105 |
|
2 |
26 Feb 07 |
jari |
//use setListData to update |
2 |
26 Feb 07 |
jari |
107 |
|
2 |
26 Feb 07 |
jari |
108 |
okButton.setText("Close"); |
2 |
26 Feb 07 |
jari |
109 |
okButton.addActionListener( new ActionListener() { |
2 |
26 Feb 07 |
jari |
110 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
111 |
result = JOptionPane.CANCEL_OPTION; |
2 |
26 Feb 07 |
jari |
112 |
dispose(); |
2 |
26 Feb 07 |
jari |
113 |
} |
2 |
26 Feb 07 |
jari |
114 |
}); |
2 |
26 Feb 07 |
jari |
115 |
|
2 |
26 Feb 07 |
jari |
116 |
infoButton.addActionListener( new ActionListener() { |
2 |
26 Feb 07 |
jari |
117 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
118 |
HelpWindow hw = new HelpWindow(SearchResultDialog.this, "Search Result Dialog"); |
2 |
26 Feb 07 |
jari |
119 |
result = JOptionPane.CANCEL_OPTION; |
2 |
26 Feb 07 |
jari |
120 |
if(hw.getWindowContent()){ |
2 |
26 Feb 07 |
jari |
121 |
hw.setSize(450,600); |
2 |
26 Feb 07 |
jari |
122 |
hw.setLocation(); |
2 |
26 Feb 07 |
jari |
123 |
hw.show(); |
2 |
26 Feb 07 |
jari |
124 |
return; |
2 |
26 Feb 07 |
jari |
125 |
} |
2 |
26 Feb 07 |
jari |
126 |
else { |
2 |
26 Feb 07 |
jari |
127 |
hw.setVisible(false); |
2 |
26 Feb 07 |
jari |
128 |
hw.dispose(); |
2 |
26 Feb 07 |
jari |
129 |
return; |
2 |
26 Feb 07 |
jari |
130 |
} |
2 |
26 Feb 07 |
jari |
131 |
} |
2 |
26 Feb 07 |
jari |
132 |
}); |
2 |
26 Feb 07 |
jari |
133 |
resetButton.setVisible(false); |
2 |
26 Feb 07 |
jari |
134 |
cancelButton.setVisible(false); |
2 |
26 Feb 07 |
jari |
135 |
pack(); |
2 |
26 Feb 07 |
jari |
136 |
setSize(550, 500); |
2 |
26 Feb 07 |
jari |
137 |
} |
2 |
26 Feb 07 |
jari |
138 |
|
2 |
26 Feb 07 |
jari |
139 |
|
2 |
26 Feb 07 |
jari |
/** Creates a new instance of SearchResultDialog */ |
2 |
26 Feb 07 |
jari |
141 |
public SearchResultDialog(IFramework framework, AlgorithmData searchCriteria, int [] indices) { |
2 |
26 Feb 07 |
jari |
142 |
super(framework.getFrame(), "Search Result", false); |
2 |
26 Feb 07 |
jari |
143 |
this.framework = framework; |
2 |
26 Feb 07 |
jari |
144 |
|
2 |
26 Feb 07 |
jari |
145 |
this.indices = indices; |
2 |
26 Feb 07 |
jari |
146 |
this.geneResult = searchCriteria.getParams().getBoolean("gene-search"); |
2 |
26 Feb 07 |
jari |
147 |
|
2 |
26 Feb 07 |
jari |
148 |
this.noViewers = true; |
2 |
26 Feb 07 |
jari |
149 |
|
2 |
26 Feb 07 |
jari |
150 |
initElementOnlyResult(); |
2 |
26 Feb 07 |
jari |
151 |
|
2 |
26 Feb 07 |
jari |
152 |
this.expViewHash = null; |
2 |
26 Feb 07 |
jari |
153 |
this.tableViewHash = null; |
2 |
26 Feb 07 |
jari |
154 |
|
2 |
26 Feb 07 |
jari |
155 |
okButton.setText("Close"); |
2 |
26 Feb 07 |
jari |
156 |
okButton.addActionListener( new ActionListener() { |
2 |
26 Feb 07 |
jari |
157 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
158 |
result = JOptionPane.CANCEL_OPTION; |
2 |
26 Feb 07 |
jari |
159 |
dispose(); |
2 |
26 Feb 07 |
jari |
160 |
} |
2 |
26 Feb 07 |
jari |
161 |
}); |
2 |
26 Feb 07 |
jari |
162 |
|
2 |
26 Feb 07 |
jari |
163 |
infoButton.addActionListener( new ActionListener() { |
2 |
26 Feb 07 |
jari |
164 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
165 |
HelpWindow hw = new HelpWindow(SearchResultDialog.this, "Search Result Dialog"); |
2 |
26 Feb 07 |
jari |
166 |
result = JOptionPane.CANCEL_OPTION; |
2 |
26 Feb 07 |
jari |
167 |
if(hw.getWindowContent()){ |
2 |
26 Feb 07 |
jari |
168 |
hw.setSize(450,600); |
2 |
26 Feb 07 |
jari |
169 |
hw.setLocation(); |
2 |
26 Feb 07 |
jari |
170 |
hw.show(); |
2 |
26 Feb 07 |
jari |
171 |
return; |
2 |
26 Feb 07 |
jari |
172 |
} |
2 |
26 Feb 07 |
jari |
173 |
else { |
2 |
26 Feb 07 |
jari |
174 |
hw.setVisible(false); |
2 |
26 Feb 07 |
jari |
175 |
hw.dispose(); |
2 |
26 Feb 07 |
jari |
176 |
return; |
2 |
26 Feb 07 |
jari |
177 |
} |
2 |
26 Feb 07 |
jari |
178 |
} |
2 |
26 Feb 07 |
jari |
179 |
}); |
2 |
26 Feb 07 |
jari |
180 |
|
2 |
26 Feb 07 |
jari |
181 |
resetButton.setVisible(false); |
2 |
26 Feb 07 |
jari |
182 |
cancelButton.setVisible(false); |
2 |
26 Feb 07 |
jari |
183 |
pack(); |
2 |
26 Feb 07 |
jari |
184 |
setSize(550, 400); |
2 |
26 Feb 07 |
jari |
185 |
} |
2 |
26 Feb 07 |
jari |
186 |
|
2 |
26 Feb 07 |
jari |
187 |
|
2 |
26 Feb 07 |
jari |
188 |
|
2 |
26 Feb 07 |
jari |
/** Creates a new SearchResultDialog for list input results |
2 |
26 Feb 07 |
jari |
190 |
*/ |
2 |
26 Feb 07 |
jari |
191 |
public SearchResultDialog(IFramework framework, int [] indices, String [] idList, boolean [] foundTerms, boolean geneResult) { |
2 |
26 Feb 07 |
jari |
192 |
super(framework.getFrame(), "Import Results", true); |
2 |
26 Feb 07 |
jari |
193 |
this.framework = framework; |
2 |
26 Feb 07 |
jari |
194 |
this.isListImportResult = true; |
2 |
26 Feb 07 |
jari |
195 |
this.indices = indices; |
2 |
26 Feb 07 |
jari |
196 |
this.inputIds = idList; |
2 |
26 Feb 07 |
jari |
197 |
|
2 |
26 Feb 07 |
jari |
198 |
this.geneResult = geneResult; |
2 |
26 Feb 07 |
jari |
199 |
|
2 |
26 Feb 07 |
jari |
200 |
this.noViewers = true; |
2 |
26 Feb 07 |
jari |
201 |
|
2 |
26 Feb 07 |
jari |
202 |
initListImportResult(idList, foundTerms); |
2 |
26 Feb 07 |
jari |
203 |
|
2 |
26 Feb 07 |
jari |
204 |
this.expViewHash = null; |
2 |
26 Feb 07 |
jari |
205 |
this.tableViewHash = null; |
2 |
26 Feb 07 |
jari |
206 |
|
2 |
26 Feb 07 |
jari |
//modify buttons |
2 |
26 Feb 07 |
jari |
208 |
resetButton.setVisible(false); |
2 |
26 Feb 07 |
jari |
209 |
okButton.setText("Store Cluster"); |
2 |
26 Feb 07 |
jari |
210 |
okButton.setSize(100,30); |
2 |
26 Feb 07 |
jari |
211 |
okButton.setPreferredSize(new Dimension(100,30)); |
2 |
26 Feb 07 |
jari |
212 |
|
2 |
26 Feb 07 |
jari |
213 |
okButton.addActionListener( new ActionListener() { |
2 |
26 Feb 07 |
jari |
214 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
215 |
result = JOptionPane.OK_OPTION; |
2 |
26 Feb 07 |
jari |
216 |
dispose(); |
2 |
26 Feb 07 |
jari |
217 |
} |
2 |
26 Feb 07 |
jari |
218 |
}); |
2 |
26 Feb 07 |
jari |
219 |
|
2 |
26 Feb 07 |
jari |
220 |
cancelButton.addActionListener( new ActionListener() { |
2 |
26 Feb 07 |
jari |
221 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
222 |
result = JOptionPane.CANCEL_OPTION; |
2 |
26 Feb 07 |
jari |
223 |
dispose(); |
2 |
26 Feb 07 |
jari |
224 |
} |
2 |
26 Feb 07 |
jari |
225 |
}); |
2 |
26 Feb 07 |
jari |
226 |
|
2 |
26 Feb 07 |
jari |
227 |
|
2 |
26 Feb 07 |
jari |
228 |
|
2 |
26 Feb 07 |
jari |
229 |
infoButton.addActionListener( new ActionListener() { |
2 |
26 Feb 07 |
jari |
230 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
231 |
HelpWindow hw = new HelpWindow(SearchResultDialog.this, "Import Result Dialog"); |
2 |
26 Feb 07 |
jari |
232 |
hw.setTitle("Identifier List Import Result"); |
2 |
26 Feb 07 |
jari |
233 |
result = JOptionPane.CANCEL_OPTION; |
2 |
26 Feb 07 |
jari |
234 |
if(hw.getWindowContent()){ |
2 |
26 Feb 07 |
jari |
235 |
hw.setSize(450,600); |
2 |
26 Feb 07 |
jari |
236 |
hw.setLocation(); |
2 |
26 Feb 07 |
jari |
237 |
hw.show(); |
2 |
26 Feb 07 |
jari |
238 |
return; |
2 |
26 Feb 07 |
jari |
239 |
} |
2 |
26 Feb 07 |
jari |
240 |
else { |
2 |
26 Feb 07 |
jari |
241 |
hw.setVisible(false); |
2 |
26 Feb 07 |
jari |
242 |
hw.dispose(); |
2 |
26 Feb 07 |
jari |
243 |
return; |
2 |
26 Feb 07 |
jari |
244 |
} |
2 |
26 Feb 07 |
jari |
245 |
} |
2 |
26 Feb 07 |
jari |
246 |
}); |
2 |
26 Feb 07 |
jari |
247 |
|
2 |
26 Feb 07 |
jari |
248 |
super.validate(); |
2 |
26 Feb 07 |
jari |
249 |
|
2 |
26 Feb 07 |
jari |
250 |
pack(); |
2 |
26 Feb 07 |
jari |
251 |
setSize(550, 500); |
2 |
26 Feb 07 |
jari |
252 |
} |
2 |
26 Feb 07 |
jari |
253 |
|
2 |
26 Feb 07 |
jari |
254 |
|
2 |
26 Feb 07 |
jari |
255 |
private void initFullResult() { |
2 |
26 Feb 07 |
jari |
256 |
|
2 |
26 Feb 07 |
jari |
257 |
expViewNodeList = new JList(new Vector()); |
2 |
26 Feb 07 |
jari |
258 |
tableViewNodeList = new JList(new Vector()); |
2 |
26 Feb 07 |
jari |
259 |
|
2 |
26 Feb 07 |
jari |
260 |
JScrollPane treePane = new JScrollPane(nodeTree); |
2 |
26 Feb 07 |
jari |
261 |
JScrollPane expViewPane = new JScrollPane(expViewNodeList); |
2 |
26 Feb 07 |
jari |
262 |
JScrollPane tableViewPane = new JScrollPane(tableViewNodeList); |
2 |
26 Feb 07 |
jari |
263 |
|
2 |
26 Feb 07 |
jari |
264 |
JPanel mainPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
265 |
mainPanel.setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
266 |
mainPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
//border? |
2 |
26 Feb 07 |
jari |
268 |
|
2 |
26 Feb 07 |
jari |
// ParameterPanel primaryPanel = new ParameterPanel("Result Nodes"); |
2 |
26 Feb 07 |
jari |
270 |
JPanel primaryPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
271 |
primaryPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
272 |
primaryPanel.setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
273 |
primaryPanel.add(treePane, new GridBagConstraints(0,0,1,1,1,1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
274 |
|
2 |
26 Feb 07 |
jari |
275 |
ParameterPanel expViewPanel = new ParameterPanel("Expression Viewers"); |
2 |
26 Feb 07 |
jari |
276 |
expViewPanel.setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
277 |
expViewPanel.add(expViewPane, new GridBagConstraints(0,0,1,1,1,1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
278 |
|
2 |
26 Feb 07 |
jari |
279 |
ParameterPanel tableViewPanel = new ParameterPanel("Table Viewers"); |
2 |
26 Feb 07 |
jari |
280 |
tableViewPanel.setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
281 |
tableViewPanel.add(tableViewPane, new GridBagConstraints(0,0,1,1,1,1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
282 |
|
2 |
26 Feb 07 |
jari |
283 |
if(geneResult) |
2 |
26 Feb 07 |
jari |
284 |
resultTable = new ResultTable("Genes Found", framework.getData(), indices, geneResult, false); |
2 |
26 Feb 07 |
jari |
285 |
else |
2 |
26 Feb 07 |
jari |
286 |
resultTable = new ResultTable("Samples Found", framework.getData(), indices, geneResult, false); |
2 |
26 Feb 07 |
jari |
287 |
|
2 |
26 Feb 07 |
jari |
288 |
ParameterPanel shortCutPanel = new ParameterPanel("Viewer Shortcuts"); |
2 |
26 Feb 07 |
jari |
289 |
shortCutPanel.setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
290 |
|
2 |
26 Feb 07 |
jari |
291 |
shortCutPanel.add(primaryPanel, new GridBagConstraints(0,0,1,2,1.0,1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
292 |
shortCutPanel.add(expViewPanel, new GridBagConstraints(1,0,1,1,1.0,0.5, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
293 |
shortCutPanel.add(tableViewPanel, new GridBagConstraints(1,1,1,1,1.0,0.5, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
294 |
|
2 |
26 Feb 07 |
jari |
295 |
|
2 |
26 Feb 07 |
jari |
296 |
mainPanel.add(resultTable, new GridBagConstraints(0,0,1,1,1.0,1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
297 |
|
2 |
26 Feb 07 |
jari |
298 |
mainPanel.add(shortCutPanel, new GridBagConstraints(0,1,1,1,1.0,1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(10,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
299 |
|
2 |
26 Feb 07 |
jari |
300 |
addContent(mainPanel); |
2 |
26 Feb 07 |
jari |
301 |
} |
2 |
26 Feb 07 |
jari |
302 |
|
2 |
26 Feb 07 |
jari |
303 |
/** |
2 |
26 Feb 07 |
jari |
* Shows the dialog. |
2 |
26 Feb 07 |
jari |
305 |
*/ |
2 |
26 Feb 07 |
jari |
306 |
public int showModal() { |
2 |
26 Feb 07 |
jari |
307 |
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); |
2 |
26 Feb 07 |
jari |
308 |
setLocation((screenSize.width - getSize().width)/2, (screenSize.height - getSize().height)/2); |
2 |
26 Feb 07 |
jari |
309 |
show(); |
2 |
26 Feb 07 |
jari |
310 |
return result; |
2 |
26 Feb 07 |
jari |
311 |
} |
2 |
26 Feb 07 |
jari |
312 |
|
2 |
26 Feb 07 |
jari |
313 |
|
2 |
26 Feb 07 |
jari |
314 |
private void initListImportResult(String [] inputIDs, boolean [] foundIDs) { |
2 |
26 Feb 07 |
jari |
315 |
expViewNodeList = new JList(new Vector()); |
2 |
26 Feb 07 |
jari |
316 |
tableViewNodeList = new JList(new Vector()); |
2 |
26 Feb 07 |
jari |
317 |
|
2 |
26 Feb 07 |
jari |
318 |
JScrollPane treePane = new JScrollPane(nodeTree); |
2 |
26 Feb 07 |
jari |
319 |
JScrollPane expViewPane = new JScrollPane(expViewNodeList); |
2 |
26 Feb 07 |
jari |
320 |
JScrollPane tableViewPane = new JScrollPane(tableViewNodeList); |
2 |
26 Feb 07 |
jari |
321 |
|
2 |
26 Feb 07 |
jari |
322 |
JPanel mainPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
323 |
mainPanel.setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
324 |
mainPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
325 |
|
2 |
26 Feb 07 |
jari |
326 |
Vector found = new Vector(); |
2 |
26 Feb 07 |
jari |
327 |
Vector lost = new Vector(); |
2 |
26 Feb 07 |
jari |
328 |
|
2 |
26 Feb 07 |
jari |
329 |
for(int i = 0; i < foundIDs.length; i++) { |
2 |
26 Feb 07 |
jari |
330 |
if(foundIDs[i]) |
2 |
26 Feb 07 |
jari |
331 |
found.addElement(inputIDs[i]); |
2 |
26 Feb 07 |
jari |
332 |
else |
2 |
26 Feb 07 |
jari |
333 |
lost.addElement(inputIDs[i]); |
2 |
26 Feb 07 |
jari |
334 |
} |
2 |
26 Feb 07 |
jari |
335 |
|
2 |
26 Feb 07 |
jari |
336 |
String resultDescription = "<html><center>"+String.valueOf(found.size())+" of "+String.valueOf(inputIDs.length)+" input IDs were matched.<br>"+ |
2 |
26 Feb 07 |
jari |
337 |
String.valueOf("(List length = "+indices.length+")</center><html>"); |
2 |
26 Feb 07 |
jari |
338 |
|
2 |
26 Feb 07 |
jari |
339 |
if(geneResult) { |
2 |
26 Feb 07 |
jari |
340 |
resultTable = new ResultTable("Genes Matched", framework.getData(), indices, geneResult, true); |
2 |
26 Feb 07 |
jari |
341 |
resultTable.setResultText(resultDescription); |
2 |
26 Feb 07 |
jari |
342 |
} else { |
2 |
26 Feb 07 |
jari |
343 |
resultTable = new ResultTable("Samples Matched", framework.getData(), indices, geneResult, true); |
2 |
26 Feb 07 |
jari |
344 |
resultTable.setResultText(resultDescription); |
2 |
26 Feb 07 |
jari |
345 |
} |
2 |
26 Feb 07 |
jari |
346 |
|
2 |
26 Feb 07 |
jari |
//construct the found and not found lists |
2 |
26 Feb 07 |
jari |
348 |
ParameterPanel lostAndFoundPanel = new ParameterPanel("Matching Results"); |
2 |
26 Feb 07 |
jari |
349 |
lostAndFoundPanel.setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
350 |
|
2 |
26 Feb 07 |
jari |
351 |
JLabel foundLabel = new JLabel("IDs Found ("+found.size()+" of "+inputIDs.length+")"); |
2 |
26 Feb 07 |
jari |
352 |
JScrollPane foundPane = new JScrollPane(new JList(found)); |
2 |
26 Feb 07 |
jari |
353 |
|
2 |
26 Feb 07 |
jari |
354 |
JLabel lostLabel = new JLabel("IDs Not Found ("+lost.size()+" of "+inputIDs.length+")"); |
2 |
26 Feb 07 |
jari |
355 |
JScrollPane lostPane = new JScrollPane(new JList(lost)); |
2 |
26 Feb 07 |
jari |
356 |
|
2 |
26 Feb 07 |
jari |
357 |
lostAndFoundPanel.add(foundLabel, new GridBagConstraints(0,0,1,1,1,.5, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,5,0,15), 0,0)); |
2 |
26 Feb 07 |
jari |
358 |
lostAndFoundPanel.add(lostLabel, new GridBagConstraints(1,0,1,1,1,.5, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,15,0,5), 0,0)); |
2 |
26 Feb 07 |
jari |
359 |
lostAndFoundPanel.add(foundPane, new GridBagConstraints(0,1,1,1,1,1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,5,0,15), 0,0)); |
2 |
26 Feb 07 |
jari |
360 |
lostAndFoundPanel.add(lostPane, new GridBagConstraints(1,1,1,1,1,1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,15,0,5), 0,0)); |
2 |
26 Feb 07 |
jari |
361 |
|
2 |
26 Feb 07 |
jari |
362 |
mainPanel.add(resultTable, new GridBagConstraints(0,0,1,1,1.0,1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
363 |
mainPanel.add(lostAndFoundPanel, new GridBagConstraints(0,1,1,1,1.0,0.5, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
364 |
|
2 |
26 Feb 07 |
jari |
365 |
addContent(mainPanel); |
2 |
26 Feb 07 |
jari |
366 |
} |
2 |
26 Feb 07 |
jari |
367 |
|
2 |
26 Feb 07 |
jari |
368 |
private void initElementOnlyResult() { |
2 |
26 Feb 07 |
jari |
369 |
expViewNodeList = new JList(new Vector()); |
2 |
26 Feb 07 |
jari |
370 |
tableViewNodeList = new JList(new Vector()); |
2 |
26 Feb 07 |
jari |
371 |
|
2 |
26 Feb 07 |
jari |
372 |
JScrollPane treePane = new JScrollPane(nodeTree); |
2 |
26 Feb 07 |
jari |
373 |
JScrollPane expViewPane = new JScrollPane(expViewNodeList); |
2 |
26 Feb 07 |
jari |
374 |
JScrollPane tableViewPane = new JScrollPane(tableViewNodeList); |
2 |
26 Feb 07 |
jari |
375 |
|
2 |
26 Feb 07 |
jari |
376 |
JPanel mainPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
377 |
mainPanel.setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
378 |
mainPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
//border? |
2 |
26 Feb 07 |
jari |
380 |
|
2 |
26 Feb 07 |
jari |
381 |
ParameterPanel emptyViewerPanel = new ParameterPanel("Viewers"); |
2 |
26 Feb 07 |
jari |
382 |
emptyViewerPanel.setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
383 |
|
2 |
26 Feb 07 |
jari |
384 |
JLabel label; |
2 |
26 Feb 07 |
jari |
385 |
|
2 |
26 Feb 07 |
jari |
386 |
if(geneResult) |
2 |
26 Feb 07 |
jari |
387 |
label = new JLabel("<html><body><center>No expression or table viewers were found<br>containing the matching genes.</center></body></html>"); |
2 |
26 Feb 07 |
jari |
388 |
else |
2 |
26 Feb 07 |
jari |
389 |
label = new JLabel("<html><body><center>No expression or table viewers were found<br>containing the matching samples.</center></body></html>"); |
2 |
26 Feb 07 |
jari |
390 |
|
2 |
26 Feb 07 |
jari |
391 |
label.setOpaque(false); |
2 |
26 Feb 07 |
jari |
392 |
label.setHorizontalAlignment(JLabel.CENTER); |
2 |
26 Feb 07 |
jari |
393 |
emptyViewerPanel.add(label, new GridBagConstraints(0,0,1,1,1.0,1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
394 |
|
2 |
26 Feb 07 |
jari |
395 |
if(geneResult) |
2 |
26 Feb 07 |
jari |
396 |
resultTable = new ResultTable("Genes Found", framework.getData(), indices, geneResult, false); |
2 |
26 Feb 07 |
jari |
397 |
else |
2 |
26 Feb 07 |
jari |
398 |
resultTable = new ResultTable("Samples Found", framework.getData(), indices, geneResult, false); |
2 |
26 Feb 07 |
jari |
399 |
|
2 |
26 Feb 07 |
jari |
400 |
mainPanel.add(resultTable, new GridBagConstraints(0,0,1,1,1.0,1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
401 |
mainPanel.add(emptyViewerPanel, new GridBagConstraints(0,1,1,1,1.0,0.3, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,0,0,0),0,0)); |
2 |
26 Feb 07 |
jari |
402 |
|
2 |
26 Feb 07 |
jari |
403 |
addContent(mainPanel); |
2 |
26 Feb 07 |
jari |
404 |
} |
2 |
26 Feb 07 |
jari |
405 |
|
2 |
26 Feb 07 |
jari |
406 |
public static void main(String [] args) { |
2 |
26 Feb 07 |
jari |
407 |
JFrame frame = new JFrame(); |
2 |
26 Feb 07 |
jari |
408 |
frame.setSize(400,400); |
2 |
26 Feb 07 |
jari |
409 |
frame.setVisible(true); |
2 |
26 Feb 07 |
jari |
410 |
|
2 |
26 Feb 07 |
jari |
411 |
DefaultMutableTreeNode root = new DefaultMutableTreeNode("Analysis Results"); |
2 |
26 Feb 07 |
jari |
412 |
DefaultMutableTreeNode a1 = new DefaultMutableTreeNode("KMC - genes(1)"); |
2 |
26 Feb 07 |
jari |
413 |
DefaultMutableTreeNode a2 = new DefaultMutableTreeNode("SOM - genes(2)"); |
2 |
26 Feb 07 |
jari |
414 |
root.add(a1); |
2 |
26 Feb 07 |
jari |
415 |
root.add(a2); |
2 |
26 Feb 07 |
jari |
416 |
|
2 |
26 Feb 07 |
jari |
417 |
DefaultMutableTreeNode c1 = new DefaultMutableTreeNode("Cluster 2"); |
2 |
26 Feb 07 |
jari |
418 |
DefaultMutableTreeNode c2 = new DefaultMutableTreeNode("Cluster 8"); |
2 |
26 Feb 07 |
jari |
419 |
|
2 |
26 Feb 07 |
jari |
420 |
Vector expVector = new Vector(); |
2 |
26 Feb 07 |
jari |
421 |
expVector.add(c1); |
2 |
26 Feb 07 |
jari |
422 |
expVector.add(c2); |
2 |
26 Feb 07 |
jari |
423 |
|
2 |
26 Feb 07 |
jari |
424 |
Hashtable expTable = new Hashtable(); |
2 |
26 Feb 07 |
jari |
425 |
expTable.put(a1, expVector); |
2 |
26 Feb 07 |
jari |
426 |
expTable.put(a2, expVector); |
2 |
26 Feb 07 |
jari |
427 |
|
2 |
26 Feb 07 |
jari |
428 |
Hashtable tabTable = new Hashtable(); |
2 |
26 Feb 07 |
jari |
429 |
tabTable.put(a1, expVector); |
2 |
26 Feb 07 |
jari |
430 |
tabTable.put(a2, expVector); |
2 |
26 Feb 07 |
jari |
431 |
|
2 |
26 Feb 07 |
jari |
432 |
|
2 |
26 Feb 07 |
jari |
433 |
ResultTree tree = new ResultTree(root); |
2 |
26 Feb 07 |
jari |
434 |
|
2 |
26 Feb 07 |
jari |
// SearchResultDialog d = new SearchResultDialog(frame, new AlgorithmData(), tree, expTable, tabTable); |
2 |
26 Feb 07 |
jari |
//d.showModal(); |
2 |
26 Feb 07 |
jari |
437 |
} |
2 |
26 Feb 07 |
jari |
438 |
|
2 |
26 Feb 07 |
jari |
439 |
private void updateLists(DefaultMutableTreeNode node) { |
2 |
26 Feb 07 |
jari |
440 |
|
2 |
26 Feb 07 |
jari |
441 |
Vector v1 = ((Vector)expViewHash.get(node)); |
2 |
26 Feb 07 |
jari |
442 |
if(v1 == null) |
2 |
26 Feb 07 |
jari |
443 |
v1= new Vector(); |
2 |
26 Feb 07 |
jari |
444 |
|
2 |
26 Feb 07 |
jari |
445 |
expViewNodeList.setListData(v1); |
2 |
26 Feb 07 |
jari |
446 |
|
2 |
26 Feb 07 |
jari |
447 |
Vector v2 = ((Vector)tableViewHash.get(node)); |
2 |
26 Feb 07 |
jari |
448 |
if(v2 ==null) |
2 |
26 Feb 07 |
jari |
449 |
v2 = new Vector(); |
2 |
26 Feb 07 |
jari |
450 |
tableViewNodeList.setListData(v2); |
2 |
26 Feb 07 |
jari |
451 |
} |
2 |
26 Feb 07 |
jari |
452 |
|
2 |
26 Feb 07 |
jari |
453 |
private void updateViewerResults(int [] ind) { |
2 |
26 Feb 07 |
jari |
454 |
if(ind.length == 0) { |
2 |
26 Feb 07 |
jari |
455 |
JOptionPane.showMessageDialog(this, "No element indices are selected in the table as a basis for viewer update.", "Empty Element List", JOptionPane.INFORMATION_MESSAGE); |
2 |
26 Feb 07 |
jari |
456 |
return; |
2 |
26 Feb 07 |
jari |
457 |
} else if(ind.length == this.indices.length) { |
2 |
26 Feb 07 |
jari |
458 |
repaint(); |
2 |
26 Feb 07 |
jari |
459 |
return; |
2 |
26 Feb 07 |
jari |
460 |
} |
2 |
26 Feb 07 |
jari |
461 |
|
2 |
26 Feb 07 |
jari |
462 |
ResultTree resultTree = framework.getResultTree(); |
2 |
26 Feb 07 |
jari |
463 |
Vector result = resultTree.findViewerCollection(ind, this.geneResult); |
2 |
26 Feb 07 |
jari |
464 |
|
2 |
26 Feb 07 |
jari |
465 |
if(result != null) { |
2 |
26 Feb 07 |
jari |
466 |
|
2 |
26 Feb 07 |
jari |
467 |
Vector primaryNodes = (Vector)(result.elementAt(0)); |
2 |
26 Feb 07 |
jari |
468 |
Hashtable eViewHash = (Hashtable)(result.elementAt(1)); |
2 |
26 Feb 07 |
jari |
469 |
Hashtable tViewHash = (Hashtable)(result.elementAt(2)); |
2 |
26 Feb 07 |
jari |
470 |
|
2 |
26 Feb 07 |
jari |
471 |
DefaultMutableTreeNode root = new DefaultMutableTreeNode("Analysis Results"); |
2 |
26 Feb 07 |
jari |
472 |
for(int i = 0; i < primaryNodes.size(); i++) { |
2 |
26 Feb 07 |
jari |
473 |
root.add((DefaultMutableTreeNode)(primaryNodes.elementAt(i))); |
2 |
26 Feb 07 |
jari |
474 |
} |
2 |
26 Feb 07 |
jari |
475 |
|
2 |
26 Feb 07 |
jari |
476 |
JTree tree = new JTree(root); |
2 |
26 Feb 07 |
jari |
477 |
|
2 |
26 Feb 07 |
jari |
478 |
SearchResultDialog resultDialog = new SearchResultDialog(this.framework, searchCriteria, tree, eViewHash, tViewHash, ind); |
2 |
26 Feb 07 |
jari |
479 |
resultDialog.showModal(); |
2 |
26 Feb 07 |
jari |
480 |
} |
2 |
26 Feb 07 |
jari |
481 |
|
2 |
26 Feb 07 |
jari |
482 |
} |
2 |
26 Feb 07 |
jari |
483 |
|
2 |
26 Feb 07 |
jari |
484 |
|
2 |
26 Feb 07 |
jari |
485 |
private void storeCluster() { |
2 |
26 Feb 07 |
jari |
486 |
if(geneResult) |
2 |
26 Feb 07 |
jari |
487 |
framework.storeOperationCluster("Search Result", "Selected Genes", this.resultTable.getSelectedIndices(), geneResult); |
2 |
26 Feb 07 |
jari |
488 |
else |
2 |
26 Feb 07 |
jari |
489 |
framework.storeOperationCluster("Search Result", "Selected Samples", this.resultTable.getSelectedIndices(), geneResult); |
2 |
26 Feb 07 |
jari |
490 |
|
2 |
26 Feb 07 |
jari |
491 |
repaint(); |
2 |
26 Feb 07 |
jari |
492 |
} |
2 |
26 Feb 07 |
jari |
493 |
|
2 |
26 Feb 07 |
jari |
494 |
|
2 |
26 Feb 07 |
jari |
495 |
public int [] getSelectedIndices() { |
2 |
26 Feb 07 |
jari |
496 |
return resultTable.getSelectedIndices(); |
2 |
26 Feb 07 |
jari |
497 |
} |
2 |
26 Feb 07 |
jari |
498 |
|
2 |
26 Feb 07 |
jari |
499 |
|
2 |
26 Feb 07 |
jari |
500 |
private class TreeListener implements TreeSelectionListener, ListSelectionListener { |
2 |
26 Feb 07 |
jari |
501 |
|
2 |
26 Feb 07 |
jari |
502 |
public void valueChanged(TreeSelectionEvent treeSelectionEvent) { |
2 |
26 Feb 07 |
jari |
503 |
|
2 |
26 Feb 07 |
jari |
504 |
DefaultMutableTreeNode node = (DefaultMutableTreeNode)nodeTree.getLastSelectedPathComponent(); |
2 |
26 Feb 07 |
jari |
505 |
if(node == null) |
2 |
26 Feb 07 |
jari |
506 |
return; |
2 |
26 Feb 07 |
jari |
507 |
|
2 |
26 Feb 07 |
jari |
508 |
updateLists(node); |
2 |
26 Feb 07 |
jari |
509 |
} |
2 |
26 Feb 07 |
jari |
510 |
|
2 |
26 Feb 07 |
jari |
511 |
public void valueChanged(ListSelectionEvent lse) { |
2 |
26 Feb 07 |
jari |
512 |
JList list = (JList)lse.getSource(); |
2 |
26 Feb 07 |
jari |
513 |
if(list == expViewNodeList) |
2 |
26 Feb 07 |
jari |
514 |
tableViewNodeList.clearSelection(); |
2 |
26 Feb 07 |
jari |
515 |
else |
2 |
26 Feb 07 |
jari |
516 |
expViewNodeList.clearSelection(); |
2 |
26 Feb 07 |
jari |
517 |
|
2 |
26 Feb 07 |
jari |
518 |
DefaultMutableTreeNode node = (DefaultMutableTreeNode)(list.getSelectedValue()); |
2 |
26 Feb 07 |
jari |
519 |
if(node != null && framework != null) |
2 |
26 Feb 07 |
jari |
520 |
framework.setTreeNode(node); |
2 |
26 Feb 07 |
jari |
521 |
} |
2 |
26 Feb 07 |
jari |
522 |
|
2 |
26 Feb 07 |
jari |
523 |
} |
2 |
26 Feb 07 |
jari |
524 |
|
2 |
26 Feb 07 |
jari |
525 |
|
2 |
26 Feb 07 |
jari |
526 |
|
2 |
26 Feb 07 |
jari |
527 |
private class ResultTable extends ParameterPanel { |
2 |
26 Feb 07 |
jari |
528 |
|
2 |
26 Feb 07 |
jari |
529 |
private JTable table; |
2 |
26 Feb 07 |
jari |
530 |
private ResultDataModel model; |
2 |
26 Feb 07 |
jari |
531 |
private JLabel elementLabel; |
2 |
26 Feb 07 |
jari |
532 |
private JButton updateViewerListsButton; |
2 |
26 Feb 07 |
jari |
533 |
private JButton saveClusterButton; |
2 |
26 Feb 07 |
jari |
534 |
|
2 |
26 Feb 07 |
jari |
535 |
public ResultTable(String title, IData data, int [] indices, boolean geneResult, boolean listImportResult) { |
2 |
26 Feb 07 |
jari |
536 |
super(title); |
2 |
26 Feb 07 |
jari |
537 |
setLayout(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
538 |
|
2 |
26 Feb 07 |
jari |
539 |
String [] headerNames; |
2 |
26 Feb 07 |
jari |
540 |
String [] fields; |
2 |
26 Feb 07 |
jari |
541 |
if(geneResult) { |
2 |
26 Feb 07 |
jari |
542 |
fields = data.getFieldNames(); |
2 |
26 Feb 07 |
jari |
543 |
headerNames = new String[fields.length+3]; |
2 |
26 Feb 07 |
jari |
544 |
headerNames[0] = "Selected"; |
2 |
26 Feb 07 |
jari |
545 |
headerNames[1] = "File Index"; |
2 |
26 Feb 07 |
jari |
546 |
headerNames[2] = "Color"; |
2 |
26 Feb 07 |
jari |
547 |
for(int i = 0; i < fields.length; i++) { |
2 |
26 Feb 07 |
jari |
548 |
headerNames[i+3] = fields[i]; |
2 |
26 Feb 07 |
jari |
549 |
} |
2 |
26 Feb 07 |
jari |
550 |
} else { |
2 |
26 Feb 07 |
jari |
551 |
Vector slideKeys = getSlideNameKeyVectorUnion(data); |
2 |
26 Feb 07 |
jari |
552 |
headerNames = new String[slideKeys.size()+3]; |
2 |
26 Feb 07 |
jari |
553 |
headerNames[0] = "Selected"; |
2 |
26 Feb 07 |
jari |
554 |
headerNames[1] = "File Index"; |
2 |
26 Feb 07 |
jari |
555 |
headerNames[2] = "Color"; |
2 |
26 Feb 07 |
jari |
556 |
for(int i = 0; i < slideKeys.size(); i++) { |
2 |
26 Feb 07 |
jari |
557 |
headerNames[i+3] = (String)(slideKeys.elementAt(i)); |
2 |
26 Feb 07 |
jari |
558 |
} |
2 |
26 Feb 07 |
jari |
559 |
} |
2 |
26 Feb 07 |
jari |
560 |
|
2 |
26 Feb 07 |
jari |
561 |
model = new ResultDataModel(data, indices, headerNames, geneResult); |
2 |
26 Feb 07 |
jari |
562 |
table = new JTable(model); |
2 |
26 Feb 07 |
jari |
563 |
table.setCellSelectionEnabled(true); |
2 |
26 Feb 07 |
jari |
564 |
table.getColumn("Color").setCellRenderer(new SearchTableCellRenderer()); |
2 |
26 Feb 07 |
jari |
565 |
|
2 |
26 Feb 07 |
jari |
566 |
JScrollPane pane = new JScrollPane(table); |
2 |
26 Feb 07 |
jari |
567 |
pane.setColumnHeaderView(table.getTableHeader()); |
2 |
26 Feb 07 |
jari |
568 |
|
2 |
26 Feb 07 |
jari |
569 |
if(!listImportResult) { |
2 |
26 Feb 07 |
jari |
570 |
if(geneResult) |
2 |
26 Feb 07 |
jari |
571 |
elementLabel = new JLabel("Number of genes matching the search: "+indices.length); |
2 |
26 Feb 07 |
jari |
572 |
else |
2 |
26 Feb 07 |
jari |
573 |
elementLabel = new JLabel("Number of samples matching the search: "+indices.length); |
2 |
26 Feb 07 |
jari |
574 |
} else { |
2 |
26 Feb 07 |
jari |
575 |
if(geneResult) |
2 |
26 Feb 07 |
jari |
576 |
elementLabel = new JLabel("<html>Number of genes matching the "+inputIds.length+" input ids : "+indices.length+"<br>(Note that replicates for an id may exist)</html>"); |
2 |
26 Feb 07 |
jari |
577 |
else |
2 |
26 Feb 07 |
jari |
578 |
elementLabel = new JLabel("<html>Number of samples matching the "+inputIds.length+" input ids : "+indices.length); |
2 |
26 Feb 07 |
jari |
579 |
} |
2 |
26 Feb 07 |
jari |
580 |
elementLabel.setBorder(BorderFactory.createLineBorder(Color.black)); |
2 |
26 Feb 07 |
jari |
581 |
elementLabel.setOpaque(true); |
2 |
26 Feb 07 |
jari |
582 |
elementLabel.setBackground(Color.lightGray); |
2 |
26 Feb 07 |
jari |
583 |
elementLabel.setHorizontalAlignment(JLabel.CENTER); |
2 |
26 Feb 07 |
jari |
584 |
|
2 |
26 Feb 07 |
jari |
//buttons to clear, select all, and modify viewer results on subset selected. |
2 |
26 Feb 07 |
jari |
586 |
ButtonListener listener = new ButtonListener(); |
2 |
26 Feb 07 |
jari |
587 |
|
2 |
26 Feb 07 |
jari |
588 |
JButton clearButton = new JButton("Clear"); |
2 |
26 Feb 07 |
jari |
589 |
clearButton.setActionCommand("clear-all-command"); |
2 |
26 Feb 07 |
jari |
590 |
clearButton.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
591 |
clearButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
592 |
clearButton.setPreferredSize(new Dimension(80, 30)); |
2 |
26 Feb 07 |
jari |
593 |
clearButton.setSize(80,30); |
2 |
26 Feb 07 |
jari |
594 |
|
2 |
26 Feb 07 |
jari |
595 |
JButton selectAllButton = new JButton("Select All"); |
2 |
26 Feb 07 |
jari |
596 |
selectAllButton.setActionCommand("select-all-command"); |
2 |
26 Feb 07 |
jari |
597 |
selectAllButton.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
598 |
selectAllButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
599 |
selectAllButton.setPreferredSize(new Dimension(80, 30)); |
2 |
26 Feb 07 |
jari |
600 |
selectAllButton.setSize(80,30); |
2 |
26 Feb 07 |
jari |
601 |
|
2 |
26 Feb 07 |
jari |
602 |
if(!listImportResult) { |
2 |
26 Feb 07 |
jari |
603 |
saveClusterButton = new JButton("Store Cluster"); |
2 |
26 Feb 07 |
jari |
604 |
saveClusterButton.setActionCommand("store-cluster-command"); |
2 |
26 Feb 07 |
jari |
605 |
saveClusterButton.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
606 |
saveClusterButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
607 |
saveClusterButton.setPreferredSize(new Dimension(100, 30)); |
2 |
26 Feb 07 |
jari |
608 |
saveClusterButton.setSize(100,30); |
2 |
26 Feb 07 |
jari |
609 |
|
2 |
26 Feb 07 |
jari |
610 |
updateViewerListsButton = new JButton("Update Shortcuts"); |
2 |
26 Feb 07 |
jari |
611 |
updateViewerListsButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
612 |
updateViewerListsButton.setActionCommand("update-viewer-lists-command"); |
2 |
26 Feb 07 |
jari |
613 |
updateViewerListsButton.addActionListener(listener); |
2 |
26 Feb 07 |
jari |
614 |
updateViewerListsButton.setFocusPainted(false); |
2 |
26 Feb 07 |
jari |
615 |
updateViewerListsButton.setPreferredSize(new Dimension(100, 30)); |
2 |
26 Feb 07 |
jari |
616 |
updateViewerListsButton.setSize(100,30); |
2 |
26 Feb 07 |
jari |
617 |
} |
2 |
26 Feb 07 |
jari |
618 |
|
2 |
26 Feb 07 |
jari |
619 |
JPanel buttonPanel = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
620 |
buttonPanel.setOpaque(false); |
2 |
26 Feb 07 |
jari |
621 |
|
2 |
26 Feb 07 |
jari |
622 |
if(!listImportResult) { |
2 |
26 Feb 07 |
jari |
623 |
buttonPanel.add(selectAllButton, new GridBagConstraints(0,0,1,1,0.5,1.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0,5,0,0), 0,0)); |
2 |
26 Feb 07 |
jari |
624 |
buttonPanel.add(clearButton, new GridBagConstraints(1,0,1,1,0.5,1.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0,5,0,0), 0,0)); |
2 |
26 Feb 07 |
jari |
625 |
buttonPanel.add(saveClusterButton, new GridBagConstraints(2,0,1,1,0.5,1.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0,20,0,0), 0,0)); |
2 |
26 Feb 07 |
jari |
626 |
buttonPanel.add(updateViewerListsButton, new GridBagConstraints(3,0,1,1,1.0,1.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0,30,0,0), 0,0)); |
2 |
26 Feb 07 |
jari |
627 |
|
2 |
26 Feb 07 |
jari |
628 |
add(elementLabel, new GridBagConstraints(0,0,1,1,1.0,0.3, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,5,5,5), 0,0)); |
2 |
26 Feb 07 |
jari |
629 |
add(pane, new GridBagConstraints(0,1,1,1,1.0,1.3, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5,5,5,5), 0,0)); |
2 |
26 Feb 07 |
jari |
630 |
add(buttonPanel, new GridBagConstraints(0,2,1,1,1.0,0.3, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5,5,5,5), 0,0)); |
2 |
26 Feb 07 |
jari |
631 |
|
2 |
26 Feb 07 |
jari |
632 |
setPreferredSize(new Dimension(450, 150)); |
2 |
26 Feb 07 |
jari |
633 |
setSize(450, 150); |
2 |
26 Feb 07 |
jari |
634 |
|
2 |
26 Feb 07 |
jari |
635 |
} else { |
2 |
26 Feb 07 |
jari |
636 |
buttonPanel.add(selectAllButton, new GridBagConstraints(0,0,1,1,0.5,1.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0,25,0,15), 0,0)); |
2 |
26 Feb 07 |
jari |
637 |
buttonPanel.add(clearButton, new GridBagConstraints(1,0,1,1,0.5,1.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0,15,0,25), 0,0)); |
2 |
26 Feb 07 |
jari |
638 |
|
2 |
26 Feb 07 |
jari |
639 |
add(elementLabel, new GridBagConstraints(0,0,1,1,1.0,0.3, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0,5,5,5), 0,0)); |
2 |
26 Feb 07 |
jari |
640 |
add(pane, new GridBagConstraints(0,1,1,1,1.0,1.3, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5,5,5,5), 0,0)); |
2 |
26 Feb 07 |
jari |
641 |
add(buttonPanel, new GridBagConstraints(0,2,1,1,1.0,0.3, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5,5,5,5), 0,0)); |
2 |
26 Feb 07 |
jari |
642 |
|
2 |
26 Feb 07 |
jari |
643 |
setPreferredSize(new Dimension(450, 200)); |
2 |
26 Feb 07 |
jari |
644 |
setSize(450, 200); |
2 |
26 Feb 07 |
jari |
645 |
} |
2 |
26 Feb 07 |
jari |
646 |
|
2 |
26 Feb 07 |
jari |
647 |
|
2 |
26 Feb 07 |
jari |
648 |
} |
2 |
26 Feb 07 |
jari |
649 |
|
2 |
26 Feb 07 |
jari |
650 |
public void setResultText(String text) { |
2 |
26 Feb 07 |
jari |
651 |
elementLabel.setText(text); |
2 |
26 Feb 07 |
jari |
652 |
validate(); |
2 |
26 Feb 07 |
jari |
653 |
} |
2 |
26 Feb 07 |
jari |
654 |
|
2 |
26 Feb 07 |
jari |
655 |
/** |
2 |
26 Feb 07 |
jari |
* Returns the key vector for the sample with the longest sample name key list |
2 |
26 Feb 07 |
jari |
657 |
*/ |
2 |
26 Feb 07 |
jari |
658 |
public Vector getSlideNameKeyVectorUnion(IData data) { |
2 |
26 Feb 07 |
jari |
659 |
Vector keyVector; |
2 |
26 Feb 07 |
jari |
660 |
Vector fullKeyVector = new Vector(); |
2 |
26 Feb 07 |
jari |
661 |
String key; |
2 |
26 Feb 07 |
jari |
662 |
for( int i = 0; i < data.getFeaturesCount(); i++) { |
2 |
26 Feb 07 |
jari |
663 |
keyVector = (data.getFeature(i)).getSlideDataKeys(); |
2 |
26 Feb 07 |
jari |
664 |
for(int j = 0; j < keyVector.size(); j++) { |
2 |
26 Feb 07 |
jari |
665 |
key = (String)(keyVector.elementAt(j)); |
2 |
26 Feb 07 |
jari |
666 |
if(!fullKeyVector.contains(key)) |
2 |
26 Feb 07 |
jari |
667 |
fullKeyVector.addElement(key); |
2 |
26 Feb 07 |
jari |
668 |
} |
2 |
26 Feb 07 |
jari |
669 |
} |
2 |
26 Feb 07 |
jari |
670 |
return fullKeyVector; |
2 |
26 Feb 07 |
jari |
671 |
} |
2 |
26 Feb 07 |
jari |
672 |
|
2 |
26 Feb 07 |
jari |
673 |
private int [] getSelectedIndices() { |
2 |
26 Feb 07 |
jari |
674 |
return model.getSelectedIndices(); |
2 |
26 Feb 07 |
jari |
675 |
} |
2 |
26 Feb 07 |
jari |
676 |
|
2 |
26 Feb 07 |
jari |
677 |
private class ResultDataModel extends AbstractTableModel { |
2 |
26 Feb 07 |
jari |
678 |
private IData data; |
2 |
26 Feb 07 |
jari |
679 |
private int [] indices; |
2 |
26 Feb 07 |
jari |
680 |
private boolean [] selected; |
2 |
26 Feb 07 |
jari |
681 |
private String [] headerNames; |
2 |
26 Feb 07 |
jari |
682 |
private int columnCount, rowCount; |
2 |
26 Feb 07 |
jari |
683 |
private String value; |
2 |
26 Feb 07 |
jari |
684 |
private boolean geneResult; |
2 |
26 Feb 07 |
jari |
685 |
private JCheckBox checkBox; |
2 |
26 Feb 07 |
jari |
686 |
private JLabel colorLabel; |
2 |
26 Feb 07 |
jari |
687 |
|
2 |
26 Feb 07 |
jari |
688 |
public ResultDataModel(IData data, int [] indices, String [] headerNames, boolean geneResult) { |
2 |
26 Feb 07 |
jari |
689 |
this.data = data; |
2 |
26 Feb 07 |
jari |
690 |
this.indices = indices; |
2 |
26 Feb 07 |
jari |
691 |
this.headerNames = headerNames; |
2 |
26 Feb 07 |
jari |
692 |
this.geneResult = geneResult; |
2 |
26 Feb 07 |
jari |
693 |
this.checkBox = new JCheckBox(); |
2 |
26 Feb 07 |
jari |
694 |
colorLabel = new JLabel(); |
2 |
26 Feb 07 |
jari |
695 |
colorLabel.setOpaque(true); |
2 |
26 Feb 07 |
jari |
696 |
columnCount = headerNames.length; |
2 |
26 Feb 07 |
jari |
697 |
rowCount = indices.length; |
2 |
26 Feb 07 |
jari |
698 |
selected = new boolean[rowCount]; |
2 |
26 Feb 07 |
jari |
699 |
for(int i = 0; i < selected.length; i++) |
2 |
26 Feb 07 |
jari |
700 |
selected[i] = true; |
2 |
26 Feb 07 |
jari |
701 |
} |
2 |
26 Feb 07 |
jari |
702 |
|
2 |
26 Feb 07 |
jari |
703 |
|
2 |
26 Feb 07 |
jari |
704 |
|
2 |
26 Feb 07 |
jari |
705 |
|
2 |
26 Feb 07 |
jari |
706 |
public Object getValueAt(int row, int col) { |
2 |
26 Feb 07 |
jari |
707 |
if(col == 0) { |
2 |
26 Feb 07 |
jari |
708 |
return new Boolean(selected[row]); |
2 |
26 Feb 07 |
jari |
709 |
} else if(col == 1) { |
2 |
26 Feb 07 |
jari |
710 |
return Integer.toString(indices[row]); |
2 |
26 Feb 07 |
jari |
711 |
} else if(col == 2) { |
2 |
26 Feb 07 |
jari |
712 |
Color color = data.getProbeColor(indices[row]); |
2 |
26 Feb 07 |
jari |
713 |
if(color != null) |
2 |
26 Feb 07 |
jari |
714 |
return color; |
2 |
26 Feb 07 |
jari |
715 |
else |
2 |
26 Feb 07 |
jari |
716 |
return Color.white; |
2 |
26 Feb 07 |
jari |
717 |
} |
2 |
26 Feb 07 |
jari |
718 |
|
2 |
26 Feb 07 |
jari |
719 |
if(geneResult) |
2 |
26 Feb 07 |
jari |
720 |
value = data.getElementAttribute(indices[row], col-3); |
2 |
26 Feb 07 |
jari |
721 |
else |
2 |
26 Feb 07 |
jari |
722 |
value = (String)(data.getFeature(indices[row]).getSlideDataLabels().get(headerNames[col])); |
2 |
26 Feb 07 |
jari |
723 |
|
2 |
26 Feb 07 |
jari |
724 |
if(value == null) |
2 |
26 Feb 07 |
jari |
725 |
value = " "; |
2 |
26 Feb 07 |
jari |
726 |
return value; |
2 |
26 Feb 07 |
jari |
727 |
} |
2 |
26 Feb 07 |
jari |
728 |
|
2 |
26 Feb 07 |
jari |
729 |
public void setValueAt(Object value, int row, int col) { |
2 |
26 Feb 07 |
jari |
730 |
if(col == 0) { |
2 |
26 Feb 07 |
jari |
731 |
selected[row] = ((Boolean)value).booleanValue(); |
2 |
26 Feb 07 |
jari |
732 |
if(!isListImportResult) |
2 |
26 Feb 07 |
jari |
733 |
updateViewerListsButton.setEnabled(true); |
2 |
26 Feb 07 |
jari |
734 |
} |
2 |
26 Feb 07 |
jari |
735 |
} |
2 |
26 Feb 07 |
jari |
736 |
|
2 |
26 Feb 07 |
jari |
/** Accesses column class information. |
2 |
26 Feb 07 |
jari |
* @param columnIndex int column index |
2 |
26 Feb 07 |
jari |
* @return Returns the class associated with the column index. |
2 |
26 Feb 07 |
jari |
740 |
*/ |
2 |
26 Feb 07 |
jari |
741 |
public Class getColumnClass(int columnIndex) { |
2 |
26 Feb 07 |
jari |
742 |
if(columnIndex == 0) |
2 |
26 Feb 07 |
jari |
743 |
return Boolean.class; |
2 |
26 Feb 07 |
jari |
744 |
else |
2 |
26 Feb 07 |
jari |
745 |
return String.class; |
2 |
26 Feb 07 |
jari |
746 |
} |
2 |
26 Feb 07 |
jari |
747 |
|
2 |
26 Feb 07 |
jari |
748 |
public boolean isCellEditable(int rowIndex, int columnIndex) { |
2 |
26 Feb 07 |
jari |
749 |
return (columnIndex == 0); |
2 |
26 Feb 07 |
jari |
750 |
} |
2 |
26 Feb 07 |
jari |
751 |
|
2 |
26 Feb 07 |
jari |
752 |
public int getColumnCount() { |
2 |
26 Feb 07 |
jari |
753 |
return columnCount; |
2 |
26 Feb 07 |
jari |
754 |
} |
2 |
26 Feb 07 |
jari |
755 |
|
2 |
26 Feb 07 |
jari |
756 |
public int getRowCount() { |
2 |
26 Feb 07 |
jari |
757 |
return rowCount; |
2 |
26 Feb 07 |
jari |
758 |
} |
2 |
26 Feb 07 |
jari |
759 |
|
2 |
26 Feb 07 |
jari |
760 |
public String getColumnName(int col) { |
2 |
26 Feb 07 |
jari |
761 |
return headerNames[col]; |
2 |
26 Feb 07 |
jari |
762 |
} |
2 |
26 Feb 07 |
jari |
763 |
|
2 |
26 Feb 07 |
jari |
764 |
public void selectAll() { |
2 |
26 Feb 07 |
jari |
765 |
for(int i = 0; i < selected.length; i++) |
2 |
26 Feb 07 |
jari |
766 |
selected[i] = true; |
2 |
26 Feb 07 |
jari |
767 |
table.repaint(); |
2 |
26 Feb 07 |
jari |
768 |
} |
2 |
26 Feb 07 |
jari |
769 |
|
2 |
26 Feb 07 |
jari |
770 |
public void clearAll() { |
2 |
26 Feb 07 |
jari |
771 |
for(int i = 0; i < selected.length; i++) |
2 |
26 Feb 07 |
jari |
772 |
selected[i] = false; |
2 |
26 Feb 07 |
jari |
773 |
table.repaint(); |
2 |
26 Feb 07 |
jari |
774 |
} |
2 |
26 Feb 07 |
jari |
775 |
|
2 |
26 Feb 07 |
jari |
776 |
public int [] getSelectedIndices() { |
2 |
26 Feb 07 |
jari |
777 |
Vector indices = new Vector(); |
2 |
26 Feb 07 |
jari |
778 |
for(int i = 0; i < selected.length; i++) { |
2 |
26 Feb 07 |
jari |
779 |
if(selected[i]) |
2 |
26 Feb 07 |
jari |
780 |
indices.add(new Integer((String)(model.getValueAt(i, 1)))); |
2 |
26 Feb 07 |
jari |
781 |
} |
2 |
26 Feb 07 |
jari |
782 |
|
2 |
26 Feb 07 |
jari |
783 |
int [] newIndices = new int[indices.size()]; |
2 |
26 Feb 07 |
jari |
784 |
|
2 |
26 Feb 07 |
jari |
785 |
for(int i = 0; i < newIndices.length; i++) { |
2 |
26 Feb 07 |
jari |
786 |
newIndices[i] = ((Integer)(indices.elementAt(i))).intValue(); |
2 |
26 Feb 07 |
jari |
787 |
} |
2 |
26 Feb 07 |
jari |
788 |
return newIndices; |
2 |
26 Feb 07 |
jari |
789 |
} |
2 |
26 Feb 07 |
jari |
790 |
} |
2 |
26 Feb 07 |
jari |
791 |
|
2 |
26 Feb 07 |
jari |
792 |
private class SearchTableCellRenderer implements TableCellRenderer { |
2 |
26 Feb 07 |
jari |
793 |
JPanel colorPanel; |
2 |
26 Feb 07 |
jari |
794 |
|
2 |
26 Feb 07 |
jari |
795 |
public SearchTableCellRenderer() { |
2 |
26 Feb 07 |
jari |
796 |
colorPanel = new JPanel(); |
2 |
26 Feb 07 |
jari |
797 |
colorPanel.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
798 |
} |
2 |
26 Feb 07 |
jari |
799 |
|
2 |
26 Feb 07 |
jari |
800 |
public Component getTableCellRendererComponent(JTable jTable, Object obj, boolean param, boolean param3, int param4, int param5) { |
2 |
26 Feb 07 |
jari |
801 |
colorPanel.setBackground((Color)obj); |
2 |
26 Feb 07 |
jari |
802 |
return colorPanel; |
2 |
26 Feb 07 |
jari |
803 |
} |
2 |
26 Feb 07 |
jari |
804 |
} |
2 |
26 Feb 07 |
jari |
805 |
|
2 |
26 Feb 07 |
jari |
806 |
|
2 |
26 Feb 07 |
jari |
807 |
|
2 |
26 Feb 07 |
jari |
808 |
private class ButtonListener implements ActionListener { |
2 |
26 Feb 07 |
jari |
809 |
public void actionPerformed(ActionEvent ae) { |
2 |
26 Feb 07 |
jari |
810 |
String command = ae.getActionCommand(); |
2 |
26 Feb 07 |
jari |
811 |
if(command.equals("select-all-command")) { |
2 |
26 Feb 07 |
jari |
812 |
model.selectAll(); |
2 |
26 Feb 07 |
jari |
813 |
if(!isListImportResult) |
2 |
26 Feb 07 |
jari |
814 |
updateViewerListsButton.setEnabled(true); |
2 |
26 Feb 07 |
jari |
815 |
} else if(command.equals("clear-all-command")) { |
2 |
26 Feb 07 |
jari |
816 |
model.clearAll(); |
2 |
26 Feb 07 |
jari |
817 |
if(!isListImportResult) |
2 |
26 Feb 07 |
jari |
818 |
updateViewerListsButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
819 |
} else if(command.equals("update-viewer-lists-command")) { |
2 |
26 Feb 07 |
jari |
820 |
updateViewerResults(model.getSelectedIndices()); |
2 |
26 Feb 07 |
jari |
//updateViewerListsButton.setEnabled(false); |
2 |
26 Feb 07 |
jari |
822 |
} else if(command.equals("store-cluster-command")) { |
2 |
26 Feb 07 |
jari |
823 |
storeCluster(); |
2 |
26 Feb 07 |
jari |
824 |
} |
2 |
26 Feb 07 |
jari |
825 |
|
2 |
26 Feb 07 |
jari |
826 |
} |
2 |
26 Feb 07 |
jari |
827 |
} |
2 |
26 Feb 07 |
jari |
828 |
} |
2 |
26 Feb 07 |
jari |
829 |
|
2 |
26 Feb 07 |
jari |
830 |
} |