From: jprocter Date: Tue, 29 Apr 2008 10:53:40 +0000 (+0000) Subject: comments and version wget ping timeout fix for when www connection is unavailable... X-Git-Tag: Release_2_4~101 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=bcfc087d75da78963a3bba83ee2a206035297ee7;p=jalview.git comments and version wget ping timeout fix for when www connection is unavailable due to proxy taking too long to respond --- diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 8d003ef..aed61f2 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -238,9 +238,11 @@ public class Cache { public void run() { + String orgtimeout = System.getProperty("sun.net.client.defaultConnectTimeout"); String jnlpVersion = null; try { + System.setProperty("sun.net.client.defaultConnectTimeout", "5000"); java.net.URL url = new java.net.URL( "http://www.jalview.org/webstart/jalview.jnlp"); BufferedReader in = new BufferedReader(new InputStreamReader(url. @@ -264,6 +266,7 @@ public class Cache System.out.println(ex); jnlpVersion = getProperty("VERSION"); } + System.setProperty("sun.net.client.defaultConnectTimeout", orgtimeout); setProperty("LATEST_VERSION", jnlpVersion); } diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index ff01ed6..ed968f8 100755 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -64,6 +64,11 @@ public class Desktop */ public Desktop() { + /** + * A note to implementors. It is ESSENTIAL that any + * activities that might block are spawned off as threads rather + * than waited for during this constructor. + */ instance = this; doVamsasClientCheck(); doGroovyCheck(); @@ -121,10 +126,9 @@ public class Desktop this.setDropTarget(new java.awt.dnd.DropTarget(desktop, this)); + // Spawn a thread that shows the splashscreen + new SplashScreen(); - /////////Add a splashscreen on startup - /////////Add a splashscreen on startup - new SplashScreen(); discoverer = new jalview.ws.Discoverer(); // Only gets started if gui is displayed. @@ -1217,7 +1221,8 @@ public class Desktop public void checkForQuestionnaire(String url) { UserQuestionnaireCheck jvq = new UserQuestionnaireCheck(url); - javax.swing.SwingUtilities.invokeLater(jvq); + //javax.swing.SwingUtilities.invokeLater(jvq); + new Thread(jvq).start(); } /** * Proxy class for JDesktopPane which optionally diff --git a/src/jalview/gui/SplashScreen.java b/src/jalview/gui/SplashScreen.java index 8e0c55f..30cfa63 100755 --- a/src/jalview/gui/SplashScreen.java +++ b/src/jalview/gui/SplashScreen.java @@ -49,6 +49,21 @@ public class SplashScreen * ping the jalview version page then create and display the jalview splashscreen window. */ void initSplashScreenWindow() { + addMouseListener(new MouseAdapter() + { + public void mousePressed(MouseEvent evt) + { + try + { + visible=false; + closeSplash(); + } + catch (Exception ex) + { + } + } + }); + try { java.net.URL url = getClass().getResource("/images/logo.gif"); @@ -67,19 +82,6 @@ public class SplashScreen { } - addMouseListener(new MouseAdapter() - { - public void mousePressed(MouseEvent evt) - { - try - { - closeSplash(); - } - catch (Exception ex) - { - } - } - }); iframe = new JInternalFrame(); iframe.setFrameIcon(null);