Features now an array
authoramwaterhouse <Andrew Waterhouse>
Fri, 24 Feb 2006 11:44:02 +0000 (11:44 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 24 Feb 2006 11:44:02 +0000 (11:44 +0000)
src/jalview/gui/Jalview2XML.java

index e387967..7e2d1dd 100755 (executable)
@@ -195,20 +195,21 @@ public class Jalview2XML
 \r
             if(jal.getSequenceAt(i).getDatasetSequence().getSequenceFeatures()!=null)\r
             {\r
-              Enumeration en = jal.getSequenceAt(i).getDatasetSequence().getSequenceFeatures().elements();\r
-              while(en.hasMoreElements())\r
+              jalview.datamodel.SequenceFeature[] sf\r
+                  = jal.getSequenceAt(i).getDatasetSequence().getSequenceFeatures();\r
+              int index = 0;\r
+              while(index < sf.length)\r
               {\r
                 Features features = new Features();\r
-                jalview.datamodel.SequenceFeature sf\r
-                   = (jalview.datamodel.SequenceFeature)en.nextElement();\r
-\r
-                features.setBegin(sf.getBegin());\r
-                features.setEnd(sf.getEnd());\r
-                features.setDescription(sf.getDescription());\r
-                features.setStatus(sf.getStatus());\r
-                features.setType(sf.getType());\r
-                features.setFeatureGroup(sf.getFeatureGroup());\r
+\r
+                features.setBegin(sf[index].getBegin());\r
+                features.setEnd(sf[index].getEnd());\r
+                features.setDescription(sf[index].getDescription());\r
+                features.setStatus(sf[index].getStatus());\r
+                features.setType(sf[index].getType());\r
+                features.setFeatureGroup(sf[index].getFeatureGroup());\r
                 jseq.addFeatures(features);\r
+                index ++;\r
               }\r
             }\r
 \r
@@ -458,7 +459,7 @@ public class Jalview2XML
         view.setShowText(av.getShowText());\r
         view.setWrapAlignment(av.getWrapAlignment());\r
 \r
-        if(af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed!=null)\r
+        if(av.featuresDisplayed!=null)\r
         {\r
           jalview.binding.FeatureSettings fs = new jalview.binding.FeatureSettings();\r
 \r
@@ -472,7 +473,7 @@ public class Jalview2XML
                 af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().getColour(type).getRGB()\r
                 );\r
             setting.setDisplay(\r
-                af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed.contains(type)\r
+                av.featuresDisplayed.contains(type)\r
                 );\r
 \r
             fs.addSetting(setting);\r
@@ -887,7 +888,7 @@ public class Jalview2XML
 \r
         if(jms.getFeatureSettings()!=null)\r
         {\r
-          af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed = new Vector();\r
+          af.viewport.featuresDisplayed = new Hashtable();\r
          // af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed!=null)\r
          // jalview.binding.FeatureSettings fs = new jalview.binding.FeatureSettings();\r
          for(int fs=0; fs<jms.getFeatureSettings().getSettingCount(); fs++)\r
@@ -897,7 +898,8 @@ public class Jalview2XML
            af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setColour(setting.getType(),\r
                new java.awt.Color(setting.getColour()));\r
            if(setting.getDisplay())\r
-             af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed.addElement(setting.getType());\r
+             af.viewport.featuresDisplayed.put(\r
+                 setting.getType(), new Integer(setting.getColour()));\r
          }\r
         }\r
 \r