import jalview.ws.params.ArgumentI;
import jalview.ws.params.ParamDatastoreI;
import jalview.ws.params.WsParamSetI;
+import jalview.ws.params.simple.Option;
import jalview.ws.seqfetcher.DbSourceProxy;
import java.awt.BorderLayout;
}
@Override
- public void hmmBuildSettings_actionPerformed()
+ public void hmmBuild_actionPerformed(boolean withDefaults)
{
- if (!(alignmentIsSufficient(1)))
+ if (!alignmentIsSufficient(1))
{
return;
}
- WsParamSetI set = new HMMERPreset();
List<ArgumentI> args = new ArrayList<>();
- ParamDatastoreI store = new HMMERParamStore("hmmbuild");
- WsJobParameters params = new WsJobParameters(new JFrame(), store, set,
- args);
- if (params.showRunDialog())
+ if (withDefaults)
{
- new Thread(new HMMBuild(this, params.getJobParams())).start();
+ // todo: construct this in HMMERPreset?
+ String argName = MessageManager.getString("label.hmmbuild_for");
+ String argValue = MessageManager.getString("label.alignment");
+ args.add(
+ new Option(argName, null, false, null, argValue, null, null));
}
- alignPanel.repaint();
-
+ else
+ {
+ WsParamSetI set = new HMMERPreset();
+ ParamDatastoreI store = HMMERParamStore.forBuild();
+ WsJobParameters params = new WsJobParameters(new JFrame(), store, set,
+ args);
+ if (params.showRunDialog())
+ {
+ args = params.getJobParams();
+ }
+ else
+ {
+ return; // user cancelled
+ }
+ }
+ new Thread(new HMMBuild(this, args)).start();
}
@Override
- public void hmmAlignSettings_actionPerformed()
+ public void hmmAlign_actionPerformed(boolean withDefaults)
{
if (!(checkForHMM() && alignmentIsSufficient(2)))
{
return;
}
- WsParamSetI set = new HMMERPreset();
List<ArgumentI> args = new ArrayList<>();
- ParamDatastoreI store = new HMMERParamStore("hmmalign");
- WsJobParameters params = new WsJobParameters(new JFrame(), store, set,
- args);
- if (params.showRunDialog())
+ if (!withDefaults)
{
- new Thread(new HMMAlign(this, params.getJobParams()))
- .start();
+ WsParamSetI set = new HMMERPreset();
+ ParamDatastoreI store = HMMERParamStore.forAlign();
+ WsJobParameters params = new WsJobParameters(new JFrame(), store, set,
+ args);
+ if (params.showRunDialog())
+ {
+ args = params.getJobParams();
+ }
+ else
+ {
+ return; // user cancelled
+ }
}
- alignPanel.repaint();
+ new Thread(new HMMAlign(this, args)).start();
}
@Override
- public void hmmSearchSettings_actionPerformed()
+ public void hmmSearch_actionPerformed(boolean withDefaults)
{
if (!checkForHMM())
{
return;
}
- WsParamSetI set = new HMMERPreset();
List<ArgumentI> args = new ArrayList<>();
- ParamDatastoreI store = new HMMERParamStore("hmmsearch");
- WsJobParameters params = new WsJobParameters(new JFrame(), store, set,
- args);
- if (params.showRunDialog())
+ if (!withDefaults)
{
- new Thread(new HMMSearch(this, params.getJobParams()))
- .start();
+ WsParamSetI set = new HMMERPreset();
+ ParamDatastoreI store = HMMERParamStore.forSearch();
+ WsJobParameters params = new WsJobParameters(new JFrame(), store, set,
+ args);
+ if (params.showRunDialog())
+ {
+ args = params.getJobParams();
+ }
+ else
+ {
+ return; // user cancelled
+ }
}
+ new Thread(new HMMSearch(this, args)).start();
alignPanel.repaint();
}
- @Override
- public void hmmBuildRun_actionPerformed()
- {
- if (!alignmentIsSufficient(1))
- {
- return;
- }
- new Thread(new HMMBuild(this, null))
- .start();
- }
-
- @Override
- public void hmmAlignRun_actionPerformed()
- {
- if (!(checkForHMM() && alignmentIsSufficient(2)))
- {
- return;
- }
- new Thread(new HMMAlign(this, null)).start();
- }
-
- @Override
- public void hmmSearchRun_actionPerformed()
- {
- if (!checkForHMM())
- {
- return;
- }
- new Thread(new HMMSearch(this, null)).start();
- }
-
/**
* Checks if the frame has a selected hidden Markov model
*
@Override
public void actionPerformed(ActionEvent e)
{
- hmmBuildRun_actionPerformed();
+ hmmBuild_actionPerformed(true);
}
});
hmmBuildSettings.setText(
@Override
public void actionPerformed(ActionEvent e)
{
- hmmBuildSettings_actionPerformed();
+ hmmBuild_actionPerformed(false);
}
});
hmmAlignRun.setText(MessageManager.formatMessage(
@Override
public void actionPerformed(ActionEvent e)
{
- hmmAlignRun_actionPerformed();
+ hmmAlign_actionPerformed(true);
}
});
hmmAlignSettings.setText(
@Override
public void actionPerformed(ActionEvent e)
{
- hmmAlignSettings_actionPerformed();
+ hmmAlign_actionPerformed(false);
}
});
hmmSearchRun.setText(MessageManager.formatMessage(
@Override
public void actionPerformed(ActionEvent e)
{
- hmmSearchRun_actionPerformed();
+ hmmSearch_actionPerformed(true);
+ }
+ });
+ hmmSearchSettings.setText(
+ MessageManager.getString("label.edit_settings_and_run"));
+ hmmSearchSettings.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hmmSearch_actionPerformed(false);
}
});
addDatabase.setText(MessageManager.getString("label.add_database"));
}
}
});
- hmmSearchSettings.setText(
- MessageManager.getString("label.edit_settings_and_run"));
- hmmSearchSettings.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- hmmSearchSettings_actionPerformed();
- }
- });
selectHighlighted.addActionListener(al);
JMenu tooltipSettingsMenu = new JMenu(
MessageManager.getString("label.sequence_id_tooltip"));
{
}
- protected void hmmBuildRun_actionPerformed()
+ protected void hmmBuild_actionPerformed(boolean withDefaults)
{
}
- protected void hmmSearchRun_actionPerformed()
+ protected void hmmSearch_actionPerformed(boolean withDefaults)
{
}
{
}
- protected void hmmAlignRun_actionPerformed()
- {
- }
-
- protected void hmmBuildSettings_actionPerformed()
- {
- }
-
- protected void hmmSearchSettings_actionPerformed()
- {
- }
-
- protected void hmmAlignSettings_actionPerformed()
+ protected void hmmAlign_actionPerformed(boolean withDefaults)
{
}