X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FWebserviceInfo.java;h=4d0c63485bb1177a3bd1917945125c411058ebc5;hb=cce8dd5b2737f394593b3a418c7bb1836cf55c57;hp=e0090bee5642d265c38c8e53f224e658dd417674;hpb=d423f22792e47dbc800ae220a58677f988971d06;p=jalview.git diff --git a/src/jalview/gui/WebserviceInfo.java b/src/jalview/gui/WebserviceInfo.java index e0090be..4d0c634 100755 --- a/src/jalview/gui/WebserviceInfo.java +++ b/src/jalview/gui/WebserviceInfo.java @@ -1,5 +1,5 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5) + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * * This file is part of Jalview. @@ -232,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(); } @@ -460,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 { @@ -472,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. */