Must save all the feature settings
authoramwaterhouse <Andrew Waterhouse>
Wed, 9 Aug 2006 15:56:48 +0000 (15:56 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 9 Aug 2006 15:56:48 +0000 (15:56 +0000)
src/jalview/gui/Jalview2XML.java

index f1f8bb7..d6a0112 100755 (executable)
@@ -623,6 +623,8 @@ public class Jalview2XML
 \r
           String [] renderOrder =\r
               af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().renderOrder;\r
+\r
+          Vector settingsAdded = new Vector();\r
           for(int ro=0; ro<renderOrder.length; ro++)\r
           {\r
             Setting setting = new Setting();\r
@@ -636,8 +638,30 @@ public class Jalview2XML
                 );\r
 \r
             fs.addSetting(setting);\r
+            settingsAdded.addElement(renderOrder[ro]);\r
+          }\r
+\r
+          //Make sure we save none displayed feature settings\r
+          Enumeration en =\r
+              af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureColours.keys();\r
+          while(en.hasMoreElements())\r
+          {\r
+            String key = en.nextElement().toString();\r
+            if(settingsAdded.contains(key))\r
+              continue;\r
 \r
+            Setting setting = new Setting();\r
+            setting.setType(key);\r
+            setting.setColour(\r
+                af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().getColour(key).getRGB()\r
+                );\r
+\r
+            setting.setDisplay(false);\r
+\r
+            fs.addSetting(setting);\r
+            settingsAdded.addElement(key);\r
           }\r
+\r
           jms.setFeatureSettings(fs);\r
 \r
         }\r