From aeb0422c06425ac0c76375106ffc635d03e88b88 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 28 Apr 2005 14:28:43 +0000 Subject: [PATCH] added MuscleWS and did a bit more standardisation of WS threads. --- src/jalview/gui/AlignFrame.java | 33 +++++++++++++++++++++++++++++++++ src/jalview/gui/WebserviceInfo.java | 20 ++++++++++++++++---- src/jalview/jbgui/GAlignFrame.java | 13 +++++++++++++ 3 files changed, 62 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index b217e9c..1b9ee91 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1188,6 +1188,39 @@ public class AlignFrame extends GAlignFrame } } + protected void msaAlignMenuItem_actionPerformed(ActionEvent e) + { + // TODO:resolve which menu item was actually selected + // Now, check we have enough sequences + if (viewport.getSelectionGroup() != null && viewport.getSelectionGroup().getSize()>1) + { + // JBPNote UGLY! To prettify, make SequenceGroup and Alignment conform to some common interface! + SequenceGroup seqs = viewport.getSelectionGroup(); + int sz; + SequenceI[] msa = new SequenceI[sz=seqs.getSize()]; + for (int i = 0; i < sz; i++) + { + msa[i] = (SequenceI) seqs.getSequenceAt(i); + } + + MsaWSClient ct = new jalview.ws.MsaWSClient(msa); + } + else + { + Vector seqs = viewport.getAlignment().getSequences(); + + if (seqs.size() > 1) { + SequenceI[] msa = new SequenceI[seqs.size()]; + for (int i = 0; i < seqs.size(); i++) + { + msa[i] = (SequenceI) seqs.elementAt(i); + } + + MsaWSClient ct = new MsaWSClient(msa); + } + + } + } protected void LoadtreeMenuItem_actionPerformed(ActionEvent e) { // Pick the tree file diff --git a/src/jalview/gui/WebserviceInfo.java b/src/jalview/gui/WebserviceInfo.java index 26aa067..7ce77a3 100755 --- a/src/jalview/gui/WebserviceInfo.java +++ b/src/jalview/gui/WebserviceInfo.java @@ -17,6 +17,15 @@ public class WebserviceInfo extends GWebserviceInfo int angle = 0; String title=""; + jalview.ws.WSClientI thisService; + boolean serviceIsCancellable; + public jalview.ws.WSClientI getthisService() { + return thisService; + } + public void setthisService(jalview.ws.WSClientI newservice) { + thisService = newservice; + serviceIsCancellable = newservice.isCancellable(); + } public WebserviceInfo(String title, String info) { @@ -79,10 +88,13 @@ public class WebserviceInfo extends GWebserviceInfo protected void cancel_actionPerformed(ActionEvent e) { - JOptionPane.showInternalMessageDialog(Desktop.desktop, - "Cancel not implemented yet!!" , - "Cancel job" - ,JOptionPane.WARNING_MESSAGE); + if (!serviceIsCancellable) + JOptionPane.showInternalMessageDialog(Desktop.desktop, + "Cancel not implemented yet!!" , + "Cancel job" + ,JOptionPane.WARNING_MESSAGE); + else + thisService.cancelJob(); } diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 3630528..3cb11e2 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -42,6 +42,7 @@ public class GAlignFrame extends JInternalFrame protected JMenuItem averageDistanceTreeMenuItem = new JMenuItem(); protected JMenuItem neighbourTreeMenuItem = new JMenuItem(); protected JMenuItem clustalAlignMenuItem = new JMenuItem(); + protected JMenuItem msaAlignMenuItem = new JMenuItem(); BorderLayout borderLayout1 = new BorderLayout(); public JLabel statusBar = new JLabel(); protected JMenu saveAlignmentMenu = new JMenu(); @@ -332,6 +333,14 @@ public class GAlignFrame extends JInternalFrame clustalAlignMenuItem_actionPerformed(e); } }); + msaAlignMenuItem.setText("Muscle alignment"); + msaAlignMenuItem.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(ActionEvent e) + { + msaAlignMenuItem_actionPerformed(e); + } + }); this.getContentPane().setLayout(borderLayout1); alignFrameMenuBar.setFont(new java.awt.Font("Verdana", 0, 11)); statusBar.setBackground(Color.white); @@ -817,6 +826,7 @@ public class GAlignFrame extends JInternalFrame calculateMenu.add(avDistanceTreeBlosumMenuItem); calculateMenu.add(njTreeBlosumMenuItem); alignMenu.add(clustalAlignMenuItem); + alignMenu.add(msaAlignMenuItem); alignMenu.add(jpred); this.getContentPane().add(statusBar, BorderLayout.SOUTH); jMenu1.add(pasteNew); @@ -1003,7 +1013,10 @@ public class GAlignFrame extends JInternalFrame } + protected void msaAlignMenuItem_actionPerformed(ActionEvent e) + { + } protected void clustalColour_actionPerformed(ActionEvent e) -- 1.7.10.2