import jalview.ws.jws1.Discoverer;
import jalview.ws.jws2.Jws2Discoverer;
import jalview.ws.jws2.jabaws2.Jws2Instance;
-import jalview.ws.seqfetcher.ASequenceFetcher;
import jalview.ws.seqfetcher.DbSourceProxy;
import java.awt.BorderLayout;
if (xrefs != null)
{
/*
- * figure out colour scheme if any to apply to features
+ * get display scheme (if any) to apply to features
*/
- ASequenceFetcher sftch = new SequenceFetcher();
- List<DbSourceProxy> proxies = sftch.getSourceProxy(source);
- FeatureSettingsModelI featureColourScheme = null;
- for (DbSourceProxy proxy : proxies)
- {
- FeatureSettingsModelI preferredColours = proxy
- .getFeatureColourScheme();
- if (preferredColours != null)
- {
- featureColourScheme = preferredColours;
- break;
- }
- }
+ FeatureSettingsModelI featureColourScheme = new SequenceFetcher()
+ .getFeatureColourScheme(source);
+
AlignmentI al = makeCrossReferencesAlignment(
alignment.getDataset(), xrefs);
*/
package jalview.ws.seqfetcher;
+import jalview.api.FeatureSettingsModelI;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
return prlist.toArray(new DbSourceProxy[0]);
}
+ /**
+ * Returns a preferred feature colouring scheme for the given source, or null
+ * if none is defined.
+ *
+ * @param source
+ * @return
+ */
+ public FeatureSettingsModelI getFeatureColourScheme(String source)
+ {
+ /*
+ * return the first non-null colour scheme for any proxy for
+ * this database source
+ */
+ for (DbSourceProxy proxy : getSourceProxy(source))
+ {
+ FeatureSettingsModelI preferredColours = proxy
+ .getFeatureColourScheme();
+ if (preferredColours != null)
+ {
+ return preferredColours;
+ }
+ }
+ return null;
+ }
}