From 3bdd4947c87108581abe34d05c878ee110b60f72 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 22 Jun 2006 08:52:25 +0000 Subject: [PATCH] Takes AlignFrame as arg, to update progressbar --- src/jalview/io/DasSequenceFeatureFetcher.java | 26 +++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/jalview/io/DasSequenceFeatureFetcher.java b/src/jalview/io/DasSequenceFeatureFetcher.java index 5bfb861..d0bc92d 100755 --- a/src/jalview/io/DasSequenceFeatureFetcher.java +++ b/src/jalview/io/DasSequenceFeatureFetcher.java @@ -51,7 +51,7 @@ import jalview.bin.Cache; public class DasSequenceFeatureFetcher implements Runnable { final AlignmentI dataset; - final AlignmentPanel ap; + final AlignFrame af; StringBuffer sbuffer = new StringBuffer(); @@ -62,10 +62,11 @@ public class DasSequenceFeatureFetcher implements Runnable * @param align DOCUMENT ME! * @param ap DOCUMENT ME! */ - public DasSequenceFeatureFetcher(AlignmentI align, AlignmentPanel ap) + public DasSequenceFeatureFetcher(AlignmentI align, + AlignFrame af) { this.dataset = align.getDataset(); - this.ap = ap; + this.af = af; Thread thread = new Thread(this); thread.start(); @@ -154,7 +155,7 @@ public class DasSequenceFeatureFetcher implements Runnable if (id != null && id.length() > 0) { FeatureThread fetcher = new FeatureThread(id - + ":" + seq.getStart() + "," +seq.getEnd() + // + ":" + seq.getStart() + "," +seq.getEnd() , source); fetcher.addFeatureListener(new FeatureListener() @@ -186,14 +187,13 @@ public class DasSequenceFeatureFetcher implements Runnable } } } - } ); //NOTE alignPanel listener will be called after the previous //anonymous listener!!! - fetcher.addFeatureListener(ap); + fetcher.addFeatureListener(af); fetcher.start(); } @@ -203,6 +203,9 @@ public class DasSequenceFeatureFetcher implements Runnable */ public void run() { + long startTime = System.currentTimeMillis(); + af.setProgressBar("Fetching DAS Sequence Features", startTime); + DasSource [] sources = new jalview.gui.DasSourceBrowser().getDASSource(); String active = jalview.bin.Cache.getDefault("DAS_ACTIVE_SOURCE", "uniprot"); @@ -226,6 +229,7 @@ public class DasSequenceFeatureFetcher implements Runnable if(selectedSources == null || selectedSources.size()==0) { System.out.println("No DAS Sources active"); + af.setProgressBar("No DAS Sources Active", startTime); return; } @@ -248,16 +252,20 @@ public class DasSequenceFeatureFetcher implements Runnable if (uprefs != null) { // we know the id for this entry, so don't note its ID in the unknownSequences list - for (int j = 0, k = uprefs.size(); j < k; j++) + for (int j = 0; j < uprefs.size(); j++) { + // 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 org.biojava.dasobert.dasregistry.DasCoordinateSystem cs[] = dasSource.getCoordinateSystem(); - for (int l=0; l