From 61cd7fa8560bb5c1f747a8cab4cc2fbd61980063 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 16 Apr 2010 14:31:55 +0000 Subject: [PATCH] export graduated feature colors --- src/jalview/appletgui/AlignFrame.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 2159de5..07c717c 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -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) -- 1.7.10.2