presets = service.getParamStore().getPresets();
if (presets != null && presets.size() > 0)
{
- JMenu presetlist = new JMenu(calcName + "Presets");
+ JMenu presetlist = new JMenu(MessageManager.formatMessage(
+ "label.run_with_preset_params", new String[]
+ { calcName }));
- for (final WsParamSetI preset : presets)
+ final int showToolTipFor = ToolTipManager.sharedInstance()
+ .getDismissDelay();
+ for (final WsParamSetI preSet : presets)
{
- final JMenuItem methodR = new JMenuItem(preset.getName());
- methodR.setToolTipText(""
- + JvSwingUtils.wrapTooltip(""
- + (preset.isModifiable() ? "User Preset"
- : "Service Preset") + "
"
- + preset.getDescription() + "
") + "");
+ 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
+ methodR.addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mouseEntered(MouseEvent e)
+ {
+ ToolTipManager.sharedInstance()
+ .setDismissDelay(QUICK_TOOLTIP);
+ }
+
+ @Override
+ public void mouseExited(MouseEvent e)
+ {
+ ToolTipManager.sharedInstance()
+ .setDismissDelay(showToolTipFor);
+ }
+
+ });
+ String tooltip = JvSwingUtils.wrapTooltip(true, ""
+ + (preSet.isModifiable()
+ ? MessageManager.getString("label.user_preset")
+ : MessageManager
+ .getString("label.service_preset"))
+ + "
" + preSet.getDescription());
+ methodR.setToolTipText(tooltip);
methodR.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
- AlignmentView msa = alignFrame
+ AlignmentView msa = af
.gatherSequencesForAlignment();
- new MsaWSClient(service, preset, alignFrame.getTitle(),
- msa, false, true, alignFrame.getViewport()
- .getAlignment().getDataset(), alignFrame);
+
+ if (msa != null)
+ {
+ MsaWSClient msac = new MsaWSClient(service, preSet,
+ af.getTitle(), msa, false, true,
+ af.getViewport().getAlignment()
+ .getDataset(),
+ af);
+ }
}
@@ -359,4 +376,20 @@ 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);
+
+ }
+ }
}