presets = service.getParamStore().getPresets();
if (presets != null && presets.size() > 0)
{
JMenu presetlist = new JMenu(
MessageManager.formatMessage(
"label.run_with_preset_params",
new String[] { calcName }));
final int showToolTipFor = ToolTipManager.sharedInstance()
.getDismissDelay();
for (final WsParamSetI preset : presets)
{
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);
}
});
methodR.setToolTipText(JvSwingUtils.wrapTooltip(
true,
""
+ (preset.isModifiable() ? MessageManager
.getString("label.user_preset")
: MessageManager
.getString("label.service_preset"))
+ "
" + preset.getDescription()
+ "
"));
methodR.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
AlignmentView msa = alignFrame
.gatherSequencesForAlignment();
if (msa != null)
{
MsaWSClient msac = new MsaWSClient(service, preset,
alignFrame.getTitle(), msa, false, true,
alignFrame.getViewport().getAlignment()
.getDataset(), alignFrame);
}
}
});
presetlist.add(methodR);
}
msawsmenu.add(presetlist);
}
}
if (!submitGaps && canSubmitGaps())
{
submitGaps = true;
finished = false;
}
else
{
finished = true;
}
} while (!finished);
}
}