X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fws%2Fjws2%2FMsaWSClient.java;h=9caa803ede24509a0130c5be73c6c6904c634b34;hb=bf9a5f8b67b34ebf8c172222b04b50e8ec584c78;hp=7e68d3bf240f1634828dd88f5bda7a8593b12ae3;hpb=f4766a7bbcfae845fc95923b01fa14ff83d589ff;p=jalview.git
diff --git a/src/jalview/ws/jws2/MsaWSClient.java b/src/jalview/ws/jws2/MsaWSClient.java
index 7e68d3b..9caa803 100644
--- a/src/jalview/ws/jws2/MsaWSClient.java
+++ b/src/jalview/ws/jws2/MsaWSClient.java
@@ -20,15 +20,7 @@
*/
package jalview.ws.jws2;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.AlignmentView;
-import jalview.gui.AlignFrame;
-import jalview.gui.Desktop;
-import jalview.gui.JvOptionPane;
-import jalview.gui.JvSwingUtils;
-import jalview.util.MessageManager;
-import jalview.ws.jws2.jabaws2.Jws2Instance;
-import jalview.ws.params.WsParamSetI;
+import java.util.Locale;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -42,6 +34,15 @@ import javax.swing.ToolTipManager;
import compbio.data.msa.MsaWS;
import compbio.metadata.Argument;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.AlignmentView;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.JvOptionPane;
+import jalview.gui.JvSwingUtils;
+import jalview.util.MessageManager;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
/**
* DOCUMENT ME!
@@ -149,7 +150,7 @@ public class MsaWSClient extends Jws2Client
wsInfo.setProgressText(((submitGaps) ? "Re-alignment" : "Alignment")
+ " of " + altitle + "\nJob details\n");
- String jobtitle = WebServiceName.toLowerCase();
+ String jobtitle = WebServiceName.toLowerCase(Locale.ROOT);
if (jobtitle.endsWith("alignment"))
{
if (submitGaps && (!jobtitle.endsWith("realignment")
@@ -181,19 +182,14 @@ public class MsaWSClient extends Jws2Client
}
else
{
+ wsInfo.setVisible(false);
JvOptionPane.showMessageDialog(alignFrame,
MessageManager.getString("info.invalid_msa_input_mininfo"),
MessageManager.getString("info.invalid_msa_notenough"),
JvOptionPane.INFORMATION_MESSAGE);
- wsInfo.setVisible(false);
}
}
- public static void main(String[] args)
- {
- System.out.println("A".matches("(-*[a-zA-Z]-*){1}[a-zA-Z-]*"));
- }
-
protected String getServiceActionKey()
{
return "MsaWS";
@@ -219,9 +215,9 @@ public class MsaWSClient extends Jws2Client
@Override
public void attachWSMenuEntry(JMenu rmsawsmenu,
- final Jws2Instance service, final AlignFrame alignFrame)
+ final Jws2Instance service, final AlignFrame af)
{
- if (registerAAConWSInstance(rmsawsmenu, service, alignFrame))
+ if (registerAAConWSInstance(rmsawsmenu, service, af))
{
// Alignment dependent analysis calculation WS gui
return;
@@ -269,14 +265,12 @@ public class MsaWSClient extends Jws2Client
@Override
public void actionPerformed(ActionEvent e)
{
- AlignmentView msa = alignFrame.gatherSequencesForAlignment();
+ AlignmentView msa = af.gatherSequencesForAlignment();
if (msa != null)
{
- new MsaWSClient(service, alignFrame.getTitle(), msa, withGaps,
- true,
- alignFrame.getViewport().getAlignment().getDataset(),
- alignFrame);
+ new MsaWSClient(service, af.getTitle(), msa, withGaps, true,
+ af.getViewport().getAlignment().getDataset(), af);
}
}
@@ -296,13 +290,10 @@ public class MsaWSClient extends Jws2Client
@Override
public void actionPerformed(ActionEvent e)
{
- AlignmentView msa = alignFrame.gatherSequencesForAlignment();
+ AlignmentView msa = af.gatherSequencesForAlignment();
if (msa != null)
{
- new MsaWSClient(service, null, null, true,
- alignFrame.getTitle(), msa, withGaps, true,
- alignFrame.getViewport().getAlignment().getDataset(),
- alignFrame);
+ startJob(service, af, withGaps, msa);
}
}
@@ -317,9 +308,9 @@ public class MsaWSClient extends Jws2Client
final int showToolTipFor = ToolTipManager.sharedInstance()
.getDismissDelay();
- for (final WsParamSetI preset : presets)
+ for (final WsParamSetI preSet : presets)
{
- final JMenuItem methodR = new JMenuItem(preset.getName());
+ final JMenuItem methodR = new JMenuItem(preSet.getName());
final int QUICK_TOOLTIP = 1500;
// JAL-1582 shorten tooltip display time in these menu items as
// they can obscure other options
@@ -341,27 +332,24 @@ public class MsaWSClient extends Jws2Client
});
String tooltip = JvSwingUtils.wrapTooltip(true, ""
- + (preset.isModifiable()
+ + (preSet.isModifiable()
? MessageManager.getString("label.user_preset")
: MessageManager
.getString("label.service_preset"))
- + "
" + preset.getDescription());
+ + "
" + preSet.getDescription());
methodR.setToolTipText(tooltip);
methodR.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
- AlignmentView msa = alignFrame
- .gatherSequencesForAlignment();
+ AlignmentView msa = af.gatherSequencesForAlignment();
if (msa != null)
{
- MsaWSClient msac = new MsaWSClient(service, preset,
- alignFrame.getTitle(), msa, false, true,
- alignFrame.getViewport().getAlignment()
- .getDataset(),
- alignFrame);
+ MsaWSClient msac = new MsaWSClient(service, preSet,
+ af.getTitle(), msa, false, true,
+ af.getViewport().getAlignment().getDataset(), af);
}
}
@@ -383,4 +371,21 @@ public class MsaWSClient extends Jws2Client
}
} while (!finished);
}
+
+ protected void startJob(final Jws2Instance service, final AlignFrame af,
+ final boolean withGaps, AlignmentView msa)
+ {
+ try
+ {
+ new MsaWSClient(service, null, null, true, af.getTitle(), msa,
+ withGaps, true, af.getViewport().getAlignment().getDataset(),
+ af);
+ } catch (Exception e)
+ {
+ JvOptionPane.showMessageDialog(alignFrame, e.getMessage(),
+ MessageManager.getString("label.state_job_error"),
+ JvOptionPane.WARNING_MESSAGE);
+
+ }
+ }
}