*
* Jalview 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 3 of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
*
* Jalview 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 Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.ws.jws2;
initSequenceAnnotationWSClient(sh, alignFrame, preset, editParams);
}
- // dan think. Do I need to change this method to run RNAalifold through the GUI
-
+ // dan think. Do I need to change this method to run RNAalifold through the
+ // GUI
+
public void initSequenceAnnotationWSClient(final Jws2Instance sh,
AlignFrame alignFrame, WsParamSetI preset, boolean editParams)
{
- // dan changed! dan test. comment out if conditional
-// if (alignFrame.getViewport().getAlignment().isNucleotide())
-// {
-// JOptionPane.showMessageDialog(Desktop.desktop, sh.serviceType
-// + " can only be used\nfor amino acid alignments.",
-// "Wrong type of sequences!", JOptionPane.WARNING_MESSAGE);
-// return;
-//
-// }
+ // dan changed! dan test. comment out if conditional
+ // if (alignFrame.getViewport().getAlignment().isNucleotide())
+ // {
+ // JOptionPane.showMessageDialog(Desktop.desktop, sh.serviceType
+ // + " can only be used\nfor amino acid alignments.",
+ // "Wrong type of sequences!", JOptionPane.WARNING_MESSAGE);
+ // return;
+ //
+ // }
AlignAnalysisUIText aaui = sh.getAlignAnalysisUI();
- if (aaui!=null)
+ if (aaui != null)
{
Class clientClass = aaui.getClient();
-
+
// Build an AACon style client - take alignment, return annotation for
// columns
List<AlignCalcWorkerI> clnts = alignFrame.getViewport()
- .getCalcManager()
- .getRegisteredWorkersOfClass(clientClass);
+ .getCalcManager().getRegisteredWorkersOfClass(clientClass);
JabawsAlignCalcWorker worker;
if (clnts == null || clnts.size() == 0)
{
{
return;
}
- try {
- worker = (JabawsAlignCalcWorker) (clientClass.getConstructor(
- new Class[] { Jws2Instance.class,
- AlignFrame.class, WsParamSetI.class,
- List.class }).newInstance(new Object[] { sh, alignFrame, this.preset, paramset}));
+ try
+ {
+ worker = (JabawsAlignCalcWorker) (clientClass
+ .getConstructor(new Class[]
+ { Jws2Instance.class, AlignFrame.class,
+ WsParamSetI.class, List.class })
+ .newInstance(new Object[]
+ { sh, alignFrame, this.preset, paramset }));
} catch (Exception x)
{
x.printStackTrace();
- throw new Error("Implementation error",x);
+ throw new Error("Implementation error", x);
}
- alignFrame
- .getViewport()
- .getCalcManager()
- .registerWorker(
- worker);
+ alignFrame.getViewport().getCalcManager().registerWorker(worker);
alignFrame.getViewport().getCalcManager().startWorker(worker);
}
public void attachWSMenuEntry(JMenu wsmenu, final Jws2Instance service,
final AlignFrame alignFrame)
{
- if (registerAAConWSInstance(wsmenu, service, alignFrame)) {
+ if (registerAAConWSInstance(wsmenu, service, alignFrame))
+ {
// Alignment dependent analysis calculation WS gui
return;
}
String calcName = service.serviceType.substring(0,
service.serviceType.length() - 2);
- JMenuItem annotservice = new JMenuItem(MessageManager.formatMessage("label.calcname_with_default_settings", new String[]{calcName}));
+ JMenuItem annotservice = new JMenuItem(MessageManager.formatMessage(
+ "label.calcname_with_default_settings", new String[]
+ { calcName }));
annotservice.addActionListener(new ActionListener()
{
{
// only add these menu options if the service has user-modifiable
// arguments
- annotservice = new JMenuItem(MessageManager.getString("label.edit_settings_and_run"));
+ annotservice = new JMenuItem(
+ MessageManager.getString("label.edit_settings_and_run"));
annotservice
- .setToolTipText(MessageManager.getString("label.view_and_change_parameters_before_running_calculation"));
+ .setToolTipText(MessageManager
+ .getString("label.view_and_change_parameters_before_running_calculation"));
annotservice.addActionListener(new ActionListener()
{
}
else
{
- annotservice = new JMenuItem(MessageManager.getString("label.view_documentation"));
+ annotservice = new JMenuItem(
+ MessageManager.getString("label.view_documentation"));
if (service.docUrl != null)
{
annotservice.addActionListener(new ActionListener()
}
}
-
private boolean registerAAConWSInstance(final JMenu wsmenu,
final Jws2Instance service, final AlignFrame alignFrame)
{
- final AlignAnalysisUIText aaui = service.getAlignAnalysisUI(); // null ; // AlignAnalysisUIText.aaConGUI.get(service.serviceType.toString());
- if (aaui==null)
+ final AlignAnalysisUIText aaui = service.getAlignAnalysisUI(); // null ; //
+ // AlignAnalysisUIText.aaConGUI.get(service.serviceType.toString());
+ if (aaui == null)
{
// not an instantaneous calculation GUI type service
return false;
}
- // create the instaneous calculation GUI bits and update state if existing GUI elements already present
-
+ // create the instaneous calculation GUI bits and update state if existing
+ // GUI elements already present
+
JCheckBoxMenuItem _aaConEnabled = null;
for (int i = 0; i < wsmenu.getItemCount(); i++)
{
.getRegisteredWorkersOfClass(aaui.getClient());
if (aaconClient != null && aaconClient.size() > 0)
{
- JabawsAlignCalcWorker worker = (JabawsAlignCalcWorker) aaconClient.get(0);
+ JabawsAlignCalcWorker worker = (JabawsAlignCalcWorker) aaconClient
+ .get(0);
if (!worker.service.hosturl.equals(service.hosturl))
{
// javax.swing.SwingUtilities.invokeLater(new Runnable()
aaui.getAAconToggle());
aaConEnabled.setToolTipText("<html><p>"
- + JvSwingUtils.wrapTooltip(aaui.getAAconToggleTooltip() + "</p>")
- + "</html>");
+ + JvSwingUtils.wrapTooltip(aaui.getAAconToggleTooltip()
+ + "</p>") + "</html>");
aaConEnabled.addActionListener(new ActionListener()
{
@Override
wsmenu.add(aaConEnabled);
final JMenuItem modifyParams = new JMenuItem(aaui.getAAeditSettings());
modifyParams.setToolTipText("<html><p>"
- + JvSwingUtils.wrapTooltip(aaui.getAAeditSettingsTooltip() + "</p>")
- + "</html>");
+ + JvSwingUtils.wrapTooltip(aaui.getAAeditSettingsTooltip()
+ + "</p>") + "</html>");
modifyParams.addActionListener(new ActionListener()
{
public void menuSelected(MenuEvent arg0)
{
// TODO: refactor to the implementing class.
- if (alignFrame.getViewport().getAlignment()
- .isNucleotide() ? aaui.isNa() : aaui.isPr()) {
+ if (alignFrame.getViewport().getAlignment().isNucleotide() ? aaui
+ .isNa() : aaui.isPr())
+ {
aaConEnabled.setEnabled(true);
modifyParams.setEnabled(true);
}
- else {
+ else
+ {
aaConEnabled.setEnabled(false);
modifyParams.setEnabled(false);
}
return true;
}
- private static void showAAConAnnotationSettingsFor(final AlignAnalysisUIText aaui, AlignFrame alignFrame)
+ private static void showAAConAnnotationSettingsFor(
+ final AlignAnalysisUIText aaui, AlignFrame alignFrame)
{
/*
* preferred settings Whether AACon is automatically recalculated Which
}
- private static void buildCurrentAAConWorkerFor(final AlignAnalysisUIText aaui, AlignFrame alignFrame)
+ private static void buildCurrentAAConWorkerFor(
+ final AlignAnalysisUIText aaui, AlignFrame alignFrame)
{
buildCurrentAAConWorkerFor(aaui, alignFrame, null);
}
- private static void buildCurrentAAConWorkerFor(final AlignAnalysisUIText aaui, AlignFrame alignFrame,
+ private static void buildCurrentAAConWorkerFor(
+ final AlignAnalysisUIText aaui, AlignFrame alignFrame,
Jws2Instance service)
{
/*
new SequenceAnnotationWSClient(fave, alignFrame, false);
}
- private static AAConSettings createDefaultAAConSettings(AlignAnalysisUIText aaui)
+ private static AAConSettings createDefaultAAConSettings(
+ AlignAnalysisUIText aaui)
{
return createDefaultAAConSettings(aaui, null);
}
- private static AAConSettings createDefaultAAConSettings(AlignAnalysisUIText aaui,
- Jws2Instance service)
+ private static AAConSettings createDefaultAAConSettings(
+ AlignAnalysisUIText aaui, Jws2Instance service)
{
if (service != null)
{
return new AAConSettings(true, service, null, null);
}
- private static void removeCurrentAAConWorkerFor(AlignAnalysisUIText aaui, AlignFrame alignFrame)
+ private static void removeCurrentAAConWorkerFor(AlignAnalysisUIText aaui,
+ AlignFrame alignFrame)
{
alignFrame.getViewport().getCalcManager()
.removeRegisteredWorkersOfClass(aaui.getClient());