import javax.swing.JPanel;
+import jalview.api.AlignViewportI;
+
/**
* DOCUMENT ME!
*
{
active = false;
repaint();
+
+ /*
+ * If in a SplitFrame with co-scaled alignments, set the other's id width to
+ * match
+ */
+ final AlignViewportI viewport = ap.getAlignViewport();
+ if (viewport.getCodingComplement() != null
+ && viewport.isScaleProteinAsCdna())
+ {
+ viewport.getCodingComplement().setIdWidth(viewport.getIdWidth());
+ SplitFrame sf = (SplitFrame) ap.alignFrame.getSplitViewContainer();
+ sf.repaint();
+ }
+
}
/**
{
active = true;
- int curwidth = ap.getAlignViewport().getIdWidth();
+ final AlignViewportI viewport = ap.getAlignViewport();
+ int curwidth = viewport.getIdWidth();
int dif = evt.getX() - oldX;
- if (((curwidth + dif) > 20) || (dif > 0))
+ final int newWidth = curwidth + dif;
+ if ((newWidth > 20) || (dif > 0))
{
- ap.getAlignViewport().setIdWidth(curwidth + dif);
+ viewport.setIdWidth(newWidth);
ap.paintAlignment(true);
}
{
AlignFrame topFrame = (AlignFrame) getTopFrame();
AlignFrame bottomFrame = (AlignFrame) getBottomFrame();
+ final boolean scaleProteinAsCdna = topFrame.viewport
+ .isScaleProteinAsCdna();
AlignmentPanel newTopPanel = topFrame.newView(null, true);
AlignmentPanel newBottomPanel = bottomFrame.newView(null, true);
newBottomPanel.av.viewName = newTopPanel.av.viewName;
newTopPanel.av.setCodingComplement(newBottomPanel.av);
+ /*
+ * These lines can be removed once scaleProteinAsCdna is added to element
+ * Viewport in jalview.xsd, as Jalview2XML.copyAlignPanel will then take
+ * care of it
+ */
+ newTopPanel.av.setScaleProteinAsCdna(scaleProteinAsCdna);
+ newBottomPanel.av.setScaleProteinAsCdna(scaleProteinAsCdna);
+
+ /*
+ * Line up id labels etc
+ */
+ adjustLayout();
+
final StructureSelectionManager ssm = StructureSelectionManager
.getStructureSelectionManager(Desktop.instance);
ssm.addCommandListener(newTopPanel.av);