git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3066 Fix NullPointerException thrown when showing HMMER run dialog
[jalview.git]
/
src
/
jalview
/
gui
/
Desktop.java
diff --git
a/src/jalview/gui/Desktop.java
b/src/jalview/gui/Desktop.java
index
bbd38ec
..
88c94f6
100644
(file)
--- a/
src/jalview/gui/Desktop.java
+++ b/
src/jalview/gui/Desktop.java
@@
-59,8
+59,11
@@
import java.util.Hashtable;
import java.util.List;
import java.util.ListIterator;
import java.util.Vector;
import java.util.List;
import java.util.ListIterator;
import java.util.Vector;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
import java.util.concurrent.Semaphore;
import javax.swing.AbstractAction;
import java.util.concurrent.Semaphore;
import javax.swing.AbstractAction;
@@
-123,6
+126,7
@@
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.util.UrlConstants;
import jalview.viewmodel.AlignmentViewport;
import jalview.util.Platform;
import jalview.util.UrlConstants;
import jalview.viewmodel.AlignmentViewport;
+import jalview.ws.WSDiscovererI;
import jalview.ws.params.ParamManager;
import jalview.ws.utils.UrlDownloadClient;
import jalview.ws.params.ParamManager;
import jalview.ws.utils.UrlDownloadClient;
@@
-162,6
+166,7
@@
public class Desktop extends GDesktop
public static HashMap<String, FileWriter> savingFiles = new HashMap<String, FileWriter>();
public static HashMap<String, FileWriter> savingFiles = new HashMap<String, FileWriter>();
+ @SuppressWarnings("deprecation")
private JalviewChangeSupport changeSupport = new JalviewChangeSupport();
/**
private JalviewChangeSupport changeSupport = new JalviewChangeSupport();
/**
@@
-175,6
+180,7
@@
public class Desktop extends GDesktop
* @param listener
* @see jalview.gui.JalviewChangeSupport#addJalviewPropertyChangeListener(java.beans.PropertyChangeListener)
*/
* @param listener
* @see jalview.gui.JalviewChangeSupport#addJalviewPropertyChangeListener(java.beans.PropertyChangeListener)
*/
+ @Deprecated
public void addJalviewPropertyChangeListener(
PropertyChangeListener listener)
{
public void addJalviewPropertyChangeListener(
PropertyChangeListener listener)
{
@@
-187,6
+193,7
@@
public class Desktop extends GDesktop
* @see jalview.gui.JalviewChangeSupport#addJalviewPropertyChangeListener(java.lang.String,
* java.beans.PropertyChangeListener)
*/
* @see jalview.gui.JalviewChangeSupport#addJalviewPropertyChangeListener(java.lang.String,
* java.beans.PropertyChangeListener)
*/
+ @Deprecated
public void addJalviewPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
{
public void addJalviewPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
{
@@
-199,6
+206,7
@@
public class Desktop extends GDesktop
* @see jalview.gui.JalviewChangeSupport#removeJalviewPropertyChangeListener(java.lang.String,
* java.beans.PropertyChangeListener)
*/
* @see jalview.gui.JalviewChangeSupport#removeJalviewPropertyChangeListener(java.lang.String,
* java.beans.PropertyChangeListener)
*/
+ @Deprecated
public void removeJalviewPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
{
public void removeJalviewPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
{
@@
-1607,7
+1615,8
@@
public class Desktop extends GDesktop
return;
}
return;
}
- AlignmentViewport source = null, target = null;
+ AlignViewportI source = null;
+ AlignViewportI target = null;
if (frames[0] instanceof AlignFrame)
{
source = ((AlignFrame) frames[0]).getCurrentView();
if (frames[0] instanceof AlignFrame)
{
source = ((AlignFrame) frames[0]).getCurrentView();
@@
-2573,6
+2582,13
@@
public class Desktop extends GDesktop
progressBars.put(Long.valueOf(id), addProgressPanel(message));
}
}
progressBars.put(Long.valueOf(id), addProgressPanel(message));
}
}
+
+ @Override
+ public void removeProgressBar(long id)
+ {
+ //TODO
+ throw new UnsupportedOperationException("not implemented");
+ }
/*
* (non-Javadoc)
/*
* (non-Javadoc)
@@
-2692,10
+2708,13
@@
public class Desktop extends GDesktop
public void startServiceDiscovery(boolean blocking)
{
public void startServiceDiscovery(boolean blocking)
{
- boolean alive = true;
- Thread t0 = null, t1 = null, t2 = null;
+ System.out.println("Starting service discovery");
+ var tasks = new ArrayList<Future<?>>();
// JAL-940 - JALVIEW 1 services are now being EOLed as of JABA 2.1 release
// JAL-940 - JALVIEW 1 services are now being EOLed as of JABA 2.1 release
- if (true)
+
+ System.out.println("loading services");
+
+ /** @j2sIgnore */
{
// todo: changesupport handlers need to be transferred
if (discoverer == null)
{
// todo: changesupport handlers need to be transferred
if (discoverer == null)
@@
-2706,31
+2725,30
@@
public class Desktop extends GDesktop
}
// JAL-940 - disabled JWS1 service configuration - always start discoverer
// until we phase out completely
}
// JAL-940 - disabled JWS1 service configuration - always start discoverer
// until we phase out completely
- (t0 = new Thread(discoverer)).start();
+ var f = new FutureTask<Void>(discoverer, null);
+ new Thread(f).start();
+ tasks.add(f);
}
if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
{
}
if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
{
- t2 = jalview.ws.jws2.Jws2Discoverer.getInstance()
- .startDiscoverer(changeSupport);
+ tasks.add(jalview.ws.jws2.Jws2Discoverer.getInstance().startDiscoverer());
}
}
- Thread t3 = null;
+ if (Cache.getDefault("SHOW_SLIVKA_SERVICES", true))
{
{
- // TODO: do rest service discovery
+ tasks.add(jalview.ws.slivkaws.SlivkaWSDiscoverer.getInstance().startDiscoverer());
}
if (blocking)
{
}
if (blocking)
{
- while (alive)
- {
+ for (Future<?> task : tasks) {
try
{
try
{
- Thread.sleep(15);
+ // block until all discovery tasks are done
+ task.get();
} catch (Exception e)
{
} catch (Exception e)
{
+ e.printStackTrace();
}
}
- alive = (t1 != null && t1.isAlive()) || (t2 != null && t2.isAlive())
- || (t3 != null && t3.isAlive())
- || (t0 != null && t0.isAlive());
}
}
}
}
}
}
@@
-2744,8
+2762,10
@@
public class Desktop extends GDesktop
{
if (evt.getNewValue() == null || evt.getNewValue() instanceof Vector)
{
{
if (evt.getNewValue() == null || evt.getNewValue() instanceof Vector)
{
- final String ermsg = jalview.ws.jws2.Jws2Discoverer.getInstance()
- .getErrorMessages();
+ final WSDiscovererI discoverer = jalview.ws.jws2.Jws2Discoverer
+ .getInstance();
+ final String ermsg = discoverer.getErrorMessages();
+ // CONFLICT:ALT:? final String ermsg = jalview.ws.jws2.Jws2Discoverer.getInstance()
if (ermsg != null)
{
if (Cache.getDefault("SHOW_WSDISCOVERY_ERRORS", true))
if (ermsg != null)
{
if (Cache.getDefault("SHOW_WSDISCOVERY_ERRORS", true))