")
.append("Built: ")
.append(Cache.getDefault("BUILD_DATE", "unknown"))
@@ -1379,7 +1459,7 @@ public class Desktop extends jalview.jbgui.GDesktop
else if (!latestVersion.equals(Cache.getProperty("VERSION")))
{
boolean red = false;
- if (Cache.getProperty("VERSION").toLowerCase()
+ if (Cache.getProperty("VERSION").toLowerCase(Locale.ROOT)
.indexOf("automated build") == -1)
{
red = true;
@@ -1392,7 +1472,7 @@ public class Desktop extends jalview.jbgui.GDesktop
.append(Cache.getDefault("LATEST_VERSION", "..Checking.."))
.append(" is available for download from ")
.append(Cache.getDefault("www.jalview.org",
- "http://www.jalview.org"))
+ "https://www.jalview.org"))
.append(" !!");
if (red)
{
@@ -1403,6 +1483,8 @@ public class Desktop extends jalview.jbgui.GDesktop
message.append(Cache.getDefault("AUTHORFNAMES", DEFAULT_AUTHORS));
message.append(CITATION);
+ message.append("
");
+
return message.toString();
}
@@ -1416,7 +1498,7 @@ public class Desktop extends jalview.jbgui.GDesktop
{
if (Platform.isJS())
{
- BrowserLauncher.openURL("http://www.jalview.org/help.html");
+ BrowserLauncher.openURL("https://www.jalview.org/help.html");
}
else
/**
@@ -1489,17 +1571,16 @@ public class Desktop extends jalview.jbgui.GDesktop
protected void garbageCollect_actionPerformed(ActionEvent e)
{
// We simply collect the garbage
- Cache.log.debug("Collecting garbage...");
+ jalview.bin.Console.debug("Collecting garbage...");
System.gc();
- Cache.log.debug("Finished garbage collection.");
+ jalview.bin.Console.debug("Finished garbage collection.");
}
/*
* (non-Javadoc)
*
- * @see
- * jalview.jbgui.GDesktop#showMemusage_actionPerformed(java.awt.event.ActionEvent
- * )
+ * @see jalview.jbgui.GDesktop#showMemusage_actionPerformed(java.awt.event.
+ * ActionEvent )
*/
@Override
protected void showMemusage_actionPerformed(ActionEvent e)
@@ -1704,7 +1785,7 @@ public class Desktop extends jalview.jbgui.GDesktop
+ chosenFile.getName(), oom);
} catch (Exception ex)
{
- Cache.log.error("Problems whilst trying to save to "
+ jalview.bin.Console.error("Problems whilst trying to save to "
+ chosenFile.getName(), ex);
JvOptionPane.showMessageDialog(me,
MessageManager.formatMessage(
@@ -1776,7 +1857,7 @@ public class Desktop extends jalview.jbgui.GDesktop
new OOMWarning("Whilst loading project from " + choice, oom);
} catch (Exception ex)
{
- Cache.log.error(
+ jalview.bin.Console.error(
"Problems whilst loading project from " + choice, ex);
JvOptionPane.showMessageDialog(Desktop.desktop,
MessageManager.formatMessage(
@@ -1999,9 +2080,8 @@ public class Desktop extends jalview.jbgui.GDesktop
}
/*
- * Restore the view's last exploded frame geometry if known. Multiple
- * views from one exploded frame share and restore the same (frame)
- * position and size.
+ * Restore the view's last exploded frame geometry if known. Multiple views from
+ * one exploded frame share and restore the same (frame) position and size.
*/
Rectangle geometry = ap.av.getExplodedGeometry();
if (geometry != null)
@@ -2090,6 +2170,7 @@ public class Desktop extends jalview.jbgui.GDesktop
{
source.showFeatureSettingsUI();
}
+
}
public JInternalFrame[] getAllFrames()
@@ -2382,7 +2463,7 @@ public class Desktop extends jalview.jbgui.GDesktop
openGroovyConsole();
} catch (Exception ex)
{
- Cache.log.error("Groovy Shell Creation failed.", ex);
+ jalview.bin.Console.error("Groovy Shell Creation failed.", ex);
JvOptionPane.showInternalMessageDialog(Desktop.desktop,
MessageManager.getString("label.couldnt_create_groovy_shell"),
@@ -2404,9 +2485,9 @@ public class Desktop extends jalview.jbgui.GDesktop
/*
* We allow only one console at a time, so that AlignFrame menu option
- * 'Calculate | Run Groovy script' is unambiguous.
- * Disable 'Groovy Console', and enable 'Run script', when the console is
- * opened, and the reverse when it is closed
+ * 'Calculate | Run Groovy script' is unambiguous. Disable 'Groovy Console', and
+ * enable 'Run script', when the console is opened, and the reverse when it is
+ * closed
*/
Window window = (Window) groovyConsole.getFrame();
window.addWindowListener(new WindowAdapter()
@@ -2429,8 +2510,8 @@ public class Desktop extends jalview.jbgui.GDesktop
((Window) groovyConsole.getFrame()).setVisible(true);
/*
- * if we got this far, enable 'Run Groovy' in AlignFrame menus
- * and disable opening a second console
+ * if we got this far, enable 'Run Groovy' in AlignFrame menus and disable
+ * opening a second console
*/
enableExecuteGroovy(true);
}
@@ -2467,8 +2548,8 @@ public class Desktop extends jalview.jbgui.GDesktop
public void enableExecuteGroovy(boolean enabled)
{
/*
- * disable opening a second Groovy console
- * (or re-enable when the console is closed)
+ * disable opening a second Groovy console (or re-enable when the console is
+ * closed)
*/
groovyShell.setEnabled(!enabled);
@@ -2497,8 +2578,6 @@ public class Desktop extends jalview.jbgui.GDesktop
@Override
public void setProgressBar(String message, long id)
{
- // Platform.timeCheck("Desktop " + message, Platform.TIME_MARK);
-
if (progressBars == null)
{
progressBars = new Hashtable<>();
@@ -2631,13 +2710,36 @@ public class Desktop extends jalview.jbgui.GDesktop
this.inBatchMode = inBatchMode;
}
+ /**
+ * start service discovery and wait till it is done
+ */
public void startServiceDiscovery()
{
startServiceDiscovery(false);
}
+ /**
+ * start service discovery threads - blocking or non-blocking
+ *
+ * @param blocking
+ */
public void startServiceDiscovery(boolean blocking)
{
+ startServiceDiscovery(blocking, false);
+ }
+
+ /**
+ * start service discovery threads
+ *
+ * @param blocking
+ * - false means call returns immediately
+ * @param ignore_SHOW_JWS2_SERVICES_preference
+ * - when true JABA services are discovered regardless of user's JWS2
+ * discovery preference setting
+ */
+ public void startServiceDiscovery(boolean blocking,
+ boolean ignore_SHOW_JWS2_SERVICES_preference)
+ {
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
@@ -2655,7 +2757,8 @@ public class Desktop extends jalview.jbgui.GDesktop
(t0 = new Thread(discoverer)).start();
}
- if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
+ if (ignore_SHOW_JWS2_SERVICES_preference
+ || Cache.getDefault("SHOW_JWS2_SERVICES", true))
{
t2 = jalview.ws.jws2.Jws2Discoverer.getDiscoverer()
.startDiscoverer(changeSupport);
@@ -2708,24 +2811,19 @@ public class Desktop extends jalview.jbgui.GDesktop
/*
* JalviewDialog jd =new JalviewDialog() {
*
- * @Override protected void cancelPressed() { // TODO
- * Auto-generated method stub
+ * @Override protected void cancelPressed() { // TODO Auto-generated method stub
*
- * }@Override protected void okPressed() { // TODO
- * Auto-generated method stub
+ * }@Override protected void okPressed() { // TODO Auto-generated method stub
*
- * }@Override protected void raiseClosed() { // 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);
+ * "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();
*/
@@ -2747,7 +2845,7 @@ public class Desktop extends jalview.jbgui.GDesktop
}
else
{
- Cache.log.error(
+ jalview.bin.Console.error(
"Errors reported by JABA discovery service. Check web services preferences.\n"
+ ermsg);
}
@@ -2840,15 +2938,8 @@ public class Desktop extends jalview.jbgui.GDesktop
{
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.");
- }
+ jalview.bin.Console
+ .error("Couldn't handle string " + url + " as a URL.");
}
// ignore any exceptions due to dud links.
}
@@ -2903,7 +2994,8 @@ public class Desktop extends jalview.jbgui.GDesktop
SwingUtilities.invokeAndWait(prompter);
} catch (Exception q)
{
- Cache.log.warn("Unexpected Exception in dialog thread.", q);
+ jalview.bin.Console.warn("Unexpected Exception in dialog thread.",
+ q);
}
}
});
@@ -2942,7 +3034,7 @@ public class Desktop extends jalview.jbgui.GDesktop
public void exportImage(Graphics g) throws Exception
{
paintAll(g);
- Cache.log.info("Successfully written snapshot to file "
+ jalview.bin.Console.info("Successfully written snapshot to file "
+ of.getAbsolutePath());
}
};
@@ -2976,16 +3068,15 @@ public class Desktop extends jalview.jbgui.GDesktop
}
/*
- * Processing in reverse order works, forwards order leaves the first panels
- * not visible. I don't know why!
+ * Processing in reverse order works, forwards order leaves the first panels not
+ * visible. I don't know why!
*/
for (int i = viewCount - 1; i >= 0; i--)
{
/*
- * Make new top and bottom frames. These take over the respective
- * AlignmentPanel objects, including their AlignmentViewports, so the
- * cdna/protein relationships between the viewports is carried over to the
- * new split frames.
+ * Make new top and bottom frames. These take over the respective AlignmentPanel
+ * objects, including their AlignmentViewports, so the cdna/protein
+ * relationships between the viewports is carried over to the new split frames.
*
* explodedGeometry holds the (x, y) position of the previously exploded
* SplitFrame, and the (width, height) of the AlignFrame component
@@ -3024,8 +3115,8 @@ public class Desktop extends jalview.jbgui.GDesktop
}
/*
- * Clear references to the panels (now relocated in the new SplitFrames)
- * before closing the old SplitFrame.
+ * Clear references to the panels (now relocated in the new SplitFrames) before
+ * closing the old SplitFrame.
*/
topPanels.clear();
bottomPanels.clear();
@@ -3126,28 +3217,6 @@ public class Desktop extends jalview.jbgui.GDesktop
Transferable t) throws Exception
{
- // BH 2018 changed List to List