Must copy feature settings from one frame to another as they are not attached ot...
authoramwaterhouse <Andrew Waterhouse>
Thu, 6 Apr 2006 09:24:42 +0000 (09:24 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 6 Apr 2006 09:24:42 +0000 (09:24 +0000)
src/jalview/gui/AlignFrame.java
src/jalview/ws/MsaWSClient.java

index ccf7303..0167b39 100755 (executable)
@@ -195,6 +195,11 @@ public class AlignFrame
     return  jalview.bin.Cache.getProperty("VERSION");\r
   }\r
 \r
+  public FeatureRenderer getFeatureRenderer()\r
+  {\r
+    return alignPanel.seqPanel.seqCanvas.getFeatureRenderer();\r
+  }\r
+\r
 \r
   public void fetchSequence_actionPerformed(ActionEvent e)\r
   {\r
@@ -707,8 +712,9 @@ public class AlignFrame
         String newtitle = new String("Copied sequences");\r
 \r
         //>>>This is a fix for the moment, until a better solution is found!!<<<\r
-        FeatureRenderer fr = af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer();\r
-        fr.featureColours = alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureColours;\r
+        af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().transferSettings(\r
+            alignPanel.seqPanel.seqCanvas.getFeatureRenderer());\r
+\r
 \r
         if (title.startsWith("Copied sequences"))\r
         {\r
@@ -2355,6 +2361,7 @@ public class AlignFrame
       {\r
         // Add any Multiple Sequence Alignment Services\r
         final JMenu msawsmenu = new JMenu("Alignment");\r
+        final AlignFrame af = this;\r
         for (int i = 0, j = msaws.size(); i < j; i++)\r
         {\r
           final ext.vamsas.ServiceHandle sh = (ext.vamsas.ServiceHandle) msaws.\r
@@ -2366,7 +2373,7 @@ public class AlignFrame
             {\r
               SequenceI[] msa = gatherSequencesForAlignment();\r
               new jalview.ws.MsaWSClient(sh, title, msa,\r
-                  false, true, viewport.getAlignment().getDataset());\r
+                  false, true, viewport.getAlignment().getDataset(), af);\r
 \r
             }\r
 \r
@@ -2383,7 +2390,7 @@ public class AlignFrame
               {\r
                 SequenceI[] msa = gatherSequencesForAlignment();\r
                 new jalview.ws.MsaWSClient(sh, title, msa,\r
-                    true, true, viewport.getAlignment().getDataset());\r
+                    true, true, viewport.getAlignment().getDataset(), af);\r
 \r
               }\r
 \r
index 479f22f..59a858e 100755 (executable)
@@ -43,6 +43,7 @@ public class MsaWSClient
    * server is a WSDL2Java generated stub for an archetypal MsaWSI service.\r
    */\r
   ext.vamsas.MuscleWS server;\r
+  AlignFrame alignFrame;\r
 \r
 \r
   /**\r
@@ -56,10 +57,14 @@ public class MsaWSClient
    * @param preserveOrder DOCUMENT ME!\r
    */\r
 \r
-  public MsaWSClient(ext.vamsas.ServiceHandle sh, String altitle, SequenceI[] msa,\r
-                     boolean submitGaps, boolean preserveOrder, Alignment seqdataset)\r
+  public MsaWSClient(ext.vamsas.ServiceHandle sh, String altitle,\r
+                     SequenceI[] msa,\r
+                     boolean submitGaps, boolean preserveOrder,\r
+                     Alignment seqdataset,\r
+                     AlignFrame _alignFrame)\r
   {\r
 \r
+    alignFrame = _alignFrame;\r
     if (!sh.getAbstractName().equals("MsaWS"))\r
     {\r
       JOptionPane.showMessageDialog(Desktop.desktop,\r
@@ -474,6 +479,10 @@ public class MsaWSClient
           }\r
           // TODO: JBPNote Should also rename the query sequence sometime...\r
           AlignFrame af = new AlignFrame(al);\r
+\r
+          //>>>This is a fix for the moment, until a better solution is found!!<<<\r
+          alignFrame.getFeatureRenderer().transferSettings(af.getFeatureRenderer());\r
+\r
           af.addSortByOrderMenuItem(ServiceName + " Ordering",\r
                                     msaorder);\r
 \r