Clover icon

Coverage Report

  1. Project Clover database Mon Nov 11 2024 15:05:32 GMT
  2. Package jalview.gui

File SpatialPanel.java

 

Coverage histogram

../../img/srcFileCovDistChart3.png
52% of files have more coverage

Code metrics

54
213
52
2
767
572
94
0.44
4.1
26
1.81

Classes

Class Line # Actions
SpatialPanel 67 195 87
0.2542955325.4%
SpatialPanel.PCAPrinter 233 18 7
0.00%
 

Contributing tests

This file is covered by 4 tests. .

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
7    * Jalview is free software: you can redistribute it and/or
8    * modify it under the terms of the GNU General Public License
9    * as published by the Free Software Foundation, either version 3
10    * of the License, or (at your option) any later version.
11    *
12    * Jalview is distributed in the hope that it will be useful, but
13    * WITHOUT ANY WARRANTY; without even the implied warranty
14    * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15    * PURPOSE. See the GNU General Public License for more details.
16    *
17    * You should have received a copy of the GNU General Public License
18    * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19    * The Jalview Authors are detailed in the 'AUTHORS' file.
20    */
21    package jalview.gui;
22   
23   
24    import java.awt.Color;
25    import java.awt.Container;
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    import java.beans.PropertyChangeEvent;
34    import java.beans.PropertyChangeListener;
35    import java.util.List;
36   
37    import javax.swing.ButtonGroup;
38    import javax.swing.JMenuItem;
39    import javax.swing.JProgressBar;
40    import javax.swing.JRadioButtonMenuItem;
41    import javax.swing.event.InternalFrameAdapter;
42    import javax.swing.event.InternalFrameEvent;
43    import javax.swing.event.MenuEvent;
44    import javax.swing.event.MenuListener;
45   
46    import jalview.api.AlignViewportI;
47    import jalview.bin.Console;
48    import jalview.datamodel.Alignment;
49    import jalview.datamodel.AlignmentI;
50    import jalview.datamodel.AlignmentView;
51    import jalview.datamodel.HiddenColumns;
52    import jalview.datamodel.SequenceI;
53    import jalview.gui.ImageExporter.ImageWriterI;
54    import jalview.gui.JalviewColourChooser.ColourChooserListener;
55    import jalview.io.exceptions.ImageOutputException;
56    import jalview.jbgui.GPCAPanel;
57    import jalview.math.RotatableMatrix.Axis;
58    import jalview.util.ImageMaker;
59    import jalview.util.MessageManager;
60    import jalview.viewmodel.AlignmentViewport;
61    import jalview.viewmodel.SpatialModel;
62   
63    /**
64    * Base panel holding spatial projections
65    */
66   
 
67    public abstract class SpatialPanel<T extends SpatialModel> extends GPCAPanel
68    implements IProgressIndicator
69    {
70    protected static final int MIN_WIDTH = 470;
71    protected static final int MIN_HEIGHT = 250;
72    T spatialModel;
73    protected RotatableCanvas rc;
74    protected AlignmentPanel ap;
75    protected AlignmentViewport av;
76    private int top = 0;
77    protected IProgressIndicator progressBar;
78    protected long progId;
79    protected boolean working;
80   
81   
 
82  2 toggle public SpatialPanel()
83    {
84  2 this(8);
85    }
 
86  2 toggle public SpatialPanel(int dim)
87    {
88  2 super(dim);
89    }
 
90  2 toggle protected void init(AlignmentPanel alignPanel)
91    {
92  2 this.setFrameIcon(null);
93  2 this.av = alignPanel.av;
94  2 this.ap = alignPanel;
95  2 progressBar = new ProgressBar(statusPanel, statusBar);
96   
97  2 addInternalFrameListener(new InternalFrameAdapter()
98    {
 
99  2 toggle @Override
100    public void internalFrameClosed(InternalFrameEvent e)
101    {
102  2 close_actionPerformed();
103    }
104    });
105   
106   
107   
108    }
109    /**
110    *
111    * @return the localised name for the calculation
112    */
113    public abstract String getSpatialName();
114    /**
115    *
116    * @return the localised name for the detail report for the calculation
117    */
118    public abstract String getSpatialNameDetails();
119   
120    /**
121    * Ensure references to potentially very large objects (the PCA matrices) are
122    * nulled when the frame is closed
123    */
 
124  2 toggle protected void close_actionPerformed()
125    {
126  2 setSpatialModel(null);
127  2 if (this.rc != null)
128    {
129  2 this.rc.sequencePoints = null;
130  2 this.rc.setAxisEndPoints(null);
131  2 this.rc = null;
132    }
133    }
134   
 
135  0 toggle @Override
136    protected void outputValues_actionPerformed()
137    {
138  0 CutAndPasteTransfer cap = new CutAndPasteTransfer();
139  0 try
140    {
141  0 cap.setText(getSpatialModel().getDetails());
142  0 Desktop.addInternalFrame(cap,
143    getSpatialNameDetails(), 500, 500);
144    } catch (OutOfMemoryError oom)
145    {
146  0 new OOMWarning("opening "+getSpatialNameDetails(), oom);
147  0 cap.dispose();
148    }
149    }
150   
 
151  0 toggle @Override
152    protected void print_actionPerformed()
153    {
154  0 PCAPrinter printer = new PCAPrinter();
155  0 printer.start();
156    }
157   
158    /**
159    * If available, shows the data which formed the inputs for the PCA as a new
160    * alignment
161    */
 
162  0 toggle @Override
163    public void originalSeqData_actionPerformed()
164    {
165    // JAL-2647 disabled after load from project (until save to project done)
166  0 if (getSpatialModel().getInputData() == null)
167    {
168  0 Console.info(
169    "Unexpected call to originalSeqData_actionPerformed - should have hidden this menu action.");
170  0 return;
171    }
172    // decide if av alignment is sufficiently different to original data to
173    // warrant a new window to be created
174    // create new alignment window with hidden regions (unhiding hidden regions
175    // yields unaligned seqs)
176    // or create a selection box around columns in alignment view
177    // test Alignment(SeqCigar[])
178  0 char gc = '-';
179  0 try
180    {
181    // we try to get the associated view's gap character
182    // but this may fail if the view was closed...
183  0 gc = av.getGapCharacter();
184    } catch (Exception ex)
185    {
186    }
187   
188  0 Object[] alAndColsel = getSpatialModel().getInputData()
189    .getAlignmentAndHiddenColumns(gc);
190   
191  0 if (alAndColsel != null && alAndColsel[0] != null)
192    {
193    // AlignmentOrder origorder = new AlignmentOrder(alAndColsel[0]);
194   
195  0 AlignmentI al = new Alignment((SequenceI[]) alAndColsel[0]);
196  0 AlignmentI dataset = (av != null && av.getAlignment() != null)
197    ? av.getAlignment().getDataset()
198    : null;
199  0 if (dataset != null)
200    {
201  0 al.setDataset(dataset);
202    }
203   
204  0 if (true)
205    {
206    // make a new frame!
207  0 AlignFrame af = new AlignFrame(al, (HiddenColumns) alAndColsel[1],
208    AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
209   
210    // >>>This is a fix for the moment, until a better solution is
211    // found!!<<<
212    // af.getFeatureRenderer().transferSettings(alignFrame.getFeatureRenderer());
213   
214    // af.addSortByOrderMenuItem(ServiceName + " Ordering",
215    // msaorder);
216   
217  0 Desktop.addInternalFrame(af, MessageManager.formatMessage(
218    "label.original_data_for_params", new String[]
219    { this.title }), AlignFrame.DEFAULT_WIDTH,
220    AlignFrame.DEFAULT_HEIGHT);
221    }
222    }
223    /*
224    * CutAndPasteTransfer cap = new CutAndPasteTransfer(); for (int i = 0; i <
225    * seqs.length; i++) { cap.appendText(new jalview.util.Format("%-" + 15 +
226    * "s").form( seqs[i].getName())); cap.appendText(" " + seqstrings[i] +
227    * "\n"); }
228    *
229    * Desktop.addInternalFrame(cap, "Original Data", 400, 400);
230    */
231    }
232   
 
233    class PCAPrinter extends Thread implements Printable
234    {
 
235  0 toggle @Override
236    public void run()
237    {
238  0 PrinterJob printJob = PrinterJob.getPrinterJob();
239  0 PageFormat defaultPage = printJob.defaultPage();
240  0 PageFormat pf = printJob.pageDialog(defaultPage);
241   
242  0 if (defaultPage == pf)
243    {
244    /*
245    * user cancelled
246    */
247  0 return;
248    }
249   
250  0 printJob.setPrintable(this, pf);
251   
252  0 if (printJob.printDialog())
253    {
254  0 try
255    {
256  0 printJob.print();
257    } catch (Exception PrintException)
258    {
259  0 PrintException.printStackTrace();
260    }
261    }
262    }
263   
 
264  0 toggle @Override
265    public int print(Graphics pg, PageFormat pf, int pi)
266    throws PrinterException
267    {
268  0 pg.translate((int) pf.getImageableX(), (int) pf.getImageableY());
269   
270  0 getRotatableCanvas().drawBackground(pg);
271  0 getRotatableCanvas().drawScene(pg);
272  0 if (getRotatableCanvas().drawAxes)
273    {
274  0 getRotatableCanvas().drawAxes(pg);
275    }
276   
277  0 if (pi == 0)
278    {
279  0 return Printable.PAGE_EXISTS;
280    }
281    else
282    {
283  0 return Printable.NO_SUCH_PAGE;
284    }
285    }
286    }
287   
 
288  0 toggle public void makePCAImage(ImageMaker.TYPE type)
289    {
290  0 int width = getRotatableCanvas().getWidth();
291  0 int height = getRotatableCanvas().getHeight();
292  0 ImageWriterI writer = new ImageWriterI()
293    {
 
294  0 toggle @Override
295    public void exportImage(Graphics g) throws Exception
296    {
297  0 RotatableCanvas canvas = getRotatableCanvas();
298  0 canvas.drawBackground(g);
299  0 canvas.drawScene(g);
300  0 if (canvas.drawAxes)
301    {
302  0 canvas.drawAxes(g);
303    }
304    }
305    };
306  0 String pca = MessageManager.getString(getSpatialName());
307  0 ImageExporter exporter = new ImageExporter(writer, null, type, pca);
308  0 try
309    {
310  0 exporter.doExport(null, this, width, height, pca);
311    } catch (ImageOutputException ioex)
312    {
313  0 Console.error("Unexpected error whilst writing " + type.toString(),
314    ioex);
315    }
316    }
317   
 
318  1 toggle void initClusterMenu() {
319  1 List<String> clusterMethods = spatialModel.getClusterOptions();
320  1 for (String method:clusterMethods)
321    {
322  1 JMenuItem doCluster = new JMenuItem("Cluster with "+method);
323  1 doCluster.addActionListener(new ActionListener()
324    {
325   
 
326  0 toggle @Override
327    public void actionPerformed(ActionEvent e)
328    {
329  0 doClustering_actionPerformed(method);
330    }
331    });
332  1 doClustering.add(doCluster);
333    }
334  1 doClustering.setEnabled(doClustering.getItemCount()>0);
335    }
336   
 
337  0 toggle @Override
338    protected void viewMenu_menuSelected()
339    {
340  0 buildAssociatedViewMenu();
341    }
342   
343    /**
344    * Builds the menu showing the choice of possible views (for the associated
345    * sequence data) to which the PCA may be linked
346    */
 
347  0 toggle void buildAssociatedViewMenu()
348    {
349  0 AlignmentPanel[] aps = PaintRefresher
350    .getAssociatedPanels(av.getSequenceSetId());
351  0 if (aps.length == 1 && getRotatableCanvas().av == aps[0].av)
352    {
353  0 associateViewsMenu.setVisible(false);
354  0 return;
355    }
356   
357  0 associateViewsMenu.setVisible(true);
358   
359  0 if ((viewMenu
360    .getItem(viewMenu.getItemCount() - 2) instanceof JMenuItem))
361    {
362  0 viewMenu.insertSeparator(viewMenu.getItemCount() - 1);
363    }
364   
365  0 associateViewsMenu.removeAll();
366   
367  0 JRadioButtonMenuItem item;
368  0 ButtonGroup buttonGroup = new ButtonGroup();
369  0 int iSize = aps.length;
370   
371  0 for (int i = 0; i < iSize; i++)
372    {
373  0 final AlignmentPanel panel = aps[i];
374  0 item = new JRadioButtonMenuItem(panel.av.getViewName(),
375    panel.av == getRotatableCanvas().av);
376  0 buttonGroup.add(item);
377  0 item.addActionListener(new ActionListener()
378    {
 
379  0 toggle @Override
380    public void actionPerformed(ActionEvent evt)
381    {
382  0 selectAssociatedView(panel);
383    }
384    });
385   
386  0 associateViewsMenu.add(item);
387    }
388   
389  0 final JRadioButtonMenuItem itemf = new JRadioButtonMenuItem(
390    "All Views");
391   
392  0 buttonGroup.add(itemf);
393   
394  0 itemf.setSelected(getRotatableCanvas().isApplyToAllViews());
395  0 itemf.addActionListener(new ActionListener()
396    {
 
397  0 toggle @Override
398    public void actionPerformed(ActionEvent evt)
399    {
400  0 getRotatableCanvas().setApplyToAllViews(itemf.isSelected());
401    }
402    });
403  0 associateViewsMenu.add(itemf);
404   
405    }
406   
407    /*
408    * (non-Javadoc)
409    *
410    * @see
411    * jalview.jbgui.GPCAPanel#outputPoints_actionPerformed(java.awt.event.ActionEvent
412    * )
413    */
 
414  0 toggle @Override
415    protected void outputPoints_actionPerformed()
416    {
417  0 CutAndPasteTransfer cap = new CutAndPasteTransfer();
418  0 try
419    {
420  0 cap.setText(getSpatialModel().getPointsasCsv(false,
421    xCombobox.getSelectedIndex(), yCombobox.getSelectedIndex(),
422    zCombobox.getSelectedIndex()));
423  0 Desktop.addInternalFrame(cap, MessageManager
424    .formatMessage("label.points_for_params", new String[]
425    { this.getTitle() }), 500, 500);
426    } catch (OutOfMemoryError oom)
427    {
428  0 new OOMWarning("exporting PCA points", oom);
429  0 cap.dispose();
430    }
431    }
432   
433    /*
434    * (non-Javadoc)
435    *
436    * @see
437    * jalview.jbgui.GPCAPanel#outputProjPoints_actionPerformed(java.awt.event
438    * .ActionEvent)
439    */
 
440  0 toggle @Override
441    protected void outputProjPoints_actionPerformed()
442    {
443  0 CutAndPasteTransfer cap = new CutAndPasteTransfer();
444  0 try
445    {
446  0 cap.setText(getSpatialModel().getPointsasCsv(true,
447    xCombobox.getSelectedIndex(), yCombobox.getSelectedIndex(),
448    zCombobox.getSelectedIndex()));
449  0 Desktop.addInternalFrame(cap, MessageManager.formatMessage(
450    "label.transformed_points_for_params", new String[]
451    { this.getTitle() }), 500, 500);
452    } catch (OutOfMemoryError oom)
453    {
454  0 new OOMWarning("exporting transformed PCA points", oom);
455  0 cap.dispose();
456    }
457    }
458   
 
459  0 toggle @Override
460    protected void resetButton_actionPerformed()
461    {
462  0 int t = getTop();
463  0 setTop(0); // ugly - prevents dimensionChanged events from being processed
464  0 xCombobox.setSelectedIndex(0);
465  0 yCombobox.setSelectedIndex(1);
466  0 setTop(t);
467  0 zCombobox.setSelectedIndex(2);
468    }
469   
470    /**
471    * Sets the input data used to calculate the PCA. This is provided for
472    * 'restore from project', which does not currently support this (AL-2647), so
473    * sets the value to null, and hides the menu option for "Input Data...". J
474    *
475    * @param data
476    */
 
477  1 toggle public void setInputData(AlignmentView data)
478    {
479    //TODO FIX REFACTORING FINISH
480    // getSpatialModel().setInputData(data);
481  1 originalSeqData.setVisible(data != null);
482    }
483   
 
484  9 toggle public T getSpatialModel()
485    {
486  9 return spatialModel;
487    }
488   
 
489  2 toggle public void setSpatialModel(T SpatialModel)
490    {
491  2 this.spatialModel = SpatialModel;
492    }
493   
494   
 
495  0 toggle protected List<String> getAvailableClusteringMethods()
496    {
497  0 return spatialModel.getClusterOptions();
498    }
499   
 
500  0 toggle protected void doClustering_actionPerformed(String method)
501    {
502    // TODO - PROGRESS BAR
503  0 spatialModel.doClustering(method);
504  0 spatialModel.markGroups();
505  0 ap.updateAnnotation();
506   
507    }
 
508  0 toggle @Override
509    protected void bgcolour_actionPerformed()
510    {
511  0 String ttl = MessageManager.getString("label.select_background_colour");
512  0 ColourChooserListener listener = new ColourChooserListener()
513    {
 
514  0 toggle @Override
515    public void colourSelected(Color c)
516    {
517  0 rc.setBgColour(c);
518  0 rc.repaint();
519    }
520    };
521  0 JalviewColourChooser.showColourChooser(this, ttl, rc.getBgColour(),
522    listener);
523    }
524    /**
525    * Updates the PaSiMap display after a change of component to use for x, y or
526    * z axis
527    */
 
528  12 toggle @Override
529    protected void doDimensionChange()
530    {
531  12 if (getTop() == 0)
532    {
533  12 return;
534    }
535   
536  0 int dim1 = getTop() - xCombobox.getSelectedIndex();
537  0 int dim2 = getTop() - yCombobox.getSelectedIndex();
538  0 int dim3 = getTop() - zCombobox.getSelectedIndex();
539  0 spatialModel.updateRcView(dim1, dim2, dim3);
540  0 getRotatableCanvas().resetView();
541    }
542    /**
543    * Sets the selected checkbox item index for PaSiMap dimension (1, 2, 3...)
544    * for the given axis (X/Y/Z)
545    *
546    * @param index
547    * @param axis
548    */
 
549  3 toggle public void setSelectedDimensionIndex(int index, Axis axis)
550    {
551  3 switch (axis)
552    {
553  1 case X:
554  1 xCombobox.setSelectedIndex(index);
555  1 break;
556  1 case Y:
557  1 yCombobox.setSelectedIndex(index);
558  1 break;
559  1 case Z:
560  1 zCombobox.setSelectedIndex(index);
561  1 break;
562  0 default:
563    }
564    }
 
565  0 toggle @Override
566    protected void showLabels_actionPerformed()
567    {
568  0 getRotatableCanvas().showLabels(showLabels.getState());
569    }
 
570  0 toggle public void setProgressBar(String message, long id)
571    {
572  0 progressBar.setProgressBar(message, id);
573    }
 
574  0 toggle public String getMessage(long id)
575    {
576  0 return progressBar.getMessage(id);
577    }
 
578  0 toggle public void setProgressBarMessage(long id, String message)
579    {
580  0 progressBar.setProgressBarMessage(id, message);
581    }
 
582  0 toggle public void updateProgressBar(int lengthOfTask, int progress)
583    {
584  0 JProgressBar pBar = progressBar.getProgressBar(progId);
585  0 if (pBar == null)
586    {
587  0 return;
588    }
589  0 if (pBar.isIndeterminate())
590    {
591  0 pBar.setMaximum(lengthOfTask);
592  0 pBar.setValue(0);
593  0 pBar.setIndeterminate(false);
594    }
595   
596  0 if (progress<-1 || lengthOfTask<=0)
597    {
598  0 pBar.setIndeterminate(true);
599  0 pBar.repaint();
600  0 return;
601    }
602  0 updateProgressBar(progress);
603    }
 
604  0 toggle public void updateProgressBarWithEta(int progress, double minutes)
605    {
606  0 JProgressBar pBar = progressBar.getProgressBar(progId);
607   
608  0 if (pBar == null)
609    {
610  0 return;
611    }
612  0 int max=pBar.getMaximum();
613  0 updateProgressBarEta(minutes);
614  0 pBar.setMaximum(max);
615  0 pBar.setValue(progress);
616    }
 
617  0 toggle public void updateProgressBarEta(double minutes)
618    {
619  0 JProgressBar pBar = progressBar.getProgressBar(progId);
620   
621  0 if (pBar == null)
622    {
623  0 return;
624    }
625  0 progressBar.setProgressBarMessage(progId,
626    progressBar.getMessage(progId) + " ("
627  0 + (Double.isNaN(minutes) ? " .. working ..)"
628  0 : (minutes < 1.0 ? "Less than a minute)"
629    : ((int) Math.ceil(minutes))
630    + " mins. to go)")));
631    }
 
632  0 toggle public void updateProgressBar(int progress)
633    {
634  0 JProgressBar pBar = progressBar.getProgressBar(progId);
635   
636  0 if (pBar == null)
637    {
638  0 return;
639    }
640   
641  0 pBar.setValue(progress);
642  0 pBar.repaint();
643    }
644    /**
645    * adds a listener for a pairwise alignment panel's progress TODO: generalise
646    * for anything that can report progress ?
647    *
648    * @param pap
649    */
 
650  0 toggle public void addProgressListenerFor(Container pap)
651    {
652  0 pap.addPropertyChangeListener(new PropertyChangeListener()
653    {
 
654  0 toggle @Override
655    public void propertyChange(PropertyChangeEvent pcEvent)
656    {
657  0 if (PairwiseAlignPanel.PROGRESS.equals(pcEvent.getPropertyName()))
658    {
659  0 updateProgressBar((int) pcEvent.getNewValue());
660    }
661  0 else if (PairwiseAlignPanel.TOTAL.equals(pcEvent.getPropertyName()))
662    {
663  0 updateProgressBar((int) pcEvent.getNewValue(), 0);
664    }
665  0 else if (PairwiseAlignPanel.ETA.equals(pcEvent.getPropertyName()))
666    {
667  0 updateProgressBarEta((double) pcEvent.getNewValue());
668    }
669  0 else if (PairwiseAlignPanel.PROGRESSMESSAGE.equals(pcEvent.getPropertyName()))
670    {
671  0 setProgressBarMessage(progId, (String) pcEvent.getNewValue());
672    }
673  0 else if (PairwiseAlignPanel.PROGRESSCOMPLETE.equals(pcEvent.getPropertyName()))
674    {
675  0 setProgressBarMessage(progId, (String) pcEvent.getNewValue());
676    }
677    }
678    });
679    }
 
680  0 toggle @Override
681    public void registerHandler(final long id, final IProgressIndicatorHandler handler)
682    {
683  0 progressBar.registerHandler(id, handler);
684    }
685    /**
686    *
687    * @return true if any progress bars are still active
688    */
 
689  0 toggle @Override
690    public boolean operationInProgress()
691    {
692  0 return progressBar.operationInProgress();
693    }
694    /**
695    * Answers true if PaSiMap calculation is in progress, else false
696    *
697    * @return
698    */
 
699  0 toggle public boolean isWorking()
700    {
701  0 return working;
702    }
703    /**
704    * Answers the selected checkbox item index for PaSiMap dimension for the X, Y
705    * or Z axis of the display
706    *
707    * @param axis
708    * @return
709    */
 
710  3 toggle public int getSelectedDimensionIndex(Axis axis)
711    {
712  3 switch (axis)
713    {
714  1 case X:
715  1 return xCombobox.getSelectedIndex();
716  1 case Y:
717  1 return yCombobox.getSelectedIndex();
718  1 default:
719  1 return zCombobox.getSelectedIndex();
720    }
721    }
 
722  1 toggle public void setShowLabels(boolean show)
723    {
724  1 showLabels.setSelected(show);
725    }
 
726  10 toggle public AlignViewportI getAlignViewport()
727    {
728  10 return av;
729    }
 
730  24 toggle public RotatableCanvas getRotatableCanvas()
731    {
732  24 return rc;
733    }
 
734  2 toggle public void setRotatableCanvas(RotatableCanvas rc)
735    {
736  2 this.rc = rc;
737    }
 
738  12 toggle public int getTop()
739    {
740  12 return top;
741    }
 
742  2 toggle public void setTop(int top)
743    {
744  2 this.top = top;
745    }
746    /**
747    * set the associated view for this PaSiMap.
748    *
749    * @param panel
750    */
 
751  1 toggle public void selectAssociatedView(AlignmentPanel panel)
752    {
753  1 getRotatableCanvas().setApplyToAllViews(false);
754   
755  1 ap = panel;
756  1 av = panel.av;
757   
758  1 getRotatableCanvas().av = panel.av;
759  1 getRotatableCanvas().ap = panel;
760  1 PaintRefresher.Register(SpatialPanel.this, panel.av.getSequenceSetId());
761    }
 
762  0 toggle @Override
763    public JProgressBar getProgressBar(long id)
764    {
765  0 return progressBar.getProgressBar(id);
766    }
767    }