/*
- * Jalview - A Sequence Alignment Editor and Viewer
- * Copyright (C) 2007 AM Waterhouse, J Procter, 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 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.
- *
- * 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 - A Sequence Alignment Editor and Viewer (Version 2.5)
+ * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * 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.
+ *
+ * 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 <http://www.gnu.org/licenses/>.
*/
package jalview.gui;
* 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)
{
* 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)
{
* 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)
{
* 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)
{
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();
+ }
+ };
+ });
}
* DOCUMENT ME!
*
* @param status
- * integer status from state constants
+ * integer status from state constants
*/
public void setStatus(int status)
{
* DOCUMENT ME!
*
* @param text
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void setInfoText(String text)
{
* DOCUMENT ME!
*
* @param text
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void appendInfoText(String text)
{
* DOCUMENT ME!
*
* @param text
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void setProgressText(int which, String text)
{
* DOCUMENT ME!
*
* @param text
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void appendProgressText(int which, String text)
{
* get the tab title for a subjob
*
* @param which
- * int
+ * int
* @return String
*/
public String getProgressName(int which)
* set the tab title for a subjob
*
* @param name
- * String
+ * String
* @param which
- * int
+ * int
*/
public void setProgressName(String name, int which)
{
* Gui action for cancelling the current job, if possible.
*
* @param e
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
protected void cancel_actionPerformed(ActionEvent e)
{
// 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
{
}
/**
+ * 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.
*/