export graduated feature colors
authorjprocter <Jim Procter>
Fri, 16 Apr 2010 14:31:55 +0000 (14:31 +0000)
committerjprocter <Jim Procter>
Fri, 16 Apr 2010 14:31:55 +0000 (14:31 +0000)
src/jalview/appletgui/AlignFrame.java

index 2159de5..07c717c 100755 (executable)
@@ -931,18 +931,34 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     return annotation;
   }
 
+  private Hashtable getDisplayedFeatureCols()
+  {
+    if (alignPanel.getFeatureRenderer()!=null) {
+      FeatureRenderer fr = alignPanel.getFeatureRenderer();
+      Hashtable fcols = new Hashtable();
+      Enumeration en = viewport.featuresDisplayed.keys();
+      while (en.hasMoreElements())
+      {
+        Object col = en.nextElement();
+        fcols.put(col,fr.featureColours.get(col));
+      }
+      return fcols;
+    }
+    return null;
+  }
+
   public String outputFeatures(boolean displayTextbox, String format)
   {
     String features;
     if (format.equalsIgnoreCase("Jalview"))
     {
       features = new FeaturesFile().printJalviewFormat(viewport.alignment
-              .getSequencesArray(), viewport.featuresDisplayed);
+              .getSequencesArray(), getDisplayedFeatureCols());
     }
     else
     {
       features = new FeaturesFile().printGFFFormat(viewport.alignment
-              .getSequencesArray(), viewport.featuresDisplayed);
+              .getSequencesArray(), getDisplayedFeatureCols());
     }
 
     if (displayTextbox)