From: Jim Procter Date: Wed, 11 Feb 2015 09:23:42 +0000 (+0000) Subject: JAL-1655 JAL-845 special support to set column width of protein panel 3*width of... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6a9cf7ddfdb65e38e8caa2d760877725b7f7bae0;p=jalview.git JAL-1655 JAL-845 special support to set column width of protein panel 3*width of dna panel - probably should refactor logic to a SplitFrame.setStyle method call.. --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 6a42a65..d5f34b3 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -33,6 +33,7 @@ import jalview.api.AlignViewControllerGuiI; import jalview.api.AlignViewControllerI; import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; +import jalview.api.ViewStyleI; import jalview.api.analysis.ScoreModelI; import jalview.bin.Cache; import jalview.commands.CommandI; @@ -382,14 +383,33 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { if (origview.size() > 0) { - origview.get(0) - .getAlignViewport() - .setViewStyle( - selviews.get(0).getAlignViewport() - .getViewStyle()); + ViewStyleI vs = selviews.get(0).getAlignViewport() + .getViewStyle(); + origview.get(0).getAlignViewport().setViewStyle(vs); + AlignViewportI complement = origview.get(0) + .getAlignViewport().getCodingComplement(); + if (complement != null) + { + AlignFrame af = Desktop.getAlignFrameFor(complement); + if (complement.isNucleotide()) + { + complement.setViewStyle(vs); + vs.setCharWidth(vs.getCharWidth() / 3); + } + else + { + int rw = vs.getCharWidth(); + vs.setCharWidth(rw * 3); + complement.setViewStyle(vs); + vs.setCharWidth(rw); + } + af.alignPanel.updateLayout(); + af.setMenusForViewport(); + } origview.get(0).updateLayout(); origview.get(0).setSelected(true); origview.get(0).alignFrame.setMenusForViewport(); + } } });