{\r
SequenceI[] sequences;\r
AlignFrame af;\r
+ FeatureSettings fsettings;\r
StringBuffer sbuffer = new StringBuffer();\r
Vector selectedSources;\r
+ boolean cancelled = false;\r
\r
long startTime;\r
\r
* @param ap DOCUMENT ME!\r
*/\r
public DasSequenceFeatureFetcher(SequenceI[] sequences,\r
- final AlignFrame af,\r
+ FeatureSettings fsettings,\r
Vector selectedSources)\r
{\r
this.selectedSources = selectedSources;\r
this.sequences = sequences;\r
- this.af = af;\r
+ this.af = fsettings.af;\r
+ this.fsettings = fsettings;\r
\r
int uniprotCount = 0;\r
for (int i = 0; i < selectedSources.size(); i++)\r
*/\r
void startFetching()\r
{\r
+ cancelled = false;\r
startTime = System.currentTimeMillis();\r
af.setProgressBar("Fetching DAS Sequence Features", startTime);\r
\r
\r
sourcesRemaining = selectedSources.size();\r
//Now sending requests one at a time to each server\r
- for (int sourceIndex = 0; sourceIndex < selectedSources.size();\r
+ for (int sourceIndex = 0;\r
+ sourceIndex < selectedSources.size()\r
+ && !cancelled;\r
sourceIndex++)\r
{\r
DasSource dasSource = (DasSource) selectedSources.elementAt(\r
}\r
}\r
\r
+ public void cancel()\r
+ {\r
+ af.setProgressBar("DAS Feature Fetching Cancelled", startTime);\r
+ cancelled = true;\r
+ }\r
+\r
int sourcesRemaining=0;\r
void responseComplete(DasSource dasSource, SequenceI seq)\r
{\r
if (seq != null)\r
{\r
- for (int seqIndex = 0; seqIndex < sequences.length-1; seqIndex++)\r
+ for (int seqIndex = 0;\r
+ seqIndex < sequences.length-1\r
+ && !cancelled; seqIndex++)\r
{\r
if (sequences[seqIndex] == seq)\r
{\r
\r
if(af.featureSettings!=null)\r
af.featureSettings.setTableData();\r
+\r
+ fsettings.complete();\r
}\r
\r
}\r
// we know the id for this entry, so don't note its ID in the unknownSequences list\r
// for (int j = 0; j < uprefs.length; j++)\r
{\r
-\r
- // Will have to pass any mapping information to the fetcher - the start/end for the DBRefEntry may not be the same as the sequence's start/end\r
+ // Will have to pass any mapping information to the fetcher\r
+ //- the start/end for the DBRefEntry may not be the same as the sequence's start/end\r
DasCoordinateSystem cs[] = dasSource.getCoordinateSystem();\r
- // if(cs.length>0)\r
- // System.out.println("err "+\r
- for (int l = 0; l < cs.length; l++)\r
+ if(cs.length>0)\r
{\r
- if (jalview.util.DBRefUtils.isDasCoordinateSystem(cs[l].\r
- getName(), uprefs[0]))\r
+ // for (int l = 0; l < cs.length; l++)\r
{\r
-\r
- Cache.log.debug("Launched fetcher for coordinate system " +\r
- cs[l].getName());\r
-\r
- createFeatureFetcher(seq,\r
- dasSource,\r
- uprefs[0].getAccessionId());\r
+ //\r
+ if (jalview.util.DBRefUtils\r
+ .isDasCoordinateSystem(cs[0].getName(), uprefs[0]))\r
+ {\r
+ Cache.log.debug("Launched fetcher for coordinate system " +\r
+ cs[0].getName());\r
+\r
+ createFeatureFetcher(seq,\r
+ dasSource,\r
+ uprefs[0].getAccessionId());\r
+ }\r
}\r
}\r
}\r
DasSourceReaderImpl reader = new DasSourceReaderImpl();\r
\r
String registryURL = jalview.bin.Cache.getDefault("DAS_REGISTRY_URL",\r
- "http://das.sanger.ac.uk/registry/das1/sources/"\r
+ DasSourceBrowser.DEFAULT_REGISTRY\r
);\r
\r
try\r