From fa089b1e2ac2acf8940d89d8b717eafc88aaeaa2 Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 30 Apr 2007 15:36:20 +0000 Subject: [PATCH] 'no sources selected' calls method on feature settings dialog to prompt user. fixed never-ending das feature retrieval bug. --- src/jalview/io/DasSequenceFeatureFetcher.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/jalview/io/DasSequenceFeatureFetcher.java b/src/jalview/io/DasSequenceFeatureFetcher.java index c8b5d3e..58ae580 100755 --- a/src/jalview/io/DasSequenceFeatureFetcher.java +++ b/src/jalview/io/DasSequenceFeatureFetcher.java @@ -172,6 +172,8 @@ public class DasSequenceFeatureFetcher { System.out.println("No DAS Sources active"); af.setProgressBar("No DAS Sources Active", startTime); + cancelled = true; + fsettings.noDasSourceActive(); return; } @@ -249,7 +251,9 @@ public class DasSequenceFeatureFetcher void nextSequence(DasSource dasSource, SequenceI seq) { - DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs(seq.getDBRef(), + if (cancelled) + return; + DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs(seq.getDBRef(), new String[] { // jalview.datamodel.DBRefSource.PDB, @@ -263,11 +267,11 @@ public class DasSequenceFeatureFetcher if (uprefs != null) { // do any of these ids match the source's coordinate system ? - for (int j = 0; j < uprefs.length; j++) + for (int j = 0; !dasCoordSysFound && j < uprefs.length; j++) { DasCoordinateSystem cs[] = dasSource.getCoordinateSystem(); - for(int csIndex=0; csIndex 0 && jalview.util.DBRefUtils .isDasCoordinateSystem(cs[csIndex].getName(), uprefs[j])) @@ -280,11 +284,10 @@ public class DasSequenceFeatureFetcher System.out.println(seq.getName() + " " + (seq.getDatasetSequence() == null) + " " + dasSource.getUrl()); - dasCoordSysFound = false; + dasCoordSysFound = true; // break's out of the loop createFeatureFetcher(seq, dasSource, uprefs[j]); - break; // only do this for one reference - assume same source will send same features for all IDs } else System.out.println("IGNORE " + cs[csIndex].getName()); @@ -474,6 +477,10 @@ public class DasSequenceFeatureFetcher */ SequenceFeature newSequenceFeature(Map dasfeature, String nickname) { + if (dasfeature==null) + { + return null; + } try { /** -- 1.7.10.2