import java.util.Collections;
import java.util.List;
import java.util.Objects;
-import java.util.concurrent.CompletionStage;
+
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.ToolTipManager;
import jalview.gui.AlignViewport;
import jalview.gui.JvSwingUtils;
import jalview.gui.WebserviceInfo;
-import jalview.gui.WsJobParameters;
import jalview.util.MessageManager;
import jalview.ws.params.ArgumentI;
-import jalview.ws.params.ParamDatastoreI;
-import jalview.ws.params.WsParamSetI;
import jalview.ws2.PollingTaskExecutor;
import jalview.ws2.operations.AlignmentOperation;
import jalview.ws2.operations.AlignmentWorker;
AlignmentView msa = frame.gatherSequencesForAlignment();
if (msa != null)
{
- openEditParamsDialog(operation.getParamStore(), null, null)
+ MenuEntryProviderI.openEditParamsDialog(operation.getParamStore(),
+ null, null)
.thenAcceptAsync((arguments) -> {
if (arguments != null)
{
}
}
- private CompletionStage<List<ArgumentI>> openEditParamsDialog(
- ParamDatastoreI paramStore, WsParamSetI preset,
- List<ArgumentI> arguments)
- {
- WsJobParameters jobParams;
- if (preset == null && arguments != null && arguments.size() > 0)
- jobParams = new WsJobParameters(paramStore, preset, arguments);
- else
- jobParams = new WsJobParameters(paramStore, preset, null);
- if (preset != null)
- {
- jobParams.setName(MessageManager.getString(
- "label.adjusting_parameters_for_calculation"));
- }
- var stage = jobParams.showRunDialog();
- return stage.thenApply((startJob) -> {
- if (startJob)
- {
- if (jobParams.getPreset() == null)
- {
- return jobParams.getJobParams();
- }
- else
- {
- return jobParams.getPreset().getArguments();
- }
- }
- else
- {
- return null;
- }
- });
- }
-
private void startWorker(AlignFrame frame, AlignmentView msa,
List<ArgumentI> arguments, boolean submitGaps)
{
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.concurrent.CompletionStage;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JMenu;
import javax.swing.event.MenuListener;
import jalview.gui.AlignFrame;
-import jalview.gui.WsJobParameters;
import jalview.util.MessageManager;
import jalview.ws.params.ArgumentI;
-import jalview.ws.params.ParamDatastoreI;
-import jalview.ws.params.WsParamSetI;
import jalview.ws2.operations.AnnotationOperation;
import jalview.ws2.operations.AnnotationWorker;
item.setToolTipText(MessageManager.getString(
"label.view_and_change_parameters_before_running_calculation"));
item.addActionListener((event) -> {
- openEditParamsDialog(operation.getParamStore(), null, null)
+ MenuEntryProviderI.openEditParamsDialog(operation.getParamStore(),
+ null, null)
.thenAcceptAsync((arguments) -> {
if (arguments != null)
{
_editItem = new JMenuItem(
String.format("Edit %s settings", calcName));
_editItem.addActionListener((event) -> {
- openEditParamsDialog(operation.getParamStore(), null, null)
+ MenuEntryProviderI.openEditParamsDialog(operation.getParamStore(),
+ null, null)
.thenAcceptAsync((args) -> {
if (arguments != null)
{
});
}
- private CompletionStage<List<ArgumentI>> openEditParamsDialog(
- ParamDatastoreI paramStore, WsParamSetI preset,
- List<ArgumentI> arguments)
- {
- WsJobParameters jobParams;
- if (preset == null && arguments != null && arguments.size() > 0)
- jobParams = new WsJobParameters(paramStore, preset, arguments);
- else
- jobParams = new WsJobParameters(paramStore, preset, null);
- if (preset != null)
- {
- jobParams.setName(MessageManager.getString(
- "label.adjusting_parameters_for_calculation"));
- }
- var stage = jobParams.showRunDialog();
- return stage.thenApply((startJob) -> {
- if (startJob)
- {
- if (jobParams.getPreset() == null)
- {
- return jobParams.getJobParams();
- }
- else
- {
- return jobParams.getPreset().getArguments();
- }
- }
- else
- {
- return null;
- }
- });
- }
-
private AnnotationWorker createWorker(List<ArgumentI> arguments, AlignFrame frame)
{
/* What is the purpose of AlignViewport and AlignmentViewPanel? */
package jalview.ws2.gui;
+import java.util.List;
+import java.util.concurrent.CompletionStage;
+
import javax.swing.JMenu;
import jalview.gui.AlignFrame;
+import jalview.gui.WsJobParameters;
+import jalview.util.MessageManager;
+import jalview.ws.params.ArgumentI;
+import jalview.ws.params.ParamDatastoreI;
+import jalview.ws.params.WsParamSetI;
/**
* Functional interface provided by {@link jalview.ws2.operations.Operation}
* current alignFrame
*/
public void buildMenu(JMenu parent, AlignFrame frame);
+
+ static CompletionStage<List<ArgumentI>> openEditParamsDialog(
+ ParamDatastoreI paramStore, WsParamSetI preset,
+ List<ArgumentI> arguments)
+ {
+ WsJobParameters jobParams;
+ if (preset == null && arguments != null && arguments.size() > 0)
+ jobParams = new WsJobParameters(paramStore, preset, arguments);
+ else
+ jobParams = new WsJobParameters(paramStore, preset, null);
+ if (preset != null)
+ {
+ jobParams.setName(MessageManager.getString(
+ "label.adjusting_parameters_for_calculation"));
+ }
+ var stage = jobParams.showRunDialog();
+ return stage.thenApply((startJob) -> {
+ if (startJob)
+ {
+ if (jobParams.getPreset() == null)
+ {
+ return jobParams.getJobParams();
+ }
+ else
+ {
+ return jobParams.getPreset().getArguments();
+ }
+ }
+ else
+ {
+ return null;
+ }
+ });
+ }
+
}