import jalview.structure.StructureSelectionManager;
import jalview.util.MessageManager;
import jalview.ws.DBRefFetcher;
+import jalview.ws.DBRefFetcher.FetchFinishedListenerI;
import jalview.ws.seqfetcher.DbSourceProxy;
import jalview.ws.sifts.SiftsSettings;
}
};
+ final FetchFinishedListenerI afterDbRefFetch = new FetchFinishedListenerI()
+ {
+
+ @Override
+ public void finished()
+ {
+ // filter has been selected, so we set flag to remove ourselves
+ notQueriedTDBYet = false;
+ // new thread to discover structures - via 3d beacons
+ Executors.defaultThreadFactory().newThread(strucDiscovery).start();
+
+ }
+ };
+
// fetch db refs if OK pressed
- final Runnable discoverCanonicalDBrefs = new Runnable()
+ final Runnable discoverCanonicalDBrefs = new Runnable()
{
@Override
public void run()
final int y = seqsWithoutSourceDBRef.size();
if (y > 0)
{
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run()
- {
- updateProgressIndicator(MessageManager.formatMessage(
- "status.fetching_dbrefs_for_sequences_without_valid_refs",
- y), progressId);
-
- }
- });
-
final SequenceI[] seqWithoutSrcDBRef = seqsWithoutSourceDBRef
.toArray(new SequenceI[y]);
DBRefFetcher dbRefFetcher = new DBRefFetcher(seqWithoutSrcDBRef,
progressBar, new DbSourceProxy[]
{ new jalview.ws.dbsources.Uniprot() }, null, false);
-
+ dbRefFetcher.addListener(afterDbRefFetch);
// ideally this would also gracefully run with callbacks
dbRefFetcher.fetchDBRefs(true);
+ } else {
+ // call finished action directly
+ afterDbRefFetch.finished();
}
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run()
- {
- if (y>0) {
- updateProgressIndicator("Fetch complete.", progressId); // todo i18n
- }
- // filter has been selected, so we set flag to remove ourselves
- notQueriedTDBYet = false;
-
- Executors.defaultThreadFactory().newThread(strucDiscovery).start();
-
- }
- });
-
}
+
};
final Runnable revertview = new Runnable() {
public void run() {