+ Component parent = null; // or this
+ String title = null; // or some title for the progress monitor
+ int min = AsyncFetchTask.STATE_INIT;
+ int max = AsyncFetchTask.STATE_DONE;
+ int msDelay = (isAsync ? 5 : 0);
+ new AsyncFetchTask(ids, parent, title, msDelay, min, max).execute();
+ }
+
+
+ protected void resetDialog()
+ {
+ exampleBtn.setEnabled(true);
+ textArea.setEnabled(true);
+ okBtn.setEnabled(true);
+ closeBtn.setEnabled(true);
+ backBtn.setEnabled(parentSearchPanel != null);
+ }
+
+ /**
+ * This asynchronous class allows for a single-threaded state machine
+ * SwingWorker to process a list of requests from multiple sources.
+ *
+ * A standard ProcessMonitor could be attached to this task, but it is
+ * currently not.
+ *
+ * @author hansonr
+ *
+ */
+ private class AsyncFetchTask extends AsyncSwingWorker
+ {
+
+ protected boolean addToLast = false;
+
+ protected List<String> aresultq = new ArrayList<>();
+
+ protected List<String> presultTitle = new ArrayList<>();
+
+ protected List<AlignmentI> presult = new ArrayList<>();
+
+ protected List<AlignmentI> aresult = new ArrayList<>();
+
+ protected FeatureSettingsModelI preferredFeatureColours = null;
+
+ protected List<DbSourceProxy> sources;
+
+ protected Iterator<DbSourceProxy> sourceIterator;
+
+ protected String[] fetchArray;
+
+ protected List<String> fetchList;
+
+ protected Iterator<String> fetchIterator;
+
+ protected int fetchCount;
+
+ protected DbSourceProxy source;
+
+ protected String ids;
+
+ protected long myID;
+
+ protected boolean isAsync;
+
+ protected Throwable taskError;
+
+ public AsyncFetchTask(String ids, Component owner, String title,
+ int delayMillis,
+ int min, int max)