1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.gui; |
22 |
|
|
23 |
|
import java.awt.BorderLayout; |
24 |
|
import java.awt.Color; |
25 |
|
import java.awt.Dimension; |
26 |
|
import java.awt.Graphics; |
27 |
|
import java.awt.event.ActionEvent; |
28 |
|
import java.awt.event.ActionListener; |
29 |
|
import java.awt.print.PageFormat; |
30 |
|
import java.awt.print.Printable; |
31 |
|
import java.awt.print.PrinterException; |
32 |
|
import java.awt.print.PrinterJob; |
33 |
|
|
34 |
|
import javax.swing.ButtonGroup; |
35 |
|
import javax.swing.JMenuItem; |
36 |
|
import javax.swing.JProgressBar; |
37 |
|
import javax.swing.JRadioButtonMenuItem; |
38 |
|
import javax.swing.event.InternalFrameAdapter; |
39 |
|
import javax.swing.event.InternalFrameEvent; |
40 |
|
|
41 |
|
import jalview.analysis.scoremodels.ScoreModels; |
42 |
|
import jalview.api.AlignViewportI; |
43 |
|
import jalview.api.analysis.ScoreModelI; |
44 |
|
import jalview.api.analysis.SimilarityParamsI; |
45 |
|
import jalview.bin.Console; |
46 |
|
import jalview.datamodel.Alignment; |
47 |
|
import jalview.datamodel.AlignmentI; |
48 |
|
import jalview.datamodel.AlignmentView; |
49 |
|
import jalview.datamodel.HiddenColumns; |
50 |
|
import jalview.datamodel.SequenceI; |
51 |
|
import jalview.gui.ImageExporter.ImageWriterI; |
52 |
|
import jalview.gui.JalviewColourChooser.ColourChooserListener; |
53 |
|
import jalview.io.exceptions.ImageOutputException; |
54 |
|
import jalview.jbgui.GPCAPanel; |
55 |
|
import jalview.math.RotatableMatrix.Axis; |
56 |
|
import jalview.util.ImageMaker; |
57 |
|
import jalview.util.MessageManager; |
58 |
|
import jalview.viewmodel.AlignmentViewport; |
59 |
|
import jalview.viewmodel.PCAModel; |
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
|
|
| 0% |
Uncovered Elements: 249 (249) |
Complexity: 66 |
Complexity Density: 0.36 |
|
64 |
|
public class PCAPanel extends SpatialPanel |
65 |
|
implements Runnable, IProgressIndicator |
66 |
|
{ |
67 |
|
private static final int MIN_WIDTH = 470; |
68 |
|
|
69 |
|
private static final int MIN_HEIGHT = 250; |
70 |
|
|
71 |
|
private RotatableCanvas rc; |
72 |
|
|
73 |
|
AlignmentPanel ap; |
74 |
|
|
75 |
|
AlignmentViewport av; |
76 |
|
|
77 |
|
private PCAModel pcaModel; |
78 |
|
|
79 |
|
private int top = 0; |
80 |
|
|
81 |
|
private IProgressIndicator progressBar; |
82 |
|
|
83 |
|
private boolean working; |
84 |
|
|
85 |
|
String newPcaTitle = null; |
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
@param |
91 |
|
@param |
92 |
|
@param |
93 |
|
|
|
|
| 0% |
Uncovered Elements: 23 (23) |
Complexity: 2 |
Complexity Density: 0.1 |
|
94 |
0 |
public PCAPanel(AlignmentPanel alignPanel, String modelName,... |
95 |
|
SimilarityParamsI params) |
96 |
|
{ |
97 |
0 |
super(); |
98 |
0 |
this.setFrameIcon(null); |
99 |
0 |
this.av = alignPanel.av; |
100 |
0 |
this.ap = alignPanel; |
101 |
0 |
boolean nucleotide = av.getAlignment().isNucleotide(); |
102 |
|
|
103 |
0 |
progressBar = new ProgressBar(statusPanel, statusBar); |
104 |
|
|
105 |
0 |
addInternalFrameListener(new InternalFrameAdapter() |
106 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
107 |
0 |
@Override... |
108 |
|
public void internalFrameClosed(InternalFrameEvent e) |
109 |
|
{ |
110 |
0 |
close_actionPerformed(); |
111 |
|
} |
112 |
|
}); |
113 |
|
|
114 |
0 |
boolean selected = av.getSelectionGroup() != null |
115 |
|
&& av.getSelectionGroup().getSize() > 0; |
116 |
0 |
AlignmentView seqstrings = av.getAlignmentView(selected); |
117 |
0 |
SequenceI[] seqs; |
118 |
0 |
if (!selected) |
119 |
|
{ |
120 |
0 |
seqs = av.getAlignment().getSequencesArray(); |
121 |
|
} |
122 |
|
else |
123 |
|
{ |
124 |
0 |
seqs = av.getSelectionGroup().getSequencesInOrder(av.getAlignment()); |
125 |
|
} |
126 |
|
|
127 |
0 |
ScoreModelI scoreModel = ScoreModels.getInstance() |
128 |
|
.getScoreModel(modelName, ap); |
129 |
0 |
setPcaModel( |
130 |
|
new PCAModel(seqstrings, seqs, nucleotide, scoreModel, params)); |
131 |
|
|
132 |
0 |
newPcaTitle = alignPanel.alignFrame.formCalculationTitle( |
133 |
|
MessageManager.formatMessage("label.calc_title", "PCA", |
134 |
|
getPcaModel().getScoreModelName()), |
135 |
|
selected, ap.alignFrame.getTitle()); |
136 |
|
|
137 |
0 |
PaintRefresher.Register(this, av.getSequenceSetId()); |
138 |
|
|
139 |
0 |
setRotatableCanvas(new RotatableCanvas(alignPanel)); |
140 |
0 |
this.getContentPane().add(getRotatableCanvas(), BorderLayout.CENTER); |
141 |
|
|
142 |
0 |
addKeyListener(getRotatableCanvas()); |
143 |
0 |
validate(); |
144 |
|
} |
145 |
|
|
146 |
|
|
147 |
|
|
148 |
|
|
149 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
150 |
0 |
protected void close_actionPerformed()... |
151 |
|
{ |
152 |
0 |
setPcaModel(null); |
153 |
0 |
if (this.rc != null) |
154 |
|
{ |
155 |
0 |
this.rc.sequencePoints = null; |
156 |
0 |
this.rc.setAxisEndPoints(null); |
157 |
0 |
this.rc = null; |
158 |
|
} |
159 |
|
} |
160 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
161 |
0 |
@Override... |
162 |
|
protected void bgcolour_actionPerformed() |
163 |
|
{ |
164 |
0 |
String ttl = MessageManager.getString("label.select_background_colour"); |
165 |
0 |
ColourChooserListener listener = new ColourChooserListener() |
166 |
|
{ |
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
167 |
0 |
@Override... |
168 |
|
public void colourSelected(Color c) |
169 |
|
{ |
170 |
0 |
rc.setBgColour(c); |
171 |
0 |
rc.repaint(); |
172 |
|
} |
173 |
|
}; |
174 |
0 |
JalviewColourChooser.showColourChooser(this, ttl, rc.getBgColour(), |
175 |
|
listener); |
176 |
|
} |
177 |
|
|
178 |
|
|
179 |
|
|
180 |
|
|
|
|
| 0% |
Uncovered Elements: 28 (28) |
Complexity: 4 |
Complexity Density: 0.17 |
|
181 |
0 |
@Override... |
182 |
|
public void run() |
183 |
|
{ |
184 |
0 |
working = true; |
185 |
0 |
long progId = System.currentTimeMillis(); |
186 |
0 |
IProgressIndicator progress = this; |
187 |
0 |
String message = MessageManager.getString("label.pca_recalculating"); |
188 |
0 |
if (getParent() == null) |
189 |
|
{ |
190 |
0 |
progress = ap.alignFrame; |
191 |
0 |
message = MessageManager.getString("label.pca_calculating"); |
192 |
|
} |
193 |
0 |
progress.setProgressBar(message, progId); |
194 |
0 |
try |
195 |
|
{ |
196 |
0 |
getPcaModel().calculate(); |
197 |
|
|
198 |
0 |
xCombobox.setSelectedIndex(0); |
199 |
0 |
yCombobox.setSelectedIndex(1); |
200 |
0 |
zCombobox.setSelectedIndex(2); |
201 |
|
|
202 |
0 |
getPcaModel().updateRc(getRotatableCanvas()); |
203 |
|
|
204 |
0 |
setTop(getPcaModel().getTop()); |
205 |
|
|
206 |
|
} catch (OutOfMemoryError er) |
207 |
|
{ |
208 |
0 |
new OOMWarning("calculating PCA", er); |
209 |
0 |
working = false; |
210 |
0 |
return; |
211 |
|
} finally |
212 |
|
{ |
213 |
0 |
progress.setProgressBar("", progId); |
214 |
|
} |
215 |
|
|
216 |
0 |
repaint(); |
217 |
0 |
if (getParent() == null) |
218 |
|
{ |
219 |
0 |
Desktop.addInternalFrame(this, newPcaTitle, |
220 |
|
475, 450); |
221 |
0 |
this.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT)); |
222 |
|
} |
223 |
0 |
working = false; |
224 |
|
} |
225 |
|
|
226 |
|
|
227 |
|
|
228 |
|
|
229 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
230 |
0 |
@Override... |
231 |
|
protected void doDimensionChange() |
232 |
|
{ |
233 |
0 |
if (getTop() == 0) |
234 |
|
{ |
235 |
0 |
return; |
236 |
|
} |
237 |
|
|
238 |
0 |
int dim1 = getTop() - xCombobox.getSelectedIndex(); |
239 |
0 |
int dim2 = getTop() - yCombobox.getSelectedIndex(); |
240 |
0 |
int dim3 = getTop() - zCombobox.getSelectedIndex(); |
241 |
0 |
getPcaModel().updateRcView(dim1, dim2, dim3); |
242 |
0 |
getRotatableCanvas().resetView(); |
243 |
|
} |
244 |
|
|
245 |
|
|
246 |
|
|
247 |
|
|
248 |
|
|
249 |
|
@param |
250 |
|
@param |
251 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 4 |
Complexity Density: 0.36 |
|
252 |
0 |
public void setSelectedDimensionIndex(int index, Axis axis)... |
253 |
|
{ |
254 |
0 |
switch (axis) |
255 |
|
{ |
256 |
0 |
case X: |
257 |
0 |
xCombobox.setSelectedIndex(index); |
258 |
0 |
break; |
259 |
0 |
case Y: |
260 |
0 |
yCombobox.setSelectedIndex(index); |
261 |
0 |
break; |
262 |
0 |
case Z: |
263 |
0 |
zCombobox.setSelectedIndex(index); |
264 |
0 |
break; |
265 |
0 |
default: |
266 |
|
} |
267 |
|
} |
268 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.33 |
|
269 |
0 |
@Override... |
270 |
|
protected void outputValues_actionPerformed() |
271 |
|
{ |
272 |
0 |
CutAndPasteTransfer cap = new CutAndPasteTransfer(); |
273 |
0 |
try |
274 |
|
{ |
275 |
0 |
cap.setText(getPcaModel().getDetails()); |
276 |
0 |
Desktop.addInternalFrame(cap, |
277 |
|
MessageManager.getString("label.pca_details"), 500, 500); |
278 |
|
} catch (OutOfMemoryError oom) |
279 |
|
{ |
280 |
0 |
new OOMWarning("opening PCA details", oom); |
281 |
0 |
cap.dispose(); |
282 |
|
} |
283 |
|
} |
284 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
285 |
0 |
@Override... |
286 |
|
protected void showLabels_actionPerformed() |
287 |
|
{ |
288 |
0 |
getRotatableCanvas().showLabels(showLabels.getState()); |
289 |
|
} |
290 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
291 |
0 |
@Override... |
292 |
|
protected void print_actionPerformed() |
293 |
|
{ |
294 |
0 |
PCAPrinter printer = new PCAPrinter(); |
295 |
0 |
printer.start(); |
296 |
|
} |
297 |
|
|
298 |
|
|
299 |
|
|
300 |
|
|
301 |
|
|
|
|
| 0% |
Uncovered Elements: 23 (23) |
Complexity: 8 |
Complexity Density: 0.53 |
|
302 |
0 |
@Override... |
303 |
|
public void originalSeqData_actionPerformed() |
304 |
|
{ |
305 |
|
|
306 |
0 |
if (getPcaModel().getInputData() == null) |
307 |
|
{ |
308 |
0 |
Console.info( |
309 |
|
"Unexpected call to originalSeqData_actionPerformed - should have hidden this menu action."); |
310 |
0 |
return; |
311 |
|
} |
312 |
|
|
313 |
|
|
314 |
|
|
315 |
|
|
316 |
|
|
317 |
|
|
318 |
0 |
char gc = '-'; |
319 |
0 |
try |
320 |
|
{ |
321 |
|
|
322 |
|
|
323 |
0 |
gc = av.getGapCharacter(); |
324 |
|
} catch (Exception ex) |
325 |
|
{ |
326 |
|
} |
327 |
|
|
328 |
0 |
Object[] alAndColsel = getPcaModel().getInputData() |
329 |
|
.getAlignmentAndHiddenColumns(gc); |
330 |
|
|
331 |
0 |
if (alAndColsel != null && alAndColsel[0] != null) |
332 |
|
{ |
333 |
|
|
334 |
|
|
335 |
0 |
AlignmentI al = new Alignment((SequenceI[]) alAndColsel[0]); |
336 |
0 |
AlignmentI dataset = (av != null && av.getAlignment() != null) |
337 |
|
? av.getAlignment().getDataset() |
338 |
|
: null; |
339 |
0 |
if (dataset != null) |
340 |
|
{ |
341 |
0 |
al.setDataset(dataset); |
342 |
|
} |
343 |
|
|
344 |
0 |
if (true) |
345 |
|
{ |
346 |
|
|
347 |
0 |
AlignFrame af = new AlignFrame(al, (HiddenColumns) alAndColsel[1], |
348 |
|
AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); |
349 |
|
|
350 |
|
|
351 |
|
|
352 |
|
|
353 |
|
|
354 |
|
|
355 |
|
|
356 |
|
|
357 |
0 |
Desktop.addInternalFrame(af, MessageManager.formatMessage( |
358 |
|
"label.original_data_for_params", new String[] |
359 |
|
{ this.title }), AlignFrame.DEFAULT_WIDTH, |
360 |
|
AlignFrame.DEFAULT_HEIGHT); |
361 |
|
} |
362 |
|
} |
363 |
|
|
364 |
|
|
365 |
|
|
366 |
|
|
367 |
|
|
368 |
|
|
369 |
|
|
370 |
|
|
371 |
|
} |
372 |
|
|
|
|
| 0% |
Uncovered Elements: 28 (28) |
Complexity: 7 |
Complexity Density: 0.39 |
|
373 |
|
class PCAPrinter extends Thread implements Printable |
374 |
|
{ |
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 4 |
Complexity Density: 0.4 |
|
375 |
0 |
@Override... |
376 |
|
public void run() |
377 |
|
{ |
378 |
0 |
PrinterJob printJob = PrinterJob.getPrinterJob(); |
379 |
0 |
PageFormat defaultPage = printJob.defaultPage(); |
380 |
0 |
PageFormat pf = printJob.pageDialog(defaultPage); |
381 |
|
|
382 |
0 |
if (defaultPage == pf) |
383 |
|
{ |
384 |
|
|
385 |
|
|
386 |
|
|
387 |
0 |
return; |
388 |
|
} |
389 |
|
|
390 |
0 |
printJob.setPrintable(this, pf); |
391 |
|
|
392 |
0 |
if (printJob.printDialog()) |
393 |
|
{ |
394 |
0 |
try |
395 |
|
{ |
396 |
0 |
printJob.print(); |
397 |
|
} catch (Exception PrintException) |
398 |
|
{ |
399 |
0 |
PrintException.printStackTrace(); |
400 |
|
} |
401 |
|
} |
402 |
|
} |
403 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.38 |
|
404 |
0 |
@Override... |
405 |
|
public int print(Graphics pg, PageFormat pf, int pi) |
406 |
|
throws PrinterException |
407 |
|
{ |
408 |
0 |
pg.translate((int) pf.getImageableX(), (int) pf.getImageableY()); |
409 |
|
|
410 |
0 |
getRotatableCanvas().drawBackground(pg); |
411 |
0 |
getRotatableCanvas().drawScene(pg); |
412 |
0 |
if (getRotatableCanvas().drawAxes) |
413 |
|
{ |
414 |
0 |
getRotatableCanvas().drawAxes(pg); |
415 |
|
} |
416 |
|
|
417 |
0 |
if (pi == 0) |
418 |
|
{ |
419 |
0 |
return Printable.PAGE_EXISTS; |
420 |
|
} |
421 |
|
else |
422 |
|
{ |
423 |
0 |
return Printable.NO_SUCH_PAGE; |
424 |
|
} |
425 |
|
} |
426 |
|
} |
427 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.25 |
|
428 |
0 |
public void makePCAImage(ImageMaker.TYPE type)... |
429 |
|
{ |
430 |
0 |
int width = getRotatableCanvas().getWidth(); |
431 |
0 |
int height = getRotatableCanvas().getHeight(); |
432 |
0 |
ImageWriterI writer = new ImageWriterI() |
433 |
|
{ |
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
434 |
0 |
@Override... |
435 |
|
public void exportImage(Graphics g) throws Exception |
436 |
|
{ |
437 |
0 |
RotatableCanvas canvas = getRotatableCanvas(); |
438 |
0 |
canvas.drawBackground(g); |
439 |
0 |
canvas.drawScene(g); |
440 |
0 |
if (canvas.drawAxes) |
441 |
|
{ |
442 |
0 |
canvas.drawAxes(g); |
443 |
|
} |
444 |
|
} |
445 |
|
}; |
446 |
0 |
String pca = MessageManager.getString("label.pca"); |
447 |
0 |
ImageExporter exporter = new ImageExporter(writer, null, type, pca); |
448 |
0 |
try |
449 |
|
{ |
450 |
0 |
exporter.doExport(null, this, width, height, pca); |
451 |
|
} catch (ImageOutputException ioex) |
452 |
|
{ |
453 |
0 |
Console.error("Unexpected error whilst writing " + type.toString(), |
454 |
|
ioex); |
455 |
|
} |
456 |
|
} |
457 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
458 |
0 |
@Override... |
459 |
|
protected void viewMenu_menuSelected() |
460 |
|
{ |
461 |
0 |
buildAssociatedViewMenu(); |
462 |
|
} |
463 |
|
|
464 |
|
|
465 |
|
|
466 |
|
|
467 |
|
|
|
|
| 0% |
Uncovered Elements: 28 (28) |
Complexity: 5 |
Complexity Density: 0.23 |
|
468 |
0 |
void buildAssociatedViewMenu()... |
469 |
|
{ |
470 |
0 |
AlignmentPanel[] aps = PaintRefresher |
471 |
|
.getAssociatedPanels(av.getSequenceSetId()); |
472 |
0 |
if (aps.length == 1 && getRotatableCanvas().av == aps[0].av) |
473 |
|
{ |
474 |
0 |
associateViewsMenu.setVisible(false); |
475 |
0 |
return; |
476 |
|
} |
477 |
|
|
478 |
0 |
associateViewsMenu.setVisible(true); |
479 |
|
|
480 |
0 |
if ((viewMenu |
481 |
|
.getItem(viewMenu.getItemCount() - 2) instanceof JMenuItem)) |
482 |
|
{ |
483 |
0 |
viewMenu.insertSeparator(viewMenu.getItemCount() - 1); |
484 |
|
} |
485 |
|
|
486 |
0 |
associateViewsMenu.removeAll(); |
487 |
|
|
488 |
0 |
JRadioButtonMenuItem item; |
489 |
0 |
ButtonGroup buttonGroup = new ButtonGroup(); |
490 |
0 |
int iSize = aps.length; |
491 |
|
|
492 |
0 |
for (int i = 0; i < iSize; i++) |
493 |
|
{ |
494 |
0 |
final AlignmentPanel panel = aps[i]; |
495 |
0 |
item = new JRadioButtonMenuItem(panel.av.getViewName(), |
496 |
|
panel.av == getRotatableCanvas().av); |
497 |
0 |
buttonGroup.add(item); |
498 |
0 |
item.addActionListener(new ActionListener() |
499 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
500 |
0 |
@Override... |
501 |
|
public void actionPerformed(ActionEvent evt) |
502 |
|
{ |
503 |
0 |
selectAssociatedView(panel); |
504 |
|
} |
505 |
|
}); |
506 |
|
|
507 |
0 |
associateViewsMenu.add(item); |
508 |
|
} |
509 |
|
|
510 |
0 |
final JRadioButtonMenuItem itemf = new JRadioButtonMenuItem( |
511 |
|
"All Views"); |
512 |
|
|
513 |
0 |
buttonGroup.add(itemf); |
514 |
|
|
515 |
0 |
itemf.setSelected(getRotatableCanvas().isApplyToAllViews()); |
516 |
0 |
itemf.addActionListener(new ActionListener() |
517 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
518 |
0 |
@Override... |
519 |
|
public void actionPerformed(ActionEvent evt) |
520 |
|
{ |
521 |
0 |
getRotatableCanvas().setApplyToAllViews(itemf.isSelected()); |
522 |
|
} |
523 |
|
}); |
524 |
0 |
associateViewsMenu.add(itemf); |
525 |
|
|
526 |
|
} |
527 |
|
|
528 |
|
|
529 |
|
|
530 |
|
|
531 |
|
@see |
532 |
|
|
533 |
|
|
534 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.33 |
|
535 |
0 |
@Override... |
536 |
|
protected void outputPoints_actionPerformed() |
537 |
|
{ |
538 |
0 |
CutAndPasteTransfer cap = new CutAndPasteTransfer(); |
539 |
0 |
try |
540 |
|
{ |
541 |
0 |
cap.setText(getPcaModel().getPointsasCsv(false, |
542 |
|
xCombobox.getSelectedIndex(), yCombobox.getSelectedIndex(), |
543 |
|
zCombobox.getSelectedIndex())); |
544 |
0 |
Desktop.addInternalFrame(cap, MessageManager |
545 |
|
.formatMessage("label.points_for_params", new String[] |
546 |
|
{ this.getTitle() }), 500, 500); |
547 |
|
} catch (OutOfMemoryError oom) |
548 |
|
{ |
549 |
0 |
new OOMWarning("exporting PCA points", oom); |
550 |
0 |
cap.dispose(); |
551 |
|
} |
552 |
|
} |
553 |
|
|
554 |
|
|
555 |
|
|
556 |
|
|
557 |
|
@see |
558 |
|
|
559 |
|
|
560 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.33 |
|
561 |
0 |
@Override... |
562 |
|
protected void outputProjPoints_actionPerformed() |
563 |
|
{ |
564 |
0 |
CutAndPasteTransfer cap = new CutAndPasteTransfer(); |
565 |
0 |
try |
566 |
|
{ |
567 |
0 |
cap.setText(getPcaModel().getPointsasCsv(true, |
568 |
|
xCombobox.getSelectedIndex(), yCombobox.getSelectedIndex(), |
569 |
|
zCombobox.getSelectedIndex())); |
570 |
0 |
Desktop.addInternalFrame(cap, MessageManager.formatMessage( |
571 |
|
"label.transformed_points_for_params", new String[] |
572 |
|
{ this.getTitle() }), 500, 500); |
573 |
|
} catch (OutOfMemoryError oom) |
574 |
|
{ |
575 |
0 |
new OOMWarning("exporting transformed PCA points", oom); |
576 |
0 |
cap.dispose(); |
577 |
|
} |
578 |
|
} |
579 |
|
|
580 |
|
|
581 |
|
|
582 |
|
|
583 |
|
@see |
584 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
585 |
0 |
@Override... |
586 |
|
public void setProgressBar(String message, long id) |
587 |
|
{ |
588 |
0 |
progressBar.setProgressBar(message, id); |
589 |
|
|
590 |
|
|
591 |
|
|
592 |
|
|
593 |
|
|
594 |
|
|
595 |
|
|
596 |
|
|
597 |
|
|
598 |
|
|
599 |
|
|
600 |
|
|
601 |
|
|
602 |
|
|
603 |
|
|
604 |
|
|
605 |
|
|
606 |
|
|
607 |
|
|
608 |
|
|
609 |
|
|
610 |
|
|
611 |
|
|
612 |
|
|
613 |
|
|
614 |
|
|
615 |
|
|
616 |
|
|
617 |
|
|
618 |
|
|
619 |
|
|
620 |
|
|
621 |
|
|
622 |
|
|
623 |
|
|
624 |
|
|
625 |
|
|
626 |
|
|
627 |
|
|
628 |
|
|
629 |
|
|
630 |
|
|
631 |
|
|
632 |
|
} |
633 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
634 |
0 |
@Override... |
635 |
|
public void registerHandler(final long id, |
636 |
|
final IProgressIndicatorHandler handler) |
637 |
|
{ |
638 |
0 |
progressBar.registerHandler(id, handler); |
639 |
|
|
640 |
|
|
641 |
|
|
642 |
|
|
643 |
|
|
644 |
|
|
645 |
|
|
646 |
|
|
647 |
|
|
648 |
|
|
649 |
|
|
650 |
|
|
651 |
|
|
652 |
|
|
653 |
|
|
654 |
|
|
655 |
|
|
656 |
|
|
657 |
|
|
658 |
|
|
659 |
|
|
660 |
|
|
661 |
|
|
662 |
|
|
663 |
|
|
664 |
|
|
665 |
|
} |
666 |
|
|
667 |
|
|
668 |
|
|
669 |
|
@return |
670 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
671 |
0 |
@Override... |
672 |
|
public boolean operationInProgress() |
673 |
|
{ |
674 |
0 |
return progressBar.operationInProgress(); |
675 |
|
} |
676 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
677 |
0 |
@Override... |
678 |
|
protected void resetButton_actionPerformed() |
679 |
|
{ |
680 |
0 |
int t = getTop(); |
681 |
0 |
setTop(0); |
682 |
0 |
xCombobox.setSelectedIndex(0); |
683 |
0 |
yCombobox.setSelectedIndex(1); |
684 |
0 |
setTop(t); |
685 |
0 |
zCombobox.setSelectedIndex(2); |
686 |
|
} |
687 |
|
|
688 |
|
|
689 |
|
|
690 |
|
|
691 |
|
@return |
692 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
693 |
0 |
public boolean isWorking()... |
694 |
|
{ |
695 |
0 |
return working; |
696 |
|
} |
697 |
|
|
698 |
|
|
699 |
|
|
700 |
|
|
701 |
|
|
702 |
|
@param |
703 |
|
@return |
704 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 3 |
Complexity Density: 0.43 |
|
705 |
0 |
public int getSelectedDimensionIndex(Axis axis)... |
706 |
|
{ |
707 |
0 |
switch (axis) |
708 |
|
{ |
709 |
0 |
case X: |
710 |
0 |
return xCombobox.getSelectedIndex(); |
711 |
0 |
case Y: |
712 |
0 |
return yCombobox.getSelectedIndex(); |
713 |
0 |
default: |
714 |
0 |
return zCombobox.getSelectedIndex(); |
715 |
|
} |
716 |
|
} |
717 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
718 |
0 |
public void setShowLabels(boolean show)... |
719 |
|
{ |
720 |
0 |
showLabels.setSelected(show); |
721 |
|
} |
722 |
|
|
723 |
|
|
724 |
|
|
725 |
|
|
726 |
|
|
727 |
|
|
728 |
|
@param |
729 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
730 |
0 |
public void setInputData(AlignmentView data)... |
731 |
|
{ |
732 |
0 |
getPcaModel().setInputData(data); |
733 |
0 |
originalSeqData.setVisible(data != null); |
734 |
|
} |
735 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
736 |
0 |
public AlignViewportI getAlignViewport()... |
737 |
|
{ |
738 |
0 |
return av; |
739 |
|
} |
740 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
741 |
0 |
public PCAModel getPcaModel()... |
742 |
|
{ |
743 |
0 |
return pcaModel; |
744 |
|
} |
745 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
746 |
0 |
public void setPcaModel(PCAModel pcaModel)... |
747 |
|
{ |
748 |
0 |
this.pcaModel = pcaModel; |
749 |
|
} |
750 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
751 |
0 |
public RotatableCanvas getRotatableCanvas()... |
752 |
|
{ |
753 |
0 |
return rc; |
754 |
|
} |
755 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
756 |
0 |
public void setRotatableCanvas(RotatableCanvas rc)... |
757 |
|
{ |
758 |
0 |
this.rc = rc; |
759 |
|
} |
760 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
761 |
0 |
public int getTop()... |
762 |
|
{ |
763 |
0 |
return top; |
764 |
|
} |
765 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
766 |
0 |
public void setTop(int top)... |
767 |
|
{ |
768 |
0 |
this.top = top; |
769 |
|
} |
770 |
|
|
771 |
|
|
772 |
|
|
773 |
|
|
774 |
|
@param |
775 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
776 |
0 |
public void selectAssociatedView(AlignmentPanel panel)... |
777 |
|
{ |
778 |
0 |
getRotatableCanvas().setApplyToAllViews(false); |
779 |
|
|
780 |
0 |
ap = panel; |
781 |
0 |
av = panel.av; |
782 |
|
|
783 |
0 |
getRotatableCanvas().av = panel.av; |
784 |
0 |
getRotatableCanvas().ap = panel; |
785 |
0 |
PaintRefresher.Register(PCAPanel.this, panel.av.getSequenceSetId()); |
786 |
|
} |
787 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
788 |
0 |
@Override... |
789 |
|
public JProgressBar getProgressBar(long id) |
790 |
|
{ |
791 |
0 |
return progressBar.getProgressBar(id); |
792 |
|
} |
793 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
794 |
0 |
public String getMessage(long id)... |
795 |
|
{ |
796 |
0 |
return progressBar.getMessage(id); |
797 |
|
} |
798 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
799 |
0 |
public void setProgressBarMessage(long id, String message)... |
800 |
|
{ |
801 |
0 |
progressBar.setProgressBarMessage(id, message); |
802 |
|
} |
803 |
|
} |