FeatureSettings bug fixed
authoramwaterhouse <Andrew Waterhouse>
Fri, 24 Mar 2006 15:35:10 +0000 (15:35 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 24 Mar 2006 15:35:10 +0000 (15:35 +0000)
src/jalview/gui/Jalview2XML.java

index 7e2d1dd..893846c 100755 (executable)
@@ -472,8 +472,9 @@ public class Jalview2XML
             setting.setColour(\r
                 af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().getColour(type).getRGB()\r
                 );\r
+\r
             setting.setDisplay(\r
-                av.featuresDisplayed.contains(type)\r
+                av.featuresDisplayed.containsKey(type)\r
                 );\r
 \r
             fs.addSetting(setting);\r
@@ -679,12 +680,12 @@ public class Jalview2XML
             Features[] features = JSEQ[i].getFeatures();\r
             for (int f = 0; f < features.length; f++)\r
             {\r
-              //features[f].getBegin()\r
               jalview.datamodel.SequenceFeature sf\r
                   = new jalview.datamodel.SequenceFeature(features[f].getType(),\r
                   features[f].getDescription(), features[f].getStatus(),\r
-                  features[f].getBegin(), features[f].getEnd());\r
-              sf.setFeatureGroup(features[f].getFeatureGroup());\r
+                  features[f].getBegin(), features[f].getEnd(),\r
+                  features[f].getFeatureGroup());\r
+\r
               al.getSequenceAt(i).getDatasetSequence().addSequenceFeature(sf);\r
             }\r
           }\r
@@ -701,7 +702,8 @@ public class Jalview2XML
 \r
           }\r
         }\r
-        /////////////////////////////////\r
+\r
+         /////////////////////////////////\r
         //////////////////////////////////\r
         //LOAD ANNOTATIONS\r
         if (vamsasSet.getAnnotation() != null)\r
@@ -739,6 +741,7 @@ public class Jalview2XML
             }\r
         }\r
 \r
+\r
         /////////////////////////////////\r
         // LOAD VIEWPORT\r
         Viewport[] views = jms.getViewport();\r
@@ -805,6 +808,7 @@ public class Jalview2XML
         }\r
 \r
 \r
+\r
         af.setBounds(view.getXpos(), view.getYpos(), view.getWidth(),\r
             view.getHeight());\r
         af.viewport.setStartRes(view.getStartRes());\r
@@ -889,20 +893,24 @@ public class Jalview2XML
         if(jms.getFeatureSettings()!=null)\r
         {\r
           af.viewport.featuresDisplayed = new Hashtable();\r
-         // af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed!=null)\r
-         // jalview.binding.FeatureSettings fs = new jalview.binding.FeatureSettings();\r
+          String [] renderOrder = new String[jms.getFeatureSettings().getSettingCount()];\r
          for(int fs=0; fs<jms.getFeatureSettings().getSettingCount(); fs++)\r
          {\r
            Setting setting = jms.getFeatureSettings().getSetting(fs);\r
 \r
            af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setColour(setting.getType(),\r
                new java.awt.Color(setting.getColour()));\r
+\r
+           renderOrder[fs] = setting.getType();\r
+\r
            if(setting.getDisplay())\r
              af.viewport.featuresDisplayed.put(\r
                  setting.getType(), new Integer(setting.getColour()));\r
          }\r
+         af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().renderOrder = renderOrder;\r
         }\r
 \r
+\r
         Desktop.addInternalFrame(af, view.getTitle(),\r
              view.getWidth(), view.getHeight());\r
 \r