();
}
if (progressBars.get(new Long(id)) != null)
{
- JPanel progressPanel = progressBars
- .remove(new Long(id));
+ JPanel progressPanel = progressBars.remove(new Long(id));
if (progressBarHandlers.contains(new Long(id)))
{
progressBarHandlers.remove(new Long(id));
@@ -2324,7 +2341,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
if (handler.canCancel())
{
- JButton cancel = new JButton("Cancel");
+ JButton cancel = new JButton(MessageManager.getString("action.cancel"));
final IProgressIndicator us = this;
cancel.addActionListener(new ActionListener()
{
@@ -2419,7 +2436,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements
{
boolean alive = true;
Thread t0 = null, t1 = null, t2 = null;
-
+ // JAL-940 - JALVIEW 1 services are now being EOLed as of JABA 2.1 release
+ if (true)
+ {
// todo: changesupport handlers need to be transferred
if (discoverer == null)
{
@@ -2427,29 +2446,33 @@ public class Desktop extends jalview.jbgui.GDesktop implements
// register PCS handler for desktop.
discoverer.addPropertyChangeListener(changeSupport);
}
- // JAL-940 - disabled JWS1 service configuration - always start discoverer until we phase out completely
- if (true)
- {
+ // JAL-940 - disabled JWS1 service configuration - always start discoverer
+ // until we phase out completely
(t0 = new Thread(discoverer)).start();
}
- try
+ // ENFIN services are EOLed as of Jalview 2.8.1 release
+ if (false)
{
- if (Cache.getDefault("SHOW_ENFIN_SERVICES", true))
+ try
{
- // EnfinEnvision web service menu entries are rebuild every time the
- // menu is shown, so no changeSupport events are needed.
- jalview.ws.EnfinEnvision2OneWay.getInstance();
- (t1 = new Thread(jalview.ws.EnfinEnvision2OneWay.getInstance()))
- .start();
+ if (Cache.getDefault("SHOW_ENFIN_SERVICES", true))
+ {
+ // EnfinEnvision web service menu entries are rebuild every time the
+ // menu is shown, so no changeSupport events are needed.
+ jalview.ws.EnfinEnvision2OneWay.getInstance();
+ (t1 = new Thread(jalview.ws.EnfinEnvision2OneWay.getInstance()))
+ .start();
+ }
+ } catch (Exception e)
+ {
+ Cache.log
+ .info("Exception when trying to launch Envision2 workflow discovery.",
+ e);
+ Cache.log.info(e.getStackTrace());
}
- } catch (Exception e)
- {
- Cache.log
- .info("Exception when trying to launch Envision2 workflow discovery.",
- e);
- Cache.log.info(e.getStackTrace());
}
+
if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
{
if (jalview.ws.jws2.Jws2Discoverer.getDiscoverer().isRunning())
@@ -2458,9 +2481,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements
}
t2 = jalview.ws.jws2.Jws2Discoverer.getDiscoverer().startDiscoverer(
changeSupport);
-
+
}
- Thread t3=null;
+ Thread t3 = null;
{
// TODO: do rest service discovery
}
@@ -2506,43 +2529,43 @@ public class Desktop extends jalview.jbgui.GDesktop implements
{
/*
- JalviewDialog jd =new JalviewDialog() {
- @Override
- protected void cancelPressed()
- {
- // TODO Auto-generated method stub
-
- }@Override
- protected void okPressed()
- {
- // TODO Auto-generated method stub
-
- }@Override
- protected void raiseClosed()
- {
- // TODO Auto-generated method stub
-
- }
- };
- jd.initDialogFrame(new JLabel(""
- + ermsg
- + " It may be that you have invalid JABA URLs in your web service preferences,"
- + " or mis-configured HTTP proxy settings. "
- + "Check the Connections and Web services tab of the"
- + " Tools->Preferences dialog box to change them. |
"), true, true, "Web Service Configuration Problem", 450, 400);
-
- jd.waitForInput();
- */
- JOptionPane.showConfirmDialog(
- Desktop.desktop,
- new JLabel(""
- + "It may be that you have invalid JABA URLs
in your web service preferences,"
- + " or mis-configured HTTP proxy settings.
"
- + "Check the Connections and Web services tab
of the"
- + " Tools->Preferences dialog box to change them.
"), "Web Service Configuration Problem",
+ * JalviewDialog jd =new JalviewDialog() {
+ *
+ * @Override protected void cancelPressed() { // TODO
+ * Auto-generated method stub
+ *
+ * }@Override protected void okPressed() { // TODO
+ * Auto-generated method stub
+ *
+ * }@Override protected void raiseClosed() { // TODO
+ * Auto-generated method stub
+ *
+ * } }; jd.initDialogFrame(new
+ * JLabel("" + ermsg +
+ * " It may be that you have invalid JABA URLs in your web service preferences,"
+ * + " or mis-configured HTTP proxy settings. " +
+ * "Check the Connections and Web services tab of the"
+ * +
+ * " Tools->Preferences dialog box to change them. |
"
+ * ), true, true, "Web Service Configuration Problem", 450,
+ * 400);
+ *
+ * jd.waitForInput();
+ */
+ JOptionPane
+ .showConfirmDialog(
+ Desktop.desktop,
+ new JLabel(
+ ""
+ + "It may be that you have invalid JABA URLs
in your web service preferences,"
+ + " or mis-configured HTTP proxy settings.
"
+ + "Check the Connections and Web services tab
of the"
+ + " Tools->Preferences dialog box to change them.
"),
+ "Web Service Configuration Problem",
JOptionPane.DEFAULT_OPTION,
- JOptionPane.ERROR_MESSAGE);
+ JOptionPane.ERROR_MESSAGE);
serviceChangedDialog = null;
}
@@ -2572,12 +2595,16 @@ public class Desktop extends jalview.jbgui.GDesktop implements
{
showUrl(url, Desktop.instance);
}
+
/**
* Like showUrl but allows progress handler to be specified
+ *
* @param url
- * @param progress (null) or object implementing IProgressIndicator
+ * @param progress
+ * (null) or object implementing IProgressIndicator
*/
- public static void showUrl(final String url, final IProgressIndicator progress)
+ public static void showUrl(final String url,
+ final IProgressIndicator progress)
{
new Thread(new Runnable()
{
@@ -2585,8 +2612,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements
{
try
{
- if (progress!=null) {
- progress.setProgressBar("Opening "+url, this.hashCode());
+ if (progress != null)
+ {
+ progress.setProgressBar("Opening " + url, this.hashCode());
}
jalview.util.BrowserLauncher.openURL(url);
} catch (Exception ex)
@@ -2601,7 +2629,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements
ex.printStackTrace();
}
- if (progress!=null) {
+ if (progress != null)
+ {
progress.setProgressBar(null, this.hashCode());
}
}
@@ -2620,47 +2649,57 @@ public class Desktop extends jalview.jbgui.GDesktop implements
}
/**
- * static hyperlink handler proxy method for use by Jalview's internal windows
+ * static hyperlink handler proxy method for use by Jalview's internal windows
+ *
* @param e
*/
public static void hyperlinkUpdate(HyperlinkEvent e)
{
if (e.getEventType() == EventType.ACTIVATED)
{
- String url=null;
+ String url = null;
try
{
url = e.getURL().toString();
Desktop.showUrl(url);
} catch (Exception x)
{
- if (url!=null) {
- if (Cache.log!=null) {
- Cache.log.error("Couldn't handle string "+url+" as a URL.");
- } else {
- System.err.println("Couldn't handle string "+url+" as a URL.");
+ if (url != null)
+ {
+ if (Cache.log != null)
+ {
+ Cache.log.error("Couldn't handle string " + url + " as a URL.");
+ }
+ else
+ {
+ System.err.println("Couldn't handle string " + url
+ + " as a URL.");
}
}
// ignore any exceptions due to dud links.
}
- }
+ }
}
+
/**
* single thread that handles display of dialogs to user.
*/
- ExecutorService dialogExecutor=Executors.newSingleThreadExecutor();
+ ExecutorService dialogExecutor = Executors.newSingleThreadExecutor();
+
/**
* flag indicating if dialogExecutor should try to acquire a permit
*/
- private volatile boolean dialogPause=true;
+ private volatile boolean dialogPause = true;
+
/**
- * pause the queue
+ * pause the queue
*/
- private java.util.concurrent.Semaphore block=new Semaphore(0);
-
+ private java.util.concurrent.Semaphore block = new Semaphore(0);
+
/**
* add another dialog thread to the queue
+ *
* @param prompter
*/
public void addDialogThread(final Runnable prompter)
@@ -2669,10 +2708,17 @@ public class Desktop extends jalview.jbgui.GDesktop implements
{
public void run()
{
- if (dialogPause) {
- try { block.acquire(); } catch (InterruptedException x){};
+ if (dialogPause)
+ {
+ try
+ {
+ block.acquire();
+ } catch (InterruptedException x)
+ {
+ }
+ ;
}
- if (instance==null)
+ if (instance == null)
{
return;
}
@@ -2689,8 +2735,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements
public void startDialogQueue()
{
- // set the flag so we don't pause waiting for another permit and semaphore the current task to begin
- dialogPause=false;
+ // set the flag so we don't pause waiting for another permit and semaphore
+ // the current task to begin
+ dialogPause = false;
block.release();
}
}