resetDialog();
return;
}
- AlignmentI aresult = null;
+ ArrayList<String> aresultq=new ArrayList<String>();
+ ArrayList<AlignmentI> aresult = new ArrayList<AlignmentI>();
Object source = database.getSelectedItem();
Enumeration en = new StringTokenizer(textArea.getText(), ";");
+ boolean isAliSource=false;
try
{
guiWindow.setProgressBar(
Thread.currentThread().hashCode());
DbSourceProxy proxy = sfetch.getSourceProxy((String) sources
.get(source));
+ isAliSource = proxy.isA(DBRefSource.ALIGNMENTDB);
if (proxy.getAccessionSeparator() == null)
{
while (en.hasMoreElements())
}
if (indres != null)
{
- if (aresult == null)
- {
- aresult = indres;
- }
- else
- {
- aresult.append(indres);
- }
+ aresultq.add(item);
+ aresult.add(indres);
}
} catch (Exception e)
{
}
try
{
- aresult = proxy.getSequenceRecords(multiacc.toString());
+ aresultq.add(multiacc.toString());
+ aresult.add(proxy.getSequenceRecords(multiacc.toString()));
} catch (OutOfMemoryError oome)
{
new OOMWarning("fetching " + multiacc + " from "
+ " from " + database.getSelectedItem());
e.printStackTrace();
}
- if (aresult != null)
+ if (aresult != null && aresult.size()>0)
{
- parseResult(aresult, null, null);
+ AlignmentI ar=null;
+ if (isAliSource) {
+ // new window for each result
+ while (aresult.size()>0)
+ {
+ parseResult(aresult.remove(0), aresultq.remove(0)+" "+getDefaultRetrievalTitle(), null);
+ }
+ } else {
+ // concatenate all results in one window
+ while (aresult.size()>0)
+ {
+ if (ar==null) { ar = aresult.remove(0);}
+ else { ar.append(aresult.remove(0)); };
+ }
+ parseResult(ar, null, null);
+ }
}
// only remove visual delay after we finished parsing.
guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
return null;
}
+ /**
+ *
+ * @return a standard title for any results retrieved using the currently selected source and settings
+ */
+ public String getDefaultRetrievalTitle() {
+ return "Retrieved from " + database.getSelectedItem();
+ }
AlignmentI parseResult(AlignmentI al, String title,
String currentFileFormat)
{
if (title == null)
{
- title = "Retrieved from " + database.getSelectedItem();
+ title = getDefaultRetrievalTitle();
}
SequenceFeature[] sfs = null;
for (Enumeration sq = al.getSequences().elements(); sq