JAL-2435 mirror antiAlias setting between cDNA and Protein
authorJim Procter <jprocter@issues.jalview.org>
Fri, 12 May 2017 14:41:45 +0000 (15:41 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 12 May 2017 14:41:45 +0000 (15:41 +0100)
src/jalview/gui/FontChooser.java

index ec4ab49..06f29e9 100755 (executable)
@@ -75,6 +75,10 @@ public class FontChooser extends GFontChooser
 
   private boolean lastSelMono = false;
 
+  private boolean oldSmoothFont;
+
+  private boolean oldComplementSmooth;
+
   /**
    * Creates a new FontChooser for a tree panel
    * 
@@ -100,7 +104,7 @@ public class FontChooser extends GFontChooser
     oldFont = alignPanel.av.getFont();
     oldProteinScale = alignPanel.av.isScaleProteinAsCdna();
     oldMirrorFont = alignPanel.av.isProteinFontAsCdna();
-
+    oldSmoothFont = alignPanel.av.antiAlias;
     this.ap = alignPanel;
     init();
   }
@@ -122,6 +126,7 @@ public class FontChooser extends GFontChooser
     {
       oldComplementFont = ((AlignViewport) ap.av.getCodingComplement())
               .getFont();
+      oldComplementSmooth = ((AlignViewport) ap.av.getCodingComplement()).antiAlias;
       scaleAsCdna.setVisible(true);
       scaleAsCdna.setSelected(ap.av.isScaleProteinAsCdna());
       fontAsCdna.setVisible(true);
@@ -178,6 +183,14 @@ public class FontChooser extends GFontChooser
     ap.av.antiAlias = smoothFont.isSelected();
     ap.getAnnotationPanel().image = null;
     ap.paintAlignment(true);
+    if (ap.av.getCodingComplement() != null && ap.av.isProteinFontAsCdna())
+    {
+      ((AlignViewport) ap.av.getCodingComplement()).antiAlias = ap.av.antiAlias;
+      SplitFrame sv = (SplitFrame) ap.alignFrame.getSplitViewContainer();
+      sv.adjustLayout();
+      sv.repaint();
+    }
+
   }
 
   /**
@@ -219,12 +232,14 @@ public class FontChooser extends GFontChooser
       ap.av.setFont(oldFont, true);
       ap.av.setScaleProteinAsCdna(oldProteinScale);
       ap.av.setProteinFontAsCdna(oldMirrorFont);
+      ap.av.antiAlias = oldSmoothFont;
       ap.paintAlignment(true);
 
       if (scaleAsCdna.isVisible() && scaleAsCdna.isEnabled())
       {
         ap.av.getCodingComplement().setScaleProteinAsCdna(oldProteinScale);
         ap.av.getCodingComplement().setProteinFontAsCdna(oldMirrorFont);
+        ((AlignViewport) ap.av.getCodingComplement()).antiAlias = oldComplementSmooth;
         ap.av.getCodingComplement().setFont(oldComplementFont, true);
         SplitFrame splitFrame = (SplitFrame) ap.alignFrame
                 .getSplitViewContainer();