property change race condition (bug 0062693) and isAligned assertion (bug 0008144)
[jalview.git] / src / jalview / gui / AnnotationExporter.java
index be0ef74..718f4a5 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)\r
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)\r
+ * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
  * \r
  * This program is free software; you can redistribute it and/or\r
  * modify it under the terms of the GNU General Public License\r
@@ -108,13 +108,13 @@ public class AnnotationExporter extends JPanel
         {\r
           text = new FeaturesFile().printGFFFormat(ap.av.alignment\r
                   .getDataset().getSequencesArray(),\r
-                  ap.av.featuresDisplayed);\r
+                  getDisplayedFeatureCols(), true,ap.av.isShowNpFeats());//ap.av.featuresDisplayed//);\r
         }\r
         else\r
         {\r
           text = new FeaturesFile().printJalviewFormat(ap.av.alignment\r
                   .getDataset().getSequencesArray(),\r
-                  ap.av.featuresDisplayed);\r
+                  getDisplayedFeatureCols(), true,ap.av.isShowNpFeats()); // ap.av.featuresDisplayed);\r
         }\r
       }\r
       else\r
@@ -154,12 +154,12 @@ public class AnnotationExporter extends JPanel
       if (GFFFormat.isSelected())\r
       {\r
         text = new FeaturesFile().printGFFFormat(ap.av.alignment\r
-                .getDataset().getSequencesArray(), ap.av.featuresDisplayed);\r
+                .getDataset().getSequencesArray(), getDisplayedFeatureCols(),true,ap.av.isShowNpFeats());\r
       }\r
       else\r
       {\r
         text = new FeaturesFile().printJalviewFormat(ap.av.alignment\r
-                .getDataset().getSequencesArray(), ap.av.featuresDisplayed);\r
+                .getDataset().getSequencesArray(), getDisplayedFeatureCols(),true,ap.av.isShowNpFeats());\r
       }\r
     }\r
     else if (!features)\r
@@ -184,6 +184,19 @@ public class AnnotationExporter extends JPanel
     close_actionPerformed(null);\r
   }\r
 \r
+  private Hashtable getDisplayedFeatureCols()\r
+  {\r
+    Hashtable fcols = new Hashtable();\r
+    Enumeration en = ap.av.featuresDisplayed.keys();\r
+    FeatureRenderer fr = ap.seqPanel.seqCanvas.getFeatureRenderer(); // consider higher level method ?\r
+    while (en.hasMoreElements())\r
+    {\r
+      Object col = en.nextElement();\r
+      fcols.put(col, fr.featureColours.get(col));\r
+    }\r
+    return fcols;\r
+  }\r
+\r
   public void close_actionPerformed(ActionEvent e)\r
   {\r
     try\r