package jalview.gui;
+import java.util.Locale;
+
import java.awt.event.ItemEvent;
import java.util.ArrayList;
import java.util.Collection;
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() {
if (pdbIdStr.split(":").length > 1)
{
pdbEntry.setId(pdbIdStr.split(":")[0]);
- pdbEntry.setChainCode(pdbIdStr.split(":")[1].toUpperCase());
+ pdbEntry.setChainCode(pdbIdStr.split(":")[1].toUpperCase(Locale.ROOT));
}
else
{
// TODO move this pdb id search into the PDB specific
// FTSSearchEngine
// for moment, it will work fine as is because it is self-contained
- String searchTerm = text.toLowerCase();
+ String searchTerm = text.toLowerCase(Locale.ROOT);
searchTerm = searchTerm.split(":")[0];
// System.out.println(">>>>> search term : " + searchTerm);
List<FTSDataColumnI> wantedFields = new ArrayList<>();