/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
* Creates a new AlignmentPanel object.
*
* @param af
- * DOCUMENT ME!
* @param av
- * DOCUMENT ME!
*/
public AlignmentPanel(AlignFrame af, final AlignViewport av)
{
setScrollValues(0, 0);
- setAnnotationVisible(av.isShowAnnotation());
-
hscroll.addAdjustmentListener(this);
vscroll.addAdjustmentListener(this);
});
fontChanged();
adjustAnnotationHeight();
-
+ updateLayout();
}
@Override
getAnnotationPanel().adjustPanelHeight();
Dimension d = calculateIdWidth();
+
d.setSize(d.width + 4, d.height);
getIdPanel().getIdCanvas().setPreferredSize(d);
hscrollFillerPanel.setPreferredSize(d);
{
overviewPanel.setBoxPosition();
}
+ if (this.alignFrame.getSplitViewContainer() != null)
+ {
+ ((SplitFrame) this.alignFrame.getSplitViewContainer()).adjustLayout();
+ }
repaint();
}
public Dimension calculateIdWidth()
{
// calculate sensible default width when no preference is available
-
- int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300);
- int maxwidth = Math.max(20,
- Math.min(afwidth - 200, 2 * afwidth / 3));
- return calculateIdWidth(maxwidth);
+ Dimension r = null;
+ if (av.getIdWidth() < 0)
+ {
+ int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300);
+ int maxwidth = Math.max(20, Math.min(afwidth - 200, 2 * afwidth / 3));
+ r = calculateIdWidth(maxwidth);
+ av.setIdWidth(r.width);
+ }
+ else
+ {
+ r = new Dimension();
+ r.width = av.getIdWidth();
+ r.height = 0;
+ }
+ return r;
}
/**
}
/**
- * DOCUMENT ME!
+ * update alignment layout for viewport settings
*
* @param wrap
* DOCUMENT ME!
*/
- public void setWrapAlignment(boolean wrap)
+ public void updateLayout()
{
+ fontChanged();
+ setAnnotationVisible(av.isShowAnnotation());
+ boolean wrap = av.getWrapAlignment();
av.startSeq = 0;
scalePanelHolder.setVisible(!wrap);
hscroll.setVisible(!wrap);
*/
public void adjustmentValueChanged(AdjustmentEvent evt)
{
-
int oldX = av.getStartRes();
int oldY = av.getStartSeq();
if (alignFrame != null && !headless)
{
alignFrame.setProgressBar(MessageManager.formatMessage(
- "status.saving_file",
- new String[]
+ "status.saving_file", new Object[]
{ type.getLabel() }), progress);
}
try
sy = s * av.getCharHeight() + scaleHeight;
SequenceI seq = av.getAlignment().getSequenceAt(s);
- SequenceFeature[] features = seq.getDatasetSequence()
- .getSequenceFeatures();
+ SequenceFeature[] features = seq.getSequenceFeatures();
SequenceGroup[] groups = av.getAlignment().findAllGroups(seq);
for (res = 0; res < alwidth; res++)
{
text = new StringBuffer();
- Object obj = null;
+ String triplet = null;
if (av.getAlignment().isNucleotide())
{
- obj = ResidueProperties.nucleotideName.get(seq.getCharAt(res)
+ triplet = ResidueProperties.nucleotideName.get(seq
+ .getCharAt(res)
+ "");
}
else
{
- obj = ResidueProperties.aa2Triplet.get(seq.getCharAt(res)
+ triplet = ResidueProperties.aa2Triplet.get(seq.getCharAt(res)
+ "");
}
- if (obj == null)
+ if (triplet == null)
{
continue;
}
- String triplet = obj.toString();
int alIndex = seq.findPosition(res);
gSize = groups.length;
for (g = 0; g < gSize; g++)
.getStructureSelectionManager();
ssm.removeStructureViewerListener(getSeqPanel(), null);
ssm.removeSelectionListener(getSeqPanel());
+ ssm.removeCommandListener(av);
+ ssm.removeStructureViewerListener(getSeqPanel(), null);
+ ssm.removeSelectionListener(getSeqPanel());
av.setAlignment(null);
av = null;
}