X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FDesktop.java;h=712c9ceee11ddaa5e11a9663400359bae4372cff;hb=403136e499a24498237778aa19adb2860c625882;hp=b6cbea389ead9b0248ae4c96b1fdde3760385ba7;hpb=190a4893d444dde29d9bc2c825b483491fa0088d;p=jalview.git
diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java
index b6cbea3..712c9ce 100644
--- a/src/jalview/gui/Desktop.java
+++ b/src/jalview/gui/Desktop.java
@@ -1,6 +1,6 @@
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
@@ -64,6 +64,8 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.StringTokenizer;
import java.util.Vector;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
import javax.swing.DefaultDesktopManager;
import javax.swing.DesktopManager;
@@ -80,8 +82,10 @@ import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JProgressBar;
import javax.swing.SwingUtilities;
+import javax.swing.event.HyperlinkEvent;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
+import javax.swing.event.HyperlinkEvent.EventType;
/**
* Jalview Desktop
@@ -1036,6 +1040,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements
storeLastKnownDimensions("JALVIEW_RSS_WINDOW_", jvnews.getBounds());
}
+ if (dialogExecutor!=null)
+ {
+ dialogExecutor.shutdownNow();
+ }
System.exit(0);
}
@@ -1060,30 +1068,78 @@ public class Desktop extends jalview.jbgui.GDesktop implements
*/
public void aboutMenuItem_actionPerformed(ActionEvent e)
{
- StringBuffer message = new StringBuffer("Jalview version "
- + jalview.bin.Cache.getProperty("VERSION") + "; last updated: "
- + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"));
+// StringBuffer message = getAboutMessage(false);
+// JOptionPane.showInternalMessageDialog(Desktop.desktop,
+//
+// message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE);
+ new Thread(new Runnable() { public void run() {new SplashScreen(true);}}).start();
+ }
+
+ public StringBuffer getAboutMessage(boolean shortv)
+ {
+ StringBuffer message = new StringBuffer();
+ message.append("");
+ if (shortv)
+ {
+ message.append("
Version: "
+ + jalview.bin.Cache.getProperty("VERSION")
+ + "
");
+ message.append("Last Updated: "
+ + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown")
+ + "");
- if (!jalview.bin.Cache.getProperty("LATEST_VERSION").equals(
- jalview.bin.Cache.getProperty("VERSION")))
+ }
+ else
{
- message.append("\n\n!! Jalview version "
- + jalview.bin.Cache.getProperty("LATEST_VERSION")
- + " is available for download from "+jalview.bin.Cache.getDefault("www.jalview.org","http://www.jalview.org")+" !!\n");
+ message.append("Version "
+ + jalview.bin.Cache.getProperty("VERSION")
+ + "; last updated: "
+ + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"));
}
- // TODO: update this text for each release or centrally store it for lite
- // and application
- message.append("\nAuthors: Jim Procter, Andrew Waterhouse, Michele Clamp, James Cuff, Steve Searle,\n David Martin & Geoff Barton."
- + "\nDevelopment managed by The Barton Group, University of Dundee, Scotland, UK.\n"
- + "\nFor help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list\n"
- + "\nIf you use Jalview, please cite:"
- + "\nWaterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
- + "\nJalview Version 2 - a multiple sequence alignment editor and analysis workbench"
- + "\nBioinformatics doi: 10.1093/bioinformatics/btp033");
- JOptionPane.showInternalMessageDialog(Desktop.desktop,
- message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE);
+ if (jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking").equals(
+ "Checking"))
+ {
+ message.append("
...Checking latest version...");
+ }
+ else if (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
+ .equals(jalview.bin.Cache.getProperty("VERSION")))
+ {
+ boolean red = false;
+ if (jalview.bin.Cache.getProperty("VERSION").toLowerCase()
+ .indexOf("automated build") == -1)
+ {
+ red = true;
+ // Displayed when code version and jnlp version do not match and code
+ // version is not a development build
+ message.append("");
+ }
+
+ message.append("
!! Version "
+ + jalview.bin.Cache.getDefault("LATEST_VERSION",
+ "..Checking..")
+ + " is available for download from "
+ + jalview.bin.Cache.getDefault("www.jalview.org",
+ "http://www.jalview.org") + " !!");
+ if (red)
+ {
+ message.append("
");
+ }
+ }
+ message.append("
Authors: "
+ + jalview.bin.Cache
+ .getDefault(
+ "AUTHORNAMES",
+ "Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton")
+ + "
Development managed by The Barton Group, University of Dundee, Scotland, UK.
"
+ + "
For help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list"
+ + "
If you use Jalview, please cite:"
+ + "
Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
+ + "
Jalview Version 2 - a multiple sequence alignment editor and analysis workbench"
+ + "
Bioinformatics doi: 10.1093/bioinformatics/btp033"
+ + "");
+ return message;
}
/**
@@ -1592,7 +1648,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
source.viewport.gatherViewsHere = true;
source.viewport.explodedPosition = source.getBounds();
JInternalFrame[] frames = desktop.getAllFrames();
- String viewId = source.viewport.sequenceSetID;
+ String viewId = source.viewport.getSequenceSetId();
for (int t = 0; t < frames.length; t++)
{
@@ -2281,6 +2337,20 @@ public class Desktop extends jalview.jbgui.GDesktop implements
}
/**
+ *
+ * @return true if any progress bars are still active
+ */
+ @Override
+ public boolean operationInProgress()
+ {
+ if (progressBars != null && progressBars.size() > 0)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
* This will return the first AlignFrame viewing AlignViewport av. It will
* break if there are more than one AlignFrames viewing a particular av. This
*
@@ -2513,5 +2583,49 @@ public class Desktop extends jalview.jbgui.GDesktop implements
return wsparamManager;
}
+ /**
+ * 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;
+ 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.");
+ }
+ }
+ // ignore any exceptions due to dud links.
+ }
+
+ }
+ }
+ /**
+ * single thread that handles display of dialogs to user.
+ */
+ ExecutorService dialogExecutor=null;
+
+ /**
+ * add another dialog thread to the queue
+ * @param prompter
+ */
+ public synchronized void addDialogThread(Runnable prompter)
+ {
+ if (dialogExecutor==null)
+ {
+ dialogExecutor = Executors.newSingleThreadExecutor();
+ }
+ dialogExecutor.submit(prompter);
+ }
}