X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FWsJobParameters.java;h=42f2ddb5cf0440ab268522e94af8e55ae208e68d;hb=747167089ecf8d6afc70d417f5a20352e029bd95;hp=9164cc00131931cdb23a61c3d082a717105aab75;hpb=8a6fa9ea9900d0f106529c3f6283e7f9d76dd2cb;p=jalview.git
diff --git a/src/jalview/gui/WsJobParameters.java b/src/jalview/gui/WsJobParameters.java
index 9164cc0..42f2ddb 100644
--- a/src/jalview/gui/WsJobParameters.java
+++ b/src/jalview/gui/WsJobParameters.java
@@ -1,110 +1,70 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
* 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 .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.gui;
+import jalview.bin.Console;
+import jalview.gui.OptsAndParamsPage.OptionBox;
+import jalview.gui.OptsAndParamsPage.ParamBox;
+import jalview.util.MessageManager;
+import jalview.ws.api.UIinfo;
+import jalview.ws.params.ArgumentI;
+import jalview.ws.params.OptionI;
+import jalview.ws.params.ParamDatastoreI;
+import jalview.ws.params.ParameterI;
+import jalview.ws.params.WsParamSetI;
import java.awt.BorderLayout;
-import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.ContainerEvent;
-import java.awt.event.ContainerListener;
+import java.awt.event.HierarchyBoundsListener;
+import java.awt.event.HierarchyEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.awt.event.WindowStateListener;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.EventObject;
-import java.util.HashSet;
import java.util.Hashtable;
-import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Vector;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionStage;
-import javax.swing.InputVerifier;
import javax.swing.JButton;
-import javax.swing.JCheckBox;
import javax.swing.JComboBox;
-import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
import javax.swing.JPanel;
-import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
-import javax.swing.JSlider;
-import javax.swing.JSplitPane;
-import javax.swing.JTabbedPane;
-import javax.swing.JTable;
import javax.swing.JTextArea;
-import javax.swing.JTextField;
-import javax.swing.ListSelectionModel;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
import javax.swing.border.TitledBorder;
-import javax.swing.event.CellEditorListener;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
-import javax.swing.table.*;
-
-import compbio.metadata.Argument;
-import compbio.metadata.Option;
-import compbio.metadata.Parameter;
-import compbio.metadata.Preset;
-import compbio.metadata.PresetManager;
-import compbio.metadata.RunnerConfig;
-import compbio.metadata.ValueConstrain;
-import compbio.metadata.WrongParameterException;
-import compbio.metadata.ValueConstrain.Type;
-
-import jalview.util.jarInputStreamProvider;
-import jalview.ws.jws2.JabaParamStore;
-import jalview.ws.jws2.JabaPreset;
-import jalview.ws.jws2.Jws2Discoverer;
-import jalview.ws.jws2.ParameterUtils;
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
-import jalview.ws.jws2.dm.JabaOption;
-import jalview.ws.jws2.dm.JabaParameter;
-import jalview.ws.params.ArgumentI;
-import jalview.ws.params.OptionI;
-import jalview.ws.params.ParamDatastoreI;
-import jalview.ws.params.ParameterI;
-import jalview.ws.params.ValueConstrainI;
-import jalview.ws.params.WsParamSetI;
+
+import net.miginfocom.swing.MigLayout;
/**
* job parameter editing/browsing dialog box. User can browse existing settings
@@ -122,36 +82,40 @@ import jalview.ws.params.WsParamSetI;
*
*/
public class WsJobParameters extends JPanel implements ItemListener,
- ActionListener, DocumentListener
+ ActionListener, DocumentListener, OptsParametersContainerI
{
- URL linkImageURL = getClass().getResource("/images/link.gif");
+ private static final int PREFERRED_WIDTH = 540;
- private static final String SVC_DEF = "Defaults"; // this is the null
- // parameter set as shown to
- // user
+ private static final int DEFAULT_HEIGHT = 640;
- private static final int PARAM_WIDTH = 340, PARAM_HEIGHT = 150,
- PARAM_CLOSEDHEIGHT = 80;
+ // the default parameter set shown to the user
+ private static final String SVC_DEF = "Defaults";
- private static final int OPTSET_HEIGHT = 30;
+ private int maxOptWidth = 200;
- JPanel SetNamePanel = new JPanel();
+ // URL linkImageURL = getClass().getResource("/images/link.gif");
- JPanel setDetails = new JPanel();
+ // TODO ABSRACT FROM JABAWS CLASSES
- JSplitPane settingsPanel = new JSplitPane();
-
- JSplitPane jobPanel = new JSplitPane();
-
- boolean split = true;
-
- JTabbedPane tabpanels = new JTabbedPane();
+ // completion stage representing whether start was clicked
+ private final CompletableFuture completionStage = new CompletableFuture<>();
+
+ /**
+ * manager for options and parameters.
+ */
+ OptsAndParamsPage opanp;
- JPanel jobOptions = new JPanel();
+ /*
+ * panel containing job options
+ */
+ JPanel optionsPanel = new JPanel();
- JScrollPane jobOptionsPane = new JScrollPane();
+ /*
+ * panel containing job parameters
+ */
+ JPanel paramsPanel = new JPanel();
- JPanel jobParameters = new JPanel();
+ JPanel setNamePanel = new JPanel();
JButton createpref = new JButton();
@@ -161,179 +125,168 @@ public class WsJobParameters extends JPanel implements ItemListener,
JButton updatepref = new JButton();
- JButton startjob = new JButton();
-
- JButton canceljob = new JButton();
-
- JComboBox setName = new JComboBox();
+ JComboBox setName = new JComboBox<>();
JTextArea setDescr = new JTextArea();
JScrollPane paramPane = new JScrollPane();
+
+ JButton startjob = JvSwingUtils.makeButton(
+ MessageManager.getString("action.start_job"),
+ MessageManager.getString("label.start_job_current_settings"),
+ this::startjob_actionPerformed);
+ JButton canceljob = JvSwingUtils.makeButton(
+ MessageManager.getString("action.cancel_job"),
+ MessageManager.getString("label.cancel_job_close_dialog"),
+ this::canceljob_actionPerformed);
- JPanel paramList = new JPanel();
+ ParamDatastoreI paramStore;
- RunnerConfig serviceOptions;
+ // set true when 'Start Job' is clicked
+ boolean startJob = false;
- ParamDatastoreI paramStore;
+ JFrame frame = null;
- WsJobParameters(Jws2Instance service)
- {
- this(service, null);
- }
+ UIinfo service;
- public WsJobParameters(Jws2Instance service, WsParamSetI preset)
- {
- this(null, service, preset, null);
- }
+ /*
+ * list of service presets in the gui
+ */
+ Hashtable servicePresets = null;
- /**
- *
- * @param desktop
- * - if null, create new JFrame outside of desktop
- * @param service
- * @param preset
+ /*
+ * set if dialog is being set - so handlers will avoid spurious events
*/
- public WsJobParameters(JFrame parent, Jws2Instance service,
- WsParamSetI preset, List jobArgset)
+ boolean settingDialog = false;
+
+ private Hashtable