2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
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 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package jalview.appletgui;
21 import java.awt.event.*;
22 import java.util.Hashtable;
23 import java.util.Vector;
25 import jalview.api.AlignmentViewPanel;
26 import jalview.datamodel.*;
27 import jalview.structure.StructureSelectionManager;
29 public class AlignmentPanel extends Panel implements AdjustmentListener, AlignmentViewPanel
32 public AlignViewport av;
34 OverviewPanel overviewPanel;
40 IdwidthAdjuster idwidthAdjuster;
42 public AlignFrame alignFrame;
44 ScalePanel scalePanel;
46 AnnotationPanel annotationPanel;
48 AnnotationLabels alabels;
50 // this value is set false when selection area being dragged
51 boolean fastPaint = true;
53 public void finalize() {
58 sequenceHolderPanel=null;
60 scalePanelHolder=null;
62 annotationPanelHolder=null;
63 annotationSpaceFillerHolder=null;
65 public AlignmentPanel(AlignFrame af, final AlignViewport av)
77 seqPanel = new SeqPanel(av, this);
78 idPanel = new IdPanel(av, this);
79 scalePanel = new ScalePanel(av, this);
80 idwidthAdjuster = new IdwidthAdjuster(this);
81 annotationPanel = new AnnotationPanel(this);
82 annotationPanelHolder.add(annotationPanel, BorderLayout.CENTER);
84 sequenceHolderPanel.add(annotationPanelHolder, BorderLayout.SOUTH);
86 alabels = new AnnotationLabels(this);
88 setAnnotationVisible(av.showAnnotation);
90 idPanelHolder.add(idPanel, BorderLayout.CENTER);
91 idSpaceFillerPanel1.add(idwidthAdjuster, BorderLayout.CENTER);
92 annotationSpaceFillerHolder.add(alabels, BorderLayout.CENTER);
93 scalePanelHolder.add(scalePanel, BorderLayout.CENTER);
94 seqPanelHolder.add(seqPanel, BorderLayout.CENTER);
97 setScrollValues(0, 0);
99 apvscroll.addAdjustmentListener(this);
100 hscroll.addAdjustmentListener(this);
101 vscroll.addAdjustmentListener(this);
103 addComponentListener(new ComponentAdapter()
105 public void componentResized(ComponentEvent evt)
107 setScrollValues(av.getStartRes(), av.getStartSeq());
108 if (getSize().height>0 && annotationPanelHolder.getSize().height>0) {
109 validateAnnotationDimensions(false);
116 Dimension d = calculateIdWidth();
117 idPanel.idCanvas.setSize(d);
119 hscrollFillerPanel.setSize(d.width, annotationPanel.getSize().height);
121 idPanel.idCanvas.setSize(d.width, seqPanel.seqCanvas.getSize().height);
122 annotationSpaceFillerHolder.setSize(d.width,
123 annotationPanel.getSize().height);
124 alabels.setSize(d.width, annotationPanel.getSize().height);
125 final AlignmentPanel ap = this;
126 av.addPropertyChangeListener(new java.beans.PropertyChangeListener()
128 public void propertyChange(java.beans.PropertyChangeEvent evt)
130 if (evt.getPropertyName().equals("alignment"))
132 PaintRefresher.Refresh(ap, av.getSequenceSetId(), true, true);
140 public SequenceRenderer getSequenceRenderer()
142 return seqPanel.seqCanvas.sr;
145 public FeatureRenderer getFeatureRenderer()
147 return seqPanel.seqCanvas.fr;
150 public void alignmentChanged()
152 av.alignmentChanged(this);
154 if (overviewPanel != null)
156 overviewPanel.updateOverviewImage();
159 alignFrame.updateEditMenuBar();
164 public void fontChanged()
166 // set idCanvas bufferedImage to null
167 // to prevent drawing old image
168 idPanel.idCanvas.image = null;
169 FontMetrics fm = getFontMetrics(av.getFont());
171 scalePanel.setSize(new Dimension(10, av.charHeight + fm.getDescent()));
172 idwidthAdjuster.setSize(new Dimension(10, av.charHeight
174 av.updateSequenceIdColours();
175 annotationPanel.image = null;
176 int ap = annotationPanel.adjustPanelHeight(false);
177 Dimension d = calculateIdWidth();
178 d.setSize(d.width + 4, seqPanel.seqCanvas.getSize().height);
179 alabels.setSize(d.width + 4, ap);
181 idPanel.idCanvas.setSize(d);
182 hscrollFillerPanel.setSize(d);
184 validateAnnotationDimensions(false);
185 annotationPanel.repaint();
189 if (overviewPanel != null)
191 overviewPanel.updateOverviewImage();
195 public void setIdWidth(int w, int h)
197 idPanel.idCanvas.setSize(w, h);
198 idPanelHolder.setSize(w, idPanelHolder.getSize().height);
199 annotationSpaceFillerHolder.setSize(w,annotationSpaceFillerHolder.getSize().height);
200 alabels.setSize(w, alabels.getSize().height);
204 Dimension calculateIdWidth()
206 if (av.nullFrame == null)
208 av.nullFrame = new Frame();
209 av.nullFrame.addNotify();
212 Graphics g = av.nullFrame.getGraphics();
214 FontMetrics fm = g.getFontMetrics(av.font);
215 AlignmentI al = av.getAlignment();
220 while (i < al.getHeight() && al.getSequenceAt(i) != null)
222 SequenceI s = al.getSequenceAt(i);
223 id = s.getDisplayId(av.getShowJVSuffix());
225 if (fm.stringWidth(id) > idWidth)
227 idWidth = fm.stringWidth(id);
232 // Also check annotation label widths
234 if (al.getAlignmentAnnotation() != null)
236 fm = g.getFontMetrics(av.nullFrame.getFont());
237 while (i < al.getAlignmentAnnotation().length)
239 String label = al.getAlignmentAnnotation()[i].label;
240 if (fm.stringWidth(label) > idWidth)
242 idWidth = fm.stringWidth(label);
248 return new Dimension(idWidth, idPanel.idCanvas.getSize().height);
252 * Highlight the given results on the alignment.
255 public void highlightSearchResults(SearchResults results)
257 scrollToPosition(results);
258 seqPanel.seqCanvas.highlightSearchResults(results);
262 * scroll the view to show the position of the highlighted region in results
263 * (if any) and redraw the overview
266 * @return false if results were not found
268 public boolean scrollToPosition(SearchResults results)
270 return scrollToPosition(results, true);
274 * scroll the view to show the position of the highlighted region in results
278 * @param redrawOverview
279 * - when set, the overview will be recalculated (takes longer)
280 * @return false if results were not found
282 public boolean scrollToPosition(SearchResults results,
283 boolean redrawOverview)
286 // do we need to scroll the panel?
287 if (results != null && results.getSize() > 0)
289 AlignmentI alignment=av.getAlignment();
290 int seqIndex = alignment.findIndex(results);
295 SequenceI seq = alignment.getSequenceAt(seqIndex);
296 int[] r = results.getResults(seq, 0,alignment.getWidth());
299 if (av.applet.debug) {// DEBUG
300 System.out.println("DEBUG: scroll didn't happen - results not within alignment : "+seq.getStart()+","+seq.getEnd());
304 if (av.applet.debug) {
306 /*System.out.println("DEBUG: scroll: start=" + r[0]
307 + " av.getStartRes()=" + av.getStartRes() + " end=" + r[1]
308 + " seq.end=" + seq.getEnd() + " av.getEndRes()="
309 + av.getEndRes() + " hextent=" + hextent);
318 if (end == seq.getEnd())
322 return scrollTo(start, end, seqIndex, false, redrawOverview);
326 public boolean scrollTo(int ostart, int end, int seqIndex, boolean scrollToNearest, boolean redrawOverview)
328 int startv, endv, starts, ends, width;
331 if (av.hasHiddenColumns())
333 start = av.getColumnSelection().findColumnPosition(ostart);
334 end = av.getColumnSelection().findColumnPosition(end);
337 if (!scrollToNearest && !av.getColumnSelection().isVisible(ostart))
339 // don't scroll - position isn't visible
348 if (!av.wrapAlignment)
351 int spos=av.getStartRes(),sqpos=av.getStartSeq();
352 if ((startv = av.getStartRes()) >= start)
356 // setScrollValues(start - 1, seqIndex);
358 else if ((endv = av.getEndRes()) <= end)
360 // setScrollValues(spos=startv + 1 + end - endv, seqIndex);
361 spos=startv + 1 + end - endv;
363 else if ((starts = av.getStartSeq()) > seqIndex)
365 setScrollValues(av.getStartRes(), seqIndex);
367 else if ((ends = av.getEndSeq()) <= seqIndex)
369 setScrollValues(av.getStartRes(), starts + seqIndex - ends + 1);
373 if ((av.getStartRes() > end)
374 || (av.getEndRes() < start)
375 || ((av.getStartSeq() > seqIndex) || (av.getEndSeq() < seqIndex)))
377 if (start > av.getAlignment().getWidth() - hextent)
379 start = av.getAlignment().getWidth() - hextent;
386 if (seqIndex > av.getAlignment().getHeight() - vextent)
388 seqIndex = av.getAlignment().getHeight() - vextent;
394 // System.out.println("trying to scroll to: "+start+" "+seqIndex);
395 setScrollValues(start, seqIndex);
400 scrollToWrappedVisible(start);
402 if (redrawOverview && overviewPanel != null)
404 overviewPanel.setBoxPosition();
406 paintAlignment(redrawOverview);
410 void scrollToWrappedVisible(int res)
412 int cwidth = seqPanel.seqCanvas
413 .getWrappedCanvasWidth(seqPanel.seqCanvas.getSize().width);
414 if (res <= av.getStartRes() || res >= (av.getStartRes() + cwidth))
416 vscroll.setValue(res / cwidth);
417 av.startRes = vscroll.getValue() * cwidth;
421 public OverviewPanel getOverviewPanel()
423 return overviewPanel;
426 public void setOverviewPanel(OverviewPanel op)
431 public void setAnnotationVisible(boolean b)
433 if (!av.wrapAlignment)
435 annotationSpaceFillerHolder.setVisible(b);
436 annotationPanelHolder.setVisible(b);
443 * automatically adjust annotation panel height for new annotation whilst
444 * ensuring the alignment is still visible.
446 public void adjustAnnotationHeight()
448 // TODO: display vertical annotation scrollbar if necessary
449 // this is called after loading new annotation onto alignment
450 if (alignFrame.getSize().height == 0)
452 System.out.println("NEEDS FIXING");
455 validateAnnotationDimensions(true);
456 apvscroll.addNotify();
459 paintAlignment(true);
462 * calculate the annotation dimensions and refresh slider values accordingly.
463 * need to do repaints/notifys afterwards.
465 protected void validateAnnotationDimensions(boolean adjustPanelHeight) {
466 boolean modified=false;
467 int height = annotationPanel.calcPanelHeight();
469 if (hscroll.isVisible())
471 height += (minsize=hscroll.getPreferredSize().height);
473 if (apvscroll.isVisible()) {
474 minsize+=apvscroll.getPreferredSize().height;
476 int mheight = height;
477 Dimension d=sequenceHolderPanel.getSize(),e=idPanel.getSize();
478 int seqandannot=d.height-scalePanelHolder.getSize().height;
479 // sets initial preferred height
480 if ((height+40) > seqandannot / 2)
482 height = seqandannot / 2;
484 if (!adjustPanelHeight)
486 // maintain same window layout whilst updating sliders
487 height=annotationPanelHolder.getSize().height;
490 if (seqandannot-height<5)
492 height = seqandannot;
494 annotationPanel.setSize(new Dimension(d.width,height));
495 alabels.setSize(new Dimension(e.width,height));
496 annotationSpaceFillerHolder.setSize(new Dimension(e.width, height));
497 annotationPanelHolder.setSize(new Dimension(d.width, height));
498 seqPanelHolder.setSize(d.width,seqandannot-height);
499 seqPanel.seqCanvas.setSize(d.width, seqPanel.seqCanvas.getSize().height);
500 int s=apvscroll.getValue();
501 if (s>mheight-height)
505 apvscroll.setValues(s, height, 0, mheight);
506 annotationPanel.setScrollOffset(apvscroll.getValue());
507 alabels.setScrollOffset(apvscroll.getValue());
510 public void setWrapAlignment(boolean wrap)
514 scalePanelHolder.setVisible(!wrap);
516 hscroll.setVisible(!wrap);
517 idwidthAdjuster.setVisible(!wrap);
521 annotationPanelHolder.setVisible(false);
522 annotationSpaceFillerHolder.setVisible(false);
524 else if (av.showAnnotation)
526 annotationPanelHolder.setVisible(true);
527 annotationSpaceFillerHolder.setVisible(true);
530 idSpaceFillerPanel1.setVisible(!wrap);
532 fontChanged(); // This is so that the scalePanel is resized correctly
543 // return value is true if the scroll is valid
544 public boolean scrollUp(boolean up)
548 if (vscroll.getValue() < 1)
552 setScrollValues(hscroll.getValue(), vscroll.getValue() - 1);
556 if (vextent + vscroll.getValue() >= av.getAlignment().getHeight())
560 setScrollValues(hscroll.getValue(), vscroll.getValue() + 1);
567 public boolean scrollRight(boolean right)
571 if (hscroll.getValue() < 1)
575 setScrollValues(hscroll.getValue() - 1, vscroll.getValue());
579 if (hextent + hscroll.getValue() >= av.getAlignment().getWidth())
583 setScrollValues(hscroll.getValue() + 1, vscroll.getValue());
590 public void setScrollValues(int x, int y)
592 int width = av.getAlignment().getWidth();
593 int height = av.getAlignment().getHeight();
595 if (av.hasHiddenColumns())
597 width = av.getColumnSelection().findColumnPosition(width);
601 hextent = seqPanel.seqCanvas.getSize().width / av.charWidth;
602 vextent = seqPanel.seqCanvas.getSize().height / av.charHeight;
609 if (vextent > height)
614 if ((hextent + x) > width)
616 System.err.println("hextent was "+hextent+" and x was "+x);
621 if ((vextent + y) > height)
623 y = height - vextent;
633 System.err.println("x was "+x);
639 int endSeq = y + vextent;
640 if (endSeq > av.getAlignment().getHeight())
642 endSeq = av.getAlignment().getHeight();
645 av.setEndSeq(endSeq);
647 av.setEndRes((x + (seqPanel.seqCanvas.getSize().width / av.charWidth)) - 1);
649 hscroll.setValues(x, hextent, 0, width);
650 vscroll.setValues(y, vextent, 0, height);
652 if (overviewPanel != null)
654 overviewPanel.setBoxPosition();
661 public void adjustmentValueChanged(AdjustmentEvent evt)
663 int oldX = av.getStartRes();
664 int oldY = av.getStartSeq();
666 if (evt == null || evt.getSource() == apvscroll)
668 annotationPanel.setScrollOffset(apvscroll.getValue());
669 alabels.setScrollOffset(apvscroll.getValue());
670 // annotationPanel.image=null;
671 // alabels.image=null;
672 // alabels.repaint();
673 // annotationPanel.repaint();
675 if (evt == null || evt.getSource() == hscroll)
677 int x = hscroll.getValue();
679 av.setEndRes(x + seqPanel.seqCanvas.getSize().width
680 / av.getCharWidth() - 1);
683 if (evt == null || evt.getSource() == vscroll)
685 int offy = vscroll.getValue();
686 if (av.getWrapAlignment())
688 int rowSize = seqPanel.seqCanvas
689 .getWrappedCanvasWidth(seqPanel.seqCanvas.getSize().width);
690 av.setStartRes(vscroll.getValue() * rowSize);
691 av.setEndRes((vscroll.getValue() + 1) * rowSize);
695 av.setStartSeq(offy);
696 av.setEndSeq(offy + seqPanel.seqCanvas.getSize().height
697 / av.getCharHeight());
701 if (overviewPanel != null)
703 overviewPanel.setBoxPosition();
706 int scrollX = av.startRes - oldX;
707 int scrollY = av.startSeq - oldY;
709 if (av.getWrapAlignment() || !fastPaint || av.MAC)
715 // Make sure we're not trying to draw a panel
716 // larger than the visible window
717 if (scrollX > av.endRes - av.startRes)
719 scrollX = av.endRes - av.startRes;
721 else if (scrollX < av.startRes - av.endRes)
723 scrollX = av.startRes - av.endRes;
726 idPanel.idCanvas.fastPaint(scrollY);
727 seqPanel.seqCanvas.fastPaint(scrollX, scrollY);
729 scalePanel.repaint();
730 if (av.getShowAnnotation())
732 annotationPanel.fastPaint(av.getStartRes() - oldX);
738 private void sendViewPosition()
740 StructureSelectionManager.getStructureSelectionManager(av.applet).sendViewPosition(this, av.startRes, av.endRes, av.startSeq, av.endSeq);
743 public void paintAlignment(boolean updateOverview)
749 jalview.structure.StructureSelectionManager
750 .getStructureSelectionManager(av.applet).sequenceColoursChanged(this);
752 if (overviewPanel != null)
754 overviewPanel.updateOverviewImage();
759 public void update(Graphics g)
764 public void paint(Graphics g)
767 Dimension d = idPanel.idCanvas.getSize();
768 idPanel.idCanvas.setSize(d.width, seqPanel.seqCanvas.getSize().height);
770 if (av.getWrapAlignment())
772 int maxwidth = av.getAlignment().getWidth();
774 if (av.hasHiddenColumns())
776 maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
779 int canvasWidth = seqPanel.seqCanvas
780 .getWrappedCanvasWidth(seqPanel.seqCanvas.getSize().width);
784 int max = maxwidth / canvasWidth;
785 vscroll.setMaximum(1 + max);
786 vscroll.setUnitIncrement(1);
787 vscroll.setVisibleAmount(1);
792 setScrollValues(av.getStartRes(), av.getStartSeq());
797 seqPanel.seqCanvas.repaint();
798 scalePanel.repaint();
799 annotationPanel.repaint();
800 idPanel.idCanvas.repaint();
803 protected Panel sequenceHolderPanel = new Panel();
805 protected Scrollbar vscroll = new Scrollbar();
807 protected Scrollbar hscroll = new Scrollbar();
809 protected Panel seqPanelHolder = new Panel();
811 BorderLayout borderLayout1 = new BorderLayout();
813 BorderLayout borderLayout3 = new BorderLayout();
815 protected Panel scalePanelHolder = new Panel();
817 protected Panel idPanelHolder = new Panel();
819 BorderLayout borderLayout5 = new BorderLayout();
821 protected Panel idSpaceFillerPanel1 = new Panel();
823 public Panel annotationSpaceFillerHolder = new Panel();
825 BorderLayout borderLayout6 = new BorderLayout();
827 BorderLayout borderLayout7 = new BorderLayout();
829 Panel hscrollHolder = new Panel();
831 BorderLayout borderLayout10 = new BorderLayout();
833 protected Panel hscrollFillerPanel = new Panel();
835 BorderLayout borderLayout11 = new BorderLayout();
837 BorderLayout borderLayout4 = new BorderLayout();
839 BorderLayout borderLayout2 = new BorderLayout();
841 Panel annotationPanelHolder = new Panel();
843 protected Scrollbar apvscroll = new Scrollbar();
845 BorderLayout borderLayout12 = new BorderLayout();
847 private void jbInit() throws Exception
849 // idPanelHolder.setPreferredSize(new Dimension(70, 10));
850 this.setLayout(borderLayout7);
852 //sequenceHolderPanel.setPreferredSize(new Dimension(150, 150));
853 sequenceHolderPanel.setLayout(borderLayout3);
854 seqPanelHolder.setLayout(borderLayout1);
855 scalePanelHolder.setBackground(Color.white);
857 // scalePanelHolder.setPreferredSize(new Dimension(10, 30));
858 scalePanelHolder.setLayout(borderLayout6);
859 idPanelHolder.setLayout(borderLayout5);
860 idSpaceFillerPanel1.setBackground(Color.white);
862 // idSpaceFillerPanel1.setPreferredSize(new Dimension(10, 30));
863 idSpaceFillerPanel1.setLayout(borderLayout11);
864 annotationSpaceFillerHolder.setBackground(Color.white);
866 // annotationSpaceFillerHolder.setPreferredSize(new Dimension(10, 80));
867 annotationSpaceFillerHolder.setLayout(borderLayout4);
868 hscroll.setOrientation(Scrollbar.HORIZONTAL);
869 hscrollHolder.setLayout(borderLayout10);
870 hscrollFillerPanel.setBackground(Color.white);
871 apvscroll.setOrientation(Scrollbar.VERTICAL);
872 apvscroll.setVisible(true);
873 apvscroll.addAdjustmentListener(this);
875 annotationPanelHolder.setBackground(Color.white);
876 annotationPanelHolder.setLayout(borderLayout12);
877 annotationPanelHolder.add(apvscroll, BorderLayout.EAST);
878 // hscrollFillerPanel.setPreferredSize(new Dimension(70, 10));
879 hscrollHolder.setBackground(Color.white);
881 // annotationScroller.setPreferredSize(new Dimension(10, 80));
882 // this.setPreferredSize(new Dimension(220, 166));
883 seqPanelHolder.setBackground(Color.white);
884 idPanelHolder.setBackground(Color.white);
885 sequenceHolderPanel.add(scalePanelHolder, BorderLayout.NORTH);
886 sequenceHolderPanel.add(seqPanelHolder, BorderLayout.CENTER);
887 seqPanelHolder.add(vscroll, BorderLayout.EAST);
889 // Panel3.add(secondaryPanelHolder, BorderLayout.SOUTH);
890 this.add(idPanelHolder, BorderLayout.WEST);
891 idPanelHolder.add(idSpaceFillerPanel1, BorderLayout.NORTH);
892 idPanelHolder.add(annotationSpaceFillerHolder, BorderLayout.SOUTH);
893 this.add(hscrollHolder, BorderLayout.SOUTH);
894 hscrollHolder.add(hscroll, BorderLayout.CENTER);
895 hscrollHolder.add(hscrollFillerPanel, BorderLayout.WEST);
896 this.add(sequenceHolderPanel, BorderLayout.CENTER);
900 * hides or shows dynamic annotation rows based on groups and av state flags
902 public void updateAnnotation()
904 updateAnnotation(false);
907 public void updateAnnotation(boolean applyGlobalSettings)
909 // TODO: this should be merged with other annotation update stuff - that
910 // sits on AlignViewport
911 boolean updateCalcs = false;
912 boolean conv = av.isShowGroupConservation();
913 boolean cons = av.isShowGroupConsensus();
914 boolean showprf = av.isShowSequenceLogo();
915 boolean showConsHist = av.isShowConsensusHistogram();
917 boolean sortg = true;
919 // remove old automatic annotation
920 // add any new annotation
922 Vector gr = av.getAlignment().getGroups(); // OrderedBy(av.alignment.getSequencesArray());
923 // intersect alignment annotation with alignment groups
925 AlignmentAnnotation[] aan = av.getAlignment().getAlignmentAnnotation();
926 Hashtable oldrfs = new Hashtable();
929 for (int an = 0; an < aan.length; an++)
931 if (aan[an].autoCalculated && aan[an].groupRef != null)
933 oldrfs.put(aan[an].groupRef, aan[an].groupRef);
934 av.getAlignment().deleteAnnotation(aan[an]);
942 for (int g = 0; g < gr.size(); g++)
945 sg = (SequenceGroup) gr.elementAt(g);
946 if (applyGlobalSettings || !oldrfs.containsKey(sg))
948 // set defaults for this group's conservation/consensus
949 sg.setshowSequenceLogo(showprf);
950 sg.setShowConsensusHistogram(showConsHist);
955 av.getAlignment().addAnnotation(sg.getConservationRow(), 0);
960 av.getAlignment().addAnnotation(sg.getConsensus(), 0);
962 // refresh the annotation rows
965 sg.recalcConservation();
970 adjustAnnotationHeight();
974 public AlignmentI getAlignment()
976 return av.getAlignment();
979 public StructureSelectionManager getStructureSelectionManager()
981 return StructureSelectionManager.getStructureSelectionManager(av.applet);
984 public void raiseOOMWarning(String string, OutOfMemoryError error)
987 System.err.println("Out of memory whilst '"+string+"'");
988 error.printStackTrace();