import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.DBRefSource;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.io.FormatAdapter;
import javax.swing.SwingConstants;
import javax.swing.tree.DefaultMutableTreeNode;
-import com.stevesoft.pat.Regex;
-
public class SequenceFetcher extends JPanel implements Runnable
{
JLabel dbeg = new JLabel();
resetDialog();
return;
}
+ // TODO: Refactor to GUI independent code and write tests.
// indicate if successive sources should be merged into one alignment.
boolean addToLast = false;
ArrayList<String> aresultq = new ArrayList<String>(), presultTitle = new ArrayList<String>();
Integer.valueOf(nqueries).toString(),
proxy.getDbName() }), Thread.currentThread()
.hashCode());
- isAliSource = proxy.isA(DBRefSource.ALIGNMENTDB);
+ isAliSource = proxy.isAlignmentSource();
if (proxy.getAccessionSeparator() == null)
{
while (en.hasNext())
DBRefEntry dbr = new DBRefEntry(), found[] = null;
dbr.setSource(proxy.getDbSource());
dbr.setVersion(null);
- if (proxy.getAccessionValidator() != null)
- {
- Regex vgr = proxy.getAccessionValidator();
- vgr.search(q);
- if (vgr.numSubs() > 0)
- {
- dbr.setAccessionId(vgr.stringMatched(1));
- }
- else
- {
- dbr.setAccessionId(vgr.stringMatched());
- }
- }
- else
- {
- dbr.setAccessionId(q);
- }
+ String accId = proxy.getAccessionIdFromQuery(q);
+ dbr.setAccessionId(accId);
boolean rfound = false;
for (int r = 0; r < rs.length; r++)
{
AlignmentI parseResult(String result, String title)
{
- String format = new IdentifyFile().Identify(result, "Paste");
+ String format = new IdentifyFile().identify(result, "Paste");
AlignmentI sequences = null;
if (FormatAdapter.isValidFormat(format))
{