Maintain feature order
authoramwaterhouse <Andrew Waterhouse>
Wed, 5 Apr 2006 16:40:20 +0000 (16:40 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 5 Apr 2006 16:40:20 +0000 (16:40 +0000)
src/jalview/gui/Jalview2XML.java

index db60b8b..d652da2 100755 (executable)
@@ -506,18 +506,18 @@ public class Jalview2XML
           jalview.schemabinding.version2.FeatureSettings fs\r
               = new jalview.schemabinding.version2.FeatureSettings();\r
 \r
-          Enumeration e = af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureColours.keys();\r
-          while (e.hasMoreElements())\r
+          String [] renderOrder =\r
+              af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().renderOrder;\r
+          for(int ro=0; ro<renderOrder.length; ro++)\r
           {\r
-            String type = e.nextElement().toString();\r
             Setting setting = new Setting();\r
-            setting.setType(type);\r
+            setting.setType(renderOrder[ro]);\r
             setting.setColour(\r
-                af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().getColour(type).getRGB()\r
+                af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().getColour(renderOrder[ro]).getRGB()\r
                 );\r
 \r
             setting.setDisplay(\r
-                av.featuresDisplayed.containsKey(type)\r
+                av.featuresDisplayed.containsKey(renderOrder[ro])\r
                 );\r
 \r
             fs.addSetting(setting);\r