X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fappletgui%2FAlignmentPanel.java;h=61e8f12c06783bcd719c9f50a950358d76435ad8;hb=6a9cf7ddfdb65e38e8caa2d760877725b7f7bae0;hp=15b2198448b2267de76abe2c4b04997d2a20d92f;hpb=153dd62dc91da13ae732600e6ea55ddbe15eab39;p=jalview.git
diff --git a/src/jalview/appletgui/AlignmentPanel.java b/src/jalview/appletgui/AlignmentPanel.java
old mode 100755
new mode 100644
index 15b2198..61e8f12
--- a/src/jalview/appletgui/AlignmentPanel.java
+++ b/src/jalview/appletgui/AlignmentPanel.java
@@ -1,28 +1,47 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Copyright (C) 2014 The Jalview Authors
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- *
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with Jalview. If not, see .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.appletgui;
-import java.awt.*;
-import java.awt.event.*;
-
-import jalview.datamodel.*;
-
-public class AlignmentPanel extends Panel implements AdjustmentListener
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.SequenceI;
+import jalview.structure.StructureSelectionManager;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FontMetrics;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Panel;
+import java.awt.Scrollbar;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.AdjustmentListener;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+
+public class AlignmentPanel extends Panel implements AdjustmentListener,
+ AlignmentViewPanel
{
public AlignViewport av;
@@ -46,6 +65,20 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
// this value is set false when selection area being dragged
boolean fastPaint = true;
+ public void finalize()
+ {
+ alignFrame = null;
+ av = null;
+ seqPanel = null;
+ seqPanelHolder = null;
+ sequenceHolderPanel = null;
+ scalePanel = null;
+ scalePanelHolder = null;
+ annotationPanel = null;
+ annotationPanelHolder = null;
+ annotationSpaceFillerHolder = null;
+ }
+
public AlignmentPanel(AlignFrame af, final AlignViewport av)
{
try
@@ -63,12 +96,12 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
scalePanel = new ScalePanel(av, this);
idwidthAdjuster = new IdwidthAdjuster(this);
annotationPanel = new AnnotationPanel(this);
+ annotationPanelHolder.add(annotationPanel, BorderLayout.CENTER);
- sequenceHolderPanel.add(annotationPanel, BorderLayout.SOUTH);
-
+ sequenceHolderPanel.add(annotationPanelHolder, BorderLayout.SOUTH);
alabels = new AnnotationLabels(this);
- setAnnotationVisible(av.showAnnotation);
+ setAnnotationVisible(av.isShowAnnotation());
idPanelHolder.add(idPanel, BorderLayout.CENTER);
idSpaceFillerPanel1.add(idwidthAdjuster, BorderLayout.CENTER);
@@ -79,6 +112,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
fontChanged();
setScrollValues(0, 0);
+ apvscroll.addAdjustmentListener(this);
hscroll.addAdjustmentListener(this);
vscroll.addAdjustmentListener(this);
@@ -87,8 +121,14 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
public void componentResized(ComponentEvent evt)
{
setScrollValues(av.getStartRes(), av.getStartSeq());
+ if (getSize().height > 0
+ && annotationPanelHolder.getSize().height > 0)
+ {
+ validateAnnotationDimensions(false);
+ }
repaint();
}
+
});
Dimension d = calculateIdWidth();
@@ -100,7 +140,6 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
annotationSpaceFillerHolder.setSize(d.width,
annotationPanel.getSize().height);
alabels.setSize(d.width, annotationPanel.getSize().height);
-
final AlignmentPanel ap = this;
av.addPropertyChangeListener(new java.beans.PropertyChangeListener()
{
@@ -113,19 +152,29 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
}
}
});
-
}
+ @Override
+ public AlignViewportI getAlignViewport()
+ {
+ return av;
+ }
public SequenceRenderer getSequenceRenderer()
{
return seqPanel.seqCanvas.sr;
}
-
- public FeatureRenderer getFeatureRenderer()
+ @Override
+ public jalview.api.FeatureRenderer getFeatureRenderer()
{
return seqPanel.seqCanvas.fr;
}
-
+ @Override
+ public jalview.api.FeatureRenderer cloneFeatureRenderer()
+ {
+ FeatureRenderer nfr = new FeatureRenderer(av);
+ nfr.transferSettings(seqPanel.seqCanvas.fr);
+ return nfr;
+ }
public void alignmentChanged()
{
av.alignmentChanged(this);
@@ -147,19 +196,22 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
idPanel.idCanvas.image = null;
FontMetrics fm = getFontMetrics(av.getFont());
- scalePanel.setSize(new Dimension(10, av.charHeight + fm.getDescent()));
- idwidthAdjuster.setSize(new Dimension(10, av.charHeight
+ scalePanel.setSize(new Dimension(10, av.getCharHeight()
+ + fm.getDescent()));
+ idwidthAdjuster.setSize(new Dimension(10, av.getCharHeight()
+ fm.getDescent()));
av.updateSequenceIdColours();
annotationPanel.image = null;
- int ap = annotationPanel.adjustPanelHeight();
- annotationPanel.repaint();
+ int ap = annotationPanel.adjustPanelHeight(false);
Dimension d = calculateIdWidth();
d.setSize(d.width + 4, seqPanel.seqCanvas.getSize().height);
alabels.setSize(d.width + 4, ap);
+
idPanel.idCanvas.setSize(d);
hscrollFillerPanel.setSize(d);
+ validateAnnotationDimensions(false);
+ annotationPanel.repaint();
validate();
repaint();
@@ -173,6 +225,8 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
{
idPanel.idCanvas.setSize(w, h);
idPanelHolder.setSize(w, idPanelHolder.getSize().height);
+ annotationSpaceFillerHolder.setSize(w,
+ annotationSpaceFillerHolder.getSize().height);
alabels.setSize(w, alabels.getSize().height);
validate();
}
@@ -224,75 +278,159 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
return new Dimension(idWidth, idPanel.idCanvas.getSize().height);
}
+ /**
+ * Highlight the given results on the alignment.
+ *
+ */
public void highlightSearchResults(SearchResults results)
{
+ scrollToPosition(results);
seqPanel.seqCanvas.highlightSearchResults(results);
}
/**
* scroll the view to show the position of the highlighted region in results
+ * (if any) and redraw the overview
+ *
+ * @param results
+ * @return false if results were not found
+ */
+ public boolean scrollToPosition(SearchResults results)
+ {
+ return scrollToPosition(results, true);
+ }
+
+ /**
+ * scroll the view to show the position of the highlighted region in results
* (if any)
*
* @param results
+ * @param redrawOverview
+ * - when set, the overview will be recalculated (takes longer)
+ * @return false if results were not found
*/
- public void scrollToPosition(SearchResults results)
+ public boolean scrollToPosition(SearchResults results,
+ boolean redrawOverview)
{
+
// do we need to scroll the panel?
if (results != null && results.getSize() > 0)
{
- int seqIndex = av.alignment.findIndex(results);
+ AlignmentI alignment = av.getAlignment();
+ int seqIndex = alignment.findIndex(results);
if (seqIndex == -1)
{
- return;
+ return false;
}
- SequenceI seq = av.alignment.getSequenceAt(seqIndex);
- int[] r = results.getResults(seq, seq.getStart(), seq.getEnd());
+ SequenceI seq = alignment.getSequenceAt(seqIndex);
+ int[] r = results.getResults(seq, 0, alignment.getWidth());
if (r == null)
{
- return;
+ if (av.applet.debug)
+ {// DEBUG
+ System.out
+ .println("DEBUG: scroll didn't happen - results not within alignment : "
+ + seq.getStart() + "," + seq.getEnd());
+ }
+ return false;
+ }
+ if (av.applet.debug)
+ {
+ // DEBUG
+ /*
+ * System.out.println("DEBUG: scroll: start=" + r[0] +
+ * " av.getStartRes()=" + av.getStartRes() + " end=" + r[1] +
+ * " seq.end=" + seq.getEnd() + " av.getEndRes()=" + av.getEndRes() +
+ * " hextent=" + hextent);
+ */
}
int start = r[0];
int end = r[1];
if (start < 0)
{
- return;
+ return false;
}
if (end == seq.getEnd())
{
- return;
+ return false;
}
- if (!av.wrapAlignment)
+ return scrollTo(start, end, seqIndex, false, redrawOverview);
+ }
+ return true;
+ }
+
+ public boolean scrollTo(int ostart, int end, int seqIndex,
+ boolean scrollToNearest, boolean redrawOverview)
+ {
+ int startv, endv, starts, ends, width;
+
+ int start = -1;
+ if (av.hasHiddenColumns())
+ {
+ start = av.getColumnSelection().findColumnPosition(ostart);
+ end = av.getColumnSelection().findColumnPosition(end);
+ if (start == end)
+ {
+ if (!scrollToNearest && !av.getColumnSelection().isVisible(ostart))
+ {
+ // don't scroll - position isn't visible
+ return false;
+ }
+ }
+ }
+ else
+ {
+ start = ostart;
+ }
+ if (!av.getWrapAlignment())
+ {
+ /*
+ * int spos=av.getStartRes(),sqpos=av.getStartSeq(); if ((startv =
+ * av.getStartRes()) >= start) { spos=start-1; // seqIn //
+ * setScrollValues(start - 1, seqIndex); } else if ((endv =
+ * av.getEndRes()) <= end) { // setScrollValues(spos=startv + 1 + end -
+ * endv, seqIndex); spos=startv + 1 + end - endv; } else if ((starts =
+ * av.getStartSeq()) > seqIndex) { setScrollValues(av.getStartRes(),
+ * seqIndex); } else if ((ends = av.getEndSeq()) <= seqIndex) {
+ * setScrollValues(av.getStartRes(), starts + seqIndex - ends + 1); }
+ *
+ * /*
+ */
+ if ((av.getStartRes() > end)
+ || (av.getEndRes() < start)
+ || ((av.getStartSeq() > seqIndex) || (av.getEndSeq() < seqIndex)))
{
- if ((av.getStartRes() > end)
- || (av.getEndRes() < start)
- || ((av.getStartSeq() > seqIndex) || (av.getEndSeq() < seqIndex)))
+ if (start > av.getAlignment().getWidth() - hextent)
{
- if (start > av.alignment.getWidth() - hextent)
+ start = av.getAlignment().getWidth() - hextent;
+ if (start < 0)
{
- start = av.alignment.getWidth() - hextent;
- if (start < 0)
- {
- start = 0;
- }
+ start = 0;
}
- if (seqIndex > av.alignment.getHeight() - vextent)
+
+ }
+ if (seqIndex > av.getAlignment().getHeight() - vextent)
+ {
+ seqIndex = av.getAlignment().getHeight() - vextent;
+ if (seqIndex < 0)
{
- seqIndex = av.alignment.getHeight() - vextent;
- if (seqIndex < 0)
- {
- seqIndex = 0;
- }
+ seqIndex = 0;
}
- setScrollValues(start, seqIndex);
}
- }
- else
- {
- scrollToWrappedVisible(start);
- }
+ // System.out.println("trying to scroll to: "+start+" "+seqIndex);
+ setScrollValues(start, seqIndex);
+ }/**/
}
-
- repaint();
+ else
+ {
+ scrollToWrappedVisible(start);
+ }
+ if (redrawOverview && overviewPanel != null)
+ {
+ overviewPanel.setBoxPosition();
+ }
+ paintAlignment(redrawOverview);
+ return true;
}
void scrollToWrappedVisible(int res)
@@ -318,15 +456,109 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
public void setAnnotationVisible(boolean b)
{
- if (!av.wrapAlignment)
+ if (!av.getWrapAlignment())
{
annotationSpaceFillerHolder.setVisible(b);
- annotationPanel.setVisible(b);
+ annotationPanelHolder.setVisible(b);
+ }
+ else
+ {
+ annotationSpaceFillerHolder.setVisible(false);
+ annotationPanelHolder.setVisible(false);
}
validate();
repaint();
}
+ /**
+ * automatically adjust annotation panel height for new annotation whilst
+ * ensuring the alignment is still visible.
+ */
+ public void adjustAnnotationHeight()
+ {
+ // TODO: display vertical annotation scrollbar if necessary
+ // this is called after loading new annotation onto alignment
+ if (alignFrame.getSize().height == 0)
+ {
+ System.out.println("NEEDS FIXING");
+ }
+ fontChanged();
+ validateAnnotationDimensions(true);
+ apvscroll.addNotify();
+ hscroll.addNotify();
+ validate();
+ paintAlignment(true);
+ }
+
+ /**
+ * calculate the annotation dimensions and refresh slider values accordingly.
+ * need to do repaints/notifys afterwards.
+ */
+ protected void validateAnnotationDimensions(boolean adjustPanelHeight)
+ {
+ boolean modified = false;
+ int height = av.calcPanelHeight();
+ int minsize = 0;
+ if (hscroll.isVisible())
+ {
+ height += (minsize = hscroll.getPreferredSize().height);
+ }
+ if (apvscroll.isVisible())
+ {
+ minsize += apvscroll.getPreferredSize().height;
+ }
+ int mheight = height;
+ Dimension d = sequenceHolderPanel.getSize(), e = idPanel.getSize();
+ int seqandannot = d.height - scalePanelHolder.getSize().height;
+
+ if (adjustPanelHeight)
+ {
+ // NOTE: this logic is different in the application. Need a better
+ // algorithm to define behaviour
+ // sets initial preferred height
+ // try and set height according to alignment
+ float sscaling = (float) ((av.getCharHeight() * av.getAlignment()
+ .getHeight()) / (1.0 * mheight));
+ if (sscaling > 0.5)
+ {
+ // if the alignment is too big then
+ // default is 0.5 split
+ height = seqandannot / 2;
+ }
+ else
+ {
+ // otherwise just set the panel so that one row of sequence is visible
+ height = -av.getCharHeight() * 1
+ + (int) (seqandannot * (1 - sscaling));
+ }
+ }
+ else
+ {
+ // maintain same window layout whilst updating sliders
+ height = annotationPanelHolder.getSize().height;
+ }
+
+ if (seqandannot - height < 5)
+ {
+ height = seqandannot;
+ }
+ annotationPanel.setSize(new Dimension(d.width, height));
+ alabels.setSize(new Dimension(e.width, height));
+ annotationSpaceFillerHolder.setSize(new Dimension(e.width, height));
+ annotationPanelHolder.setSize(new Dimension(d.width, height));
+ // seqPanelHolder.setSize(d.width, seqandannot - height);
+ seqPanel.seqCanvas
+ .setSize(d.width, seqPanel.seqCanvas.getSize().height);
+ int s = apvscroll.getValue();
+ if (s > mheight - height)
+ {
+ s = 0;
+ }
+ apvscroll.setValues(s, height, 0, mheight);
+ annotationPanel.setScrollOffset(apvscroll.getValue(), false);
+ alabels.setScrollOffset(apvscroll.getValue(), false);
+ }
+
public void setWrapAlignment(boolean wrap)
{
av.startSeq = 0;
@@ -338,12 +570,12 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
if (wrap)
{
- annotationPanel.setVisible(false);
+ annotationPanelHolder.setVisible(false);
annotationSpaceFillerHolder.setVisible(false);
}
- else if (av.showAnnotation)
+ else if (av.isShowAnnotation())
{
- annotationPanel.setVisible(true);
+ annotationPanelHolder.setVisible(true);
annotationSpaceFillerHolder.setVisible(true);
}
@@ -352,6 +584,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
fontChanged(); // This is so that the scalePanel is resized correctly
validate();
+ sequenceHolderPanel.validate();
repaint();
}
@@ -409,20 +642,21 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
public void setScrollValues(int x, int y)
{
- int width = av.alignment.getWidth();
- int height = av.alignment.getHeight();
+ int width = av.getAlignment().getWidth();
+ int height = av.getAlignment().getHeight();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
width = av.getColumnSelection().findColumnPosition(width);
}
+ if (x < 0)
+ {
+ x = 0;
+ }
+ ;
- av.setStartRes(x);
- av
- .setEndRes((x + (seqPanel.seqCanvas.getSize().width / av.charWidth)) - 1);
-
- hextent = seqPanel.seqCanvas.getSize().width / av.charWidth;
- vextent = seqPanel.seqCanvas.getSize().height / av.charHeight;
+ hextent = seqPanel.seqCanvas.getSize().width / av.getCharWidth();
+ vextent = seqPanel.seqCanvas.getSize().height / av.getCharHeight();
if (hextent > width)
{
@@ -436,6 +670,8 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
if ((hextent + x) > width)
{
+ System.err.println("hextent was " + hextent + " and x was " + x);
+
x = width - hextent;
}
@@ -451,18 +687,23 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
if (x < 0)
{
+ System.err.println("x was " + x);
x = 0;
}
av.setStartSeq(y);
int endSeq = y + vextent;
- if (endSeq > av.alignment.getHeight())
+ if (endSeq > av.getAlignment().getHeight())
{
- endSeq = av.alignment.getHeight();
+ endSeq = av.getAlignment().getHeight();
}
av.setEndSeq(endSeq);
+ av.setStartRes(x);
+ av.setEndRes((x + (seqPanel.seqCanvas.getSize().width / av
+ .getCharWidth())) - 1);
+
hscroll.setValues(x, hextent, 0, width);
vscroll.setValues(y, vextent, 0, height);
@@ -470,6 +711,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
{
overviewPanel.setBoxPosition();
}
+ sendViewPosition();
}
@@ -478,6 +720,15 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
int oldX = av.getStartRes();
int oldY = av.getStartSeq();
+ if (evt == null || evt.getSource() == apvscroll)
+ {
+ annotationPanel.setScrollOffset(apvscroll.getValue(), false);
+ alabels.setScrollOffset(apvscroll.getValue(), false);
+ // annotationPanel.image=null;
+ // alabels.image=null;
+ // alabels.repaint();
+ // annotationPanel.repaint();
+ }
if (evt == null || evt.getSource() == hscroll)
{
int x = hscroll.getValue();
@@ -533,12 +784,20 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
seqPanel.seqCanvas.fastPaint(scrollX, scrollY);
scalePanel.repaint();
- if (av.getShowAnnotation())
+ if (av.isShowAnnotation())
{
annotationPanel.fastPaint(av.getStartRes() - oldX);
}
}
+ sendViewPosition();
+
+ }
+ private void sendViewPosition()
+ {
+ StructureSelectionManager.getStructureSelectionManager(av.applet)
+ .sendViewPosition(this, av.startRes, av.endRes, av.startSeq,
+ av.endSeq);
}
public void paintAlignment(boolean updateOverview)
@@ -548,7 +807,8 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
if (updateOverview)
{
jalview.structure.StructureSelectionManager
- .getStructureSelectionManager().sequenceColoursChanged(this);
+ .getStructureSelectionManager(av.applet)
+ .sequenceColoursChanged(this);
if (overviewPanel != null)
{
@@ -567,16 +827,12 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
invalidate();
Dimension d = idPanel.idCanvas.getSize();
idPanel.idCanvas.setSize(d.width, seqPanel.seqCanvas.getSize().height);
- annotationSpaceFillerHolder.setSize(d.width,
- annotationPanel.getSize().height);
-
- alabels.setSize(d.width, annotationPanel.getSize().height);
if (av.getWrapAlignment())
{
- int maxwidth = av.alignment.getWidth();
+ int maxwidth = av.getAlignment().getWidth();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
}
@@ -587,7 +843,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
if (canvasWidth > 0)
{
int max = maxwidth / canvasWidth;
- vscroll.setMaximum(max);
+ vscroll.setMaximum(1 + max);
vscroll.setUnitIncrement(1);
vscroll.setVisibleAmount(1);
}
@@ -597,12 +853,18 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
setScrollValues(av.getStartRes(), av.getStartSeq());
}
- alabels.repaint();
-
seqPanel.seqCanvas.repaint();
- scalePanel.repaint();
- annotationPanel.repaint();
idPanel.idCanvas.repaint();
+ if (!av.getWrapAlignment())
+ {
+ if (av.isShowAnnotation())
+ {
+ alabels.repaint();
+ annotationPanel.repaint();
+ }
+ scalePanel.repaint();
+ }
+
}
protected Panel sequenceHolderPanel = new Panel();
@@ -643,6 +905,12 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
BorderLayout borderLayout2 = new BorderLayout();
+ Panel annotationPanelHolder = new Panel();
+
+ protected Scrollbar apvscroll = new Scrollbar();
+
+ BorderLayout borderLayout12 = new BorderLayout();
+
private void jbInit() throws Exception
{
// idPanelHolder.setPreferredSize(new Dimension(70, 10));
@@ -667,7 +935,13 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
hscroll.setOrientation(Scrollbar.HORIZONTAL);
hscrollHolder.setLayout(borderLayout10);
hscrollFillerPanel.setBackground(Color.white);
+ apvscroll.setOrientation(Scrollbar.VERTICAL);
+ apvscroll.setVisible(true);
+ apvscroll.addAdjustmentListener(this);
+ annotationPanelHolder.setBackground(Color.white);
+ annotationPanelHolder.setLayout(borderLayout12);
+ annotationPanelHolder.add(apvscroll, BorderLayout.EAST);
// hscrollFillerPanel.setPreferredSize(new Dimension(70, 10));
hscrollHolder.setBackground(Color.white);
@@ -689,4 +963,52 @@ public class AlignmentPanel extends Panel implements AdjustmentListener
this.add(sequenceHolderPanel, BorderLayout.CENTER);
}
+ /**
+ * hides or shows dynamic annotation rows based on groups and av state flags
+ */
+ public void updateAnnotation()
+ {
+ updateAnnotation(false);
+ }
+
+ public void updateAnnotation(boolean applyGlobalSettings)
+ {
+ updateAnnotation(applyGlobalSettings, false);
+ }
+
+ public void updateAnnotation(boolean applyGlobalSettings,
+ boolean preserveNewGroupSettings)
+ {
+ av.updateGroupAnnotationSettings(applyGlobalSettings,
+ preserveNewGroupSettings);
+ adjustAnnotationHeight();
+ }
+
+ @Override
+ public AlignmentI getAlignment()
+ {
+ return av.getAlignment();
+ }
+
+ @Override
+ public String getViewName()
+ {
+ return getName();
+ }
+
+ @Override
+ public StructureSelectionManager getStructureSelectionManager()
+ {
+ return StructureSelectionManager
+ .getStructureSelectionManager(av.applet);
+ }
+
+ @Override
+ public void raiseOOMWarning(String string, OutOfMemoryError error)
+ {
+ // TODO: JAL-960
+ System.err.println("Out of memory whilst '" + string + "'");
+ error.printStackTrace();
+ }
+
}