*/
package jalview.ws;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+import java.util.Vector;
+
import jalview.analysis.AlignSeq;
import jalview.api.FeatureSettingsModelI;
import jalview.bin.Cache;
import jalview.util.DBRefUtils;
import jalview.util.MessageManager;
import jalview.ws.seqfetcher.DbSourceProxy;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
import uk.ac.ebi.picr.model.UPEntry;
import uk.ac.ebi.www.picr.AccessionMappingService.AccessionMapperServiceLocator;
CutAndPasteTransfer output = new CutAndPasteTransfer();
- boolean running = false;
-
/**
* picr client instance
*/
*/
public void fetchDBRefs(boolean waitTillFinished)
{
- // TODO can we not simply write
- // if (waitTillFinished) { run(); } else { new Thread(this).start(); }
-
- Thread thread = new Thread(this);
- thread.start();
- running = true;
-
if (waitTillFinished)
{
- while (running)
- {
- try
- {
- Thread.sleep(500);
- } catch (Exception ex)
- {
- }
- }
+ run();
+ }
+ else
+ {
+ new Thread(this).start();
}
}
throw new Error(MessageManager
.getString("error.implementation_error_must_init_dbsources"));
}
- running = true;
long startTime = System.currentTimeMillis();
if (progressWindow != null)
{
{
listener.finished();
}
- running = false;
}
/**