JAL-845 SplitFrame for "show product" and after aligning from SplitFrame
[jalview.git] / src / jalview / gui / AlignViewport.java
index 4ba2113..cad90e3 100644 (file)
@@ -300,10 +300,10 @@ public class AlignViewport extends AlignmentViewport implements
       showConsensus = Cache.getDefault("SHOW_IDENTITY", true);
     }
     initAutoAnnotation();
-    if (jalview.bin.Cache.getProperty("DEFAULT_COLOUR") != null)
+    if (jalview.bin.Cache.getProperty(Preferences.DEFAULT_COLOUR) != null)
     {
       globalColourScheme = ColourSchemeProperty.getColour(alignment,
-              jalview.bin.Cache.getProperty("DEFAULT_COLOUR"));
+              jalview.bin.Cache.getProperty(Preferences.DEFAULT_COLOUR));
 
       if (globalColourScheme instanceof UserColourScheme)
       {
@@ -1060,7 +1060,8 @@ public class AlignViewport extends AlignmentViewport implements
 
     if (openSplitPane)
     {
-      protein = openSplitFrame(newAlignFrame, thisAlignment);
+      protein = openSplitFrame(newAlignFrame,
+              thisAlignment.getSequencesArray());
     }
 
     /*
@@ -1080,18 +1081,19 @@ public class AlignViewport extends AlignmentViewport implements
    * 
    * @param newAlignFrame
    *          containing a new alignment to be shown
-   * @param existingAlignment
-   *          an existing alignment to be copied for display in the split frame
+   * @param seqs
+   *          'complementary' sequences to show in the other split half
    * @return the protein alignment in the split frame
    */
   protected AlignmentI openSplitFrame(AlignFrame newAlignFrame,
-          AlignmentI existingAlignment)
+          SequenceI[] seqs)
   {
+    AlignmentI complementAlignment = new Alignment(seqs);
     // TODO: move this to a factory/controller method ?
     /*
      * Open in split pane. DNA sequence above, protein below.
      */
-    AlignFrame copyMe = new AlignFrame(existingAlignment,
+    AlignFrame copyMe = new AlignFrame(complementAlignment,
             AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
     copyMe.setTitle(getAlignPanel().alignFrame.getTitle());
 
@@ -1109,20 +1111,6 @@ public class AlignViewport extends AlignmentViewport implements
     JInternalFrame splitFrame = new SplitFrame(cdnaFrame, proteinFrame);
     Desktop.addInternalFrame(splitFrame, linkedTitle, -1, -1);
 
-    /*
-     * Set the frames to listen for each other's edit and sort commands.
-     */
-    final StructureSelectionManager ssm = StructureSelectionManager
-            .getStructureSelectionManager(Desktop.instance);
-    ssm.addCommandListener(cdnaFrame.getViewport());
-    ssm.addCommandListener(proteinFrame.getViewport());
-
-    /*
-     * 'Coding complement' (dna/protein) views will mirror each others' edits,
-     * selections, sorting etc as decided from time to time by the relevant
-     * authorities.
-     */
-    proteinFrame.getViewport().setCodingComplement(cdnaFrame.getViewport());
     return protein;
   }