X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FWebserviceInfo.java;h=4d0c63485bb1177a3bd1917945125c411058ebc5;hb=153dd62dc91da13ae732600e6ea55ddbe15eab39;hp=a0eeedfad25326c7c8791cc900725d62bf78b768;hpb=506d60f0e188723ddc91c26824b41ac7034df3fe;p=jalview.git diff --git a/src/jalview/gui/WebserviceInfo.java b/src/jalview/gui/WebserviceInfo.java index a0eeedf..4d0c634 100755 --- a/src/jalview/gui/WebserviceInfo.java +++ b/src/jalview/gui/WebserviceInfo.java @@ -1,20 +1,19 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) - * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) + * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This file is part of Jalview. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Jalview. If not, see . */ package jalview.gui; @@ -123,9 +122,9 @@ public class WebserviceInfo extends GWebserviceInfo * Creates a new WebserviceInfo object. * * @param title - * short name and job type + * short name and job type * @param info - * reference or other human readable description + * reference or other human readable description */ public WebserviceInfo(String title, String info) { @@ -136,13 +135,13 @@ public class WebserviceInfo extends GWebserviceInfo * Creates a new WebserviceInfo object. * * @param title - * DOCUMENT ME! + * DOCUMENT ME! * @param info - * DOCUMENT ME! + * DOCUMENT ME! * @param width - * DOCUMENT ME! + * DOCUMENT ME! * @param height - * DOCUMENT ME! + * DOCUMENT ME! */ public WebserviceInfo(String title, String info, int width, int height) { @@ -164,7 +163,7 @@ public class WebserviceInfo extends GWebserviceInfo * cancellable, whether the 'merge results' button is shown. * * @param newservice - * service client to query for capabilities + * service client to query for capabilities */ public void setthisService(jalview.ws.WSClientI newservice) { @@ -196,13 +195,13 @@ public class WebserviceInfo extends GWebserviceInfo * DOCUMENT ME! * * @param title - * DOCUMENT ME! + * DOCUMENT ME! * @param info - * DOCUMENT ME! + * DOCUMENT ME! * @param width - * DOCUMENT ME! + * DOCUMENT ME! * @param height - * DOCUMENT ME! + * DOCUMENT ME! */ void init(String title, String info, int width, int height) { @@ -233,20 +232,20 @@ public class WebserviceInfo extends GWebserviceInfo Thread thread = new Thread(ap); thread.start(); final WebserviceInfo thisinfo = this; - frame - .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() - { - public void internalFrameClosed( - javax.swing.event.InternalFrameEvent evt) - { - // System.out.println("Shutting down webservice client"); - WSClientI service = thisinfo.getthisService(); - if (service != null && service.isCancellable()) - { - service.cancelJob(); - } - }; - }); + frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() + { + public void internalFrameClosed( + javax.swing.event.InternalFrameEvent evt) + { + // System.out.println("Shutting down webservice client"); + WSClientI service = thisinfo.getthisService(); + if (service != null && service.isCancellable()) + { + service.cancelJob(); + } + }; + }); + frame.validate(); } @@ -254,7 +253,7 @@ public class WebserviceInfo extends GWebserviceInfo * DOCUMENT ME! * * @param status - * integer status from state constants + * integer status from state constants */ public void setStatus(int status) { @@ -313,7 +312,7 @@ public class WebserviceInfo extends GWebserviceInfo * DOCUMENT ME! * * @param text - * DOCUMENT ME! + * DOCUMENT ME! */ public void setInfoText(String text) { @@ -324,7 +323,7 @@ public class WebserviceInfo extends GWebserviceInfo * DOCUMENT ME! * * @param text - * DOCUMENT ME! + * DOCUMENT ME! */ public void appendInfoText(String text) { @@ -350,7 +349,7 @@ public class WebserviceInfo extends GWebserviceInfo * DOCUMENT ME! * * @param text - * DOCUMENT ME! + * DOCUMENT ME! */ public void setProgressText(int which, String text) { @@ -366,7 +365,7 @@ public class WebserviceInfo extends GWebserviceInfo * DOCUMENT ME! * * @param text - * DOCUMENT ME! + * DOCUMENT ME! */ public void appendProgressText(int which, String text) { @@ -406,7 +405,7 @@ public class WebserviceInfo extends GWebserviceInfo * get the tab title for a subjob * * @param which - * int + * int * @return String */ public String getProgressName(int which) @@ -430,9 +429,9 @@ public class WebserviceInfo extends GWebserviceInfo * set the tab title for a subjob * * @param name - * String + * String * @param which - * int + * int */ public void setProgressName(String name, int which) { @@ -451,7 +450,7 @@ public class WebserviceInfo extends GWebserviceInfo * Gui action for cancelling the current job, if possible. * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ protected void cancel_actionPerformed(ActionEvent e) { @@ -461,9 +460,8 @@ public class WebserviceInfo extends GWebserviceInfo // anyhow - it has to stop threads and clean up // JBPNote : TODO: Instead of a warning, we should have an optional 'Are // you sure?' prompt - JOptionPane.showInternalMessageDialog(Desktop.desktop, - "This job cannot be cancelled.\nJust close the window.", - "Cancel job", JOptionPane.WARNING_MESSAGE); + warnUser("This job cannot be cancelled.\nJust close the window.", + "Cancel job"); } else { @@ -473,6 +471,26 @@ public class WebserviceInfo extends GWebserviceInfo } /** + * Spawns a thread that pops up a warning dialog box with the given message + * and title. + * + * @param message + * @param title + */ + public void warnUser(final String message, final String title) + { + javax.swing.SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + JOptionPane.showInternalMessageDialog(Desktop.desktop, message, + title, JOptionPane.WARNING_MESSAGE); + + } + }); + } + + /** * Set up GUI for user to get at results - and possibly automatically display * them if viewResultsImmediatly is set. */