String title = "";\r
jalview.ws.WSClientI thisService;\r
boolean serviceIsCancellable;\r
+ JInternalFrame frame;\r
\r
/**\r
* Creates a new WebserviceInfo object.\r
*/\r
void init(String title, String info, int width, int height)\r
{\r
- JInternalFrame frame = new JInternalFrame();\r
+ frame = new JInternalFrame();\r
frame.setContentPane(this);\r
Desktop.addInternalFrame(frame, title, width, height);\r
+ frame.setClosable(false);\r
\r
this.title = title;\r
setInfoText(info);\r
}\r
else\r
{\r
+ frame.setClosable(true);\r
thisService.cancelJob();\r
}\r
}\r
\r
+ public void setResultsReady()\r
+ {\r
+ frame.setClosable(true);\r
+ buttonPanel.remove(cancel);\r
+ buttonPanel.add(showResultsNewFrame);\r
+ buttonPanel.add(mergeResults);\r
+ buttonPanel.setLayout(new GridLayout(2,1,5,5));\r
+ buttonPanel.validate();\r
+ validate();\r
+ }\r
+\r
+\r
class AnimatedPanel extends JPanel implements Runnable\r
{\r
long startTime = 0;\r
-/*
-* Jalview - A Sequence Alignment Editor and Viewer
-* Copyright (C) 2005 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
+/*\r
+* Jalview - A Sequence Alignment Editor and Viewer\r
+* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+*\r
+* This program is free software; you can redistribute it and/or\r
+* modify it under the terms of the GNU General Public License\r
+* as published by the Free Software Foundation; either version 2\r
+* of the License, or (at your option) any later version.\r
+*\r
+* This program is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with this program; if not, write to the Free Software\r
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\r
*/\r
package jalview.jbgui;\r
\r
\r
import javax.swing.*;\r
\r
-\r
/**\r
* DOCUMENT ME!\r
*\r
BorderLayout borderLayout2 = new BorderLayout();\r
protected JPanel titlePanel = new JPanel();\r
BorderLayout borderLayout3 = new BorderLayout();\r
- JPanel jPanel2 = new JPanel();\r
- protected JButton cancel = new JButton();\r
+ protected JPanel buttonPanel = new JPanel();\r
+ public JButton cancel = new JButton();\r
+ public JButton showResultsNewFrame = new JButton();\r
+ public JButton mergeResults = new JButton();\r
GridBagLayout gridBagLayout1 = new GridBagLayout();\r
-\r
- /**\r
+ /**\r
* Creates a new GWebserviceInfo object.\r
*/\r
public GWebserviceInfo()\r
cancel_actionPerformed(e);\r
}\r
});\r
- jPanel2.setLayout(gridBagLayout1);\r
- jPanel2.setOpaque(false);\r
- this.add(jScrollPane2, BorderLayout.CENTER);\r
+ buttonPanel.setLayout(gridBagLayout1);\r
+ buttonPanel.setOpaque(false);\r
+ showResultsNewFrame.setText("New Frame");\r
+ mergeResults.setText("Merge Results");\r
+ this.add(jScrollPane2, BorderLayout.CENTER);\r
this.add(jPanel1, BorderLayout.NORTH);\r
jPanel1.add(jScrollPane1, BorderLayout.CENTER);\r
jScrollPane1.getViewport().add(infoText, null);\r
jScrollPane2.getViewport().add(progressText, null);\r
jPanel1.add(titlePanel, BorderLayout.NORTH);\r
- titlePanel.add(jPanel2, BorderLayout.EAST);\r
- jPanel2.add(cancel,\r
- new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,\r
- GridBagConstraints.SOUTH, GridBagConstraints.NONE,\r
- new Insets(24, 5, 21, 5), 0, 0));\r
- }\r
+ titlePanel.add(buttonPanel, BorderLayout.EAST);\r
+ buttonPanel.add(cancel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0\r
+ , GridBagConstraints.CENTER,\r
+ GridBagConstraints.NONE,\r
+ new Insets(19, 6, 16, 4), 0, 0));\r
+ }\r
\r
/**\r
* DOCUMENT ME!\r
if (result.isFinished())\r
{\r
wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_OK);\r
+ wsInfo.showResultsNewFrame.addActionListener(new java.awt.event.ActionListener()\r
+ {\r
+ public void actionPerformed(java.awt.event.ActionEvent evt)\r
+ {\r
+ displayResults(true);\r
+ }\r
+ });\r
+ wsInfo.mergeResults.addActionListener(new java.awt.event.ActionListener()\r
+ {\r
+ public void actionPerformed(java.awt.event.ActionEvent evt)\r
+ {\r
+ displayResults(false);\r
+ }\r
+ });\r
+ wsInfo.setResultsReady();\r
parseResult();\r
jobComplete = true;\r
jobsRunning--;\r
\r
void parseResult()\r
{\r
- SequenceI[] seqs = null;\r
\r
try\r
{\r
OutputHeader += (lines[line] + "\n");\r
}\r
\r
- // JBPNote The returned files from a webservice could be hidden behind icons in the monitor window that, when clicked, pop up their corresponding data\r
- seqs = getVamsasAlignment(result.getMsa());\r
+ // JBPNote The returned files from a webservice could be\r
+ // hidden behind icons in the monitor window that,\r
+ // when clicked, pop up their corresponding data\r
}\r
\r
wsInfo.setProgressText(OutputHeader);\r
+ }\r
+ catch (Exception ex)\r
+ {\r
+ ex.printStackTrace();\r
+ }\r
+ }\r
\r
- if (seqs != null)\r
- {\r
- AlignmentOrder msaorder = new AlignmentOrder(seqs);\r
+ void displayResults(boolean newFrame)\r
+ {\r
+ SequenceI [] seqs = getVamsasAlignment(result.getMsa());\r
\r
- if (preserveOrder)\r
- {\r
- jalview.analysis.AlignmentSorter.recoverOrder(seqs);\r
- }\r
+ if (seqs != null)\r
+ {\r
+ AlignmentOrder msaorder = new AlignmentOrder(seqs);\r
\r
- jalview.analysis.SeqsetUtils.deuniquify(SeqNames, seqs);\r
+ if (preserveOrder)\r
+ {\r
+ jalview.analysis.AlignmentSorter.recoverOrder(seqs);\r
+ }\r
\r
- Alignment al = new Alignment(seqs);\r
- if (dataset!=null) {\r
- al.setDataset(dataset);\r
- }\r
- // TODO: JBPNote Should also rename the query sequence sometime...\r
- AlignFrame af = new AlignFrame(al);\r
+ jalview.analysis.SeqsetUtils.deuniquify(SeqNames, seqs);\r
\r
- //>>>This is a fix for the moment, until a better solution is found!!<<<\r
- af.getFeatureRenderer().transferSettings(alignFrame.getFeatureRenderer());\r
+ Alignment al = new Alignment(seqs);\r
+ if (dataset!=null)\r
+ {\r
+ al.setDataset(dataset);\r
+ }\r
\r
- af.addSortByOrderMenuItem(ServiceName + " Ordering",\r
- msaorder);\r
+ if(newFrame)\r
+ {\r
+ // TODO: JBPNote Should also rename the query sequence sometime...\r
+ AlignFrame af = new AlignFrame(al);\r
\r
- Desktop.addInternalFrame(af, alTitle,\r
- AlignFrame.NEW_WINDOW_WIDTH,\r
- AlignFrame.NEW_WINDOW_HEIGHT);\r
- }\r
- }\r
- catch (Exception ex)\r
- {\r
- ex.printStackTrace();\r
- }\r
+ //>>>This is a fix for the moment, until a better solution is found!!<<<\r
+ af.getFeatureRenderer().transferSettings(alignFrame.getFeatureRenderer());\r
+\r
+ af.addSortByOrderMenuItem(ServiceName + " Ordering",\r
+ msaorder);\r
+\r
+ Desktop.addInternalFrame(af, alTitle,\r
+ AlignFrame.NEW_WINDOW_WIDTH,\r
+ AlignFrame.NEW_WINDOW_HEIGHT);\r
+\r
+ }\r
+ else\r
+ {\r
+ System.out.println("MERGE WITH OLD FRAME");\r
+\r
+ }\r
+ }\r
}\r
}\r
}\r