X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fseqfetcher%2FDbSourceProxyImpl.java;h=5bed7209772625e4ab6f29a60ba12ed5012a3eb5;hb=0673686a4ceda776a64350afd35ecff18e74e575;hp=0a4d9a82ee485d434595786eed96fee1ecca3cbb;hpb=16848e28863ed4b50713939adb525e1d85ff7575;p=jalview.git diff --git a/src/jalview/ws/seqfetcher/DbSourceProxyImpl.java b/src/jalview/ws/seqfetcher/DbSourceProxyImpl.java index 0a4d9a8..5bed720 100644 --- a/src/jalview/ws/seqfetcher/DbSourceProxyImpl.java +++ b/src/jalview/ws/seqfetcher/DbSourceProxyImpl.java @@ -20,12 +20,11 @@ */ package jalview.ws.seqfetcher; +import jalview.api.FeatureSettingsModelI; import jalview.datamodel.AlignmentI; import jalview.io.FormatAdapter; import jalview.io.IdentifyFile; -import com.stevesoft.pat.Regex; - /** * common methods for implementations of the DbSourceProxy interface. * @@ -102,23 +101,20 @@ public abstract class DbSourceProxyImpl implements DbSourceProxy return sequences; } + /** + * Returns the first accession id in the query (up to the first accession id + * separator), or the whole query if there is no separator or it is not found + */ @Override public String getAccessionIdFromQuery(String query) { - Regex vgr = getAccessionValidator(); - if (vgr == null) + String sep = getAccessionSeparator(); + if (sep == null) { return query; } - vgr.search(query); - if (vgr.numSubs() > 0) - { - return (vgr.stringMatched(1)); - } - else - { - return (vgr.stringMatched()); - } + int sepPos = query.indexOf(sep); + return sepPos == -1 ? query : query.substring(0, sepPos); } /** @@ -151,6 +147,12 @@ public abstract class DbSourceProxyImpl implements DbSourceProxy @Override public String getDescription() { + return ""; + } + + @Override + public FeatureSettingsModelI getFeatureColourScheme() + { return null; } }