JAL-1655 JAL-845 special support to set column width of protein panel 3*width of...
authorJim Procter <jprocter@dundee.ac.uk>
Wed, 11 Feb 2015 09:23:42 +0000 (09:23 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Wed, 11 Feb 2015 09:23:42 +0000 (09:23 +0000)
src/jalview/gui/AlignFrame.java

index 6a42a65..d5f34b3 100644 (file)
@@ -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();
+
                 }
               }
             });