JAL-845 repaint of complementary selection (applet)
[jalview.git] / src / jalview / appletgui / SplitFrame.java
index 4f61f4a..fb11a5c 100644 (file)
@@ -8,8 +8,12 @@ import jalview.datamodel.AlignmentI;
 import jalview.structure.StructureSelectionManager;
 
 import java.awt.BorderLayout;
+import java.awt.Component;
 import java.awt.GridLayout;
+import java.awt.MouseInfo;
 import java.awt.Panel;
+import java.awt.Point;
+import java.awt.Rectangle;
 
 public class SplitFrame extends EmbmenuFrame
 {
@@ -39,16 +43,7 @@ public class SplitFrame extends EmbmenuFrame
    */
   public void init()
   {
-    setMenuBar(null);
-    outermost = new Panel(new GridLayout(2, 1));
-
-    Panel topPanel = new Panel();
-    Panel bottomPanel = new Panel();
-    outermost.add(topPanel);
-    outermost.add(bottomPanel);
-
-    addAlignFrameComponents(topFrame, topPanel);
-    addAlignFrameComponents(bottomFrame, bottomPanel);
+    constructSplit();
 
     /*
      * Try to make and add dna/protein sequence mappings
@@ -74,16 +69,40 @@ public class SplitFrame extends EmbmenuFrame
       ssm.addCommandListener(protein);
     }
 
-    /*
-     * Expand protein to 3 times character width of dna
-     */
+    setCharacterWidth(protein, cdna);
+  }
+
+  /**
+   * 
+   */
+  protected void constructSplit()
+  {
+    setMenuBar(null);
+    outermost = new Panel(new GridLayout(2, 1));
+
+    Panel topPanel = new Panel();
+    Panel bottomPanel = new Panel();
+    outermost.add(topPanel);
+    outermost.add(bottomPanel);
+
+    addAlignFrameComponents(topFrame, topPanel);
+    addAlignFrameComponents(bottomFrame, bottomPanel);
+  }
+
+  /**
+   * Expand protein to 3 times character width of dna
+   * 
+   * @param protein
+   * @param cdna
+   */
+  protected void setCharacterWidth(AlignViewport protein, AlignViewport cdna)
+  {
     if (protein != null && cdna != null)
     {
       ViewStyleI vs = protein.getViewStyle();
       vs.setCharWidth(3 * vs.getCharWidth());
       protein.setViewStyle(vs);
     }
-
   }
 
   /**