- ParamBox pb = paramSet.get(arg.getName());
- if (pb == null)
- {
- pb = new ParamBox(this, arg);
- paramSet.put(arg.getName(), pb);
- paramList.add(pb);
- }
- pb.init();
- // take the defaults from the parameter
- pb.updateControls(arg);
- }
-
- private void setParameter(ParameterI arg)
- {
- ParamBox pb = paramSet.get(arg.getName());
- if (pb == null)
- {
- addParameter(arg);
- }
- else
- {
- pb.updateControls(arg);
- }
-
- }
-
- private void selectOption(OptionI option, String string)
- {
- OptionBox cb = optSet.get(option.getName());
- if (cb == null)
- {
- cb = addOption(option);
- }
- cb.enabled.setSelected(string != null); // initial state for an option.
- if (string != null)
- {
- if (option.getPossibleValues().contains(string))
- {
- cb.val.setSelectedItem(string);
- }
- else
- {
- throw new Error("Invalid value " + string + " for option " + option);
- }
-
- }
- if (option.isRequired() && !cb.enabled.isSelected())
- {
- // TODO: indicate paramset is not valid.. option needs to be selected!
- }
- cb.setInitialValue();
- }
-
- Map<String, ParamBox> paramSet = new Hashtable<String, ParamBox>();
-
- public class ParamBox extends JPanel implements ChangeListener,
- ActionListener, MouseListener
- {
- JButton showDesc = new JButton();
-
- JTextArea string = new JTextArea();
-
- JScrollPane descPanel = new JScrollPane();
-
- JSlider slider = null;
-
- JTextField valueField = null;
-
- ValueConstrainI validator = null;
-
- JPanel settingPanel = new JPanel();
-
- JPanel controlPanel = new JPanel();
-
- boolean integ = false;
-
- boolean choice = false;
-
- boolean descisvisible = false;
-
- final WsJobParameters pmdialogbox;
-
- final URL finfo;
-
- public ParamBox(final WsJobParameters pmlayout, ParameterI parm)
- {
- pmdialogbox = pmlayout;
- setPreferredSize(new Dimension(PARAM_WIDTH, PARAM_CLOSEDHEIGHT));
- setBorder(new TitledBorder(parm.getName()));
- setLayout(null);
- showDesc.setFont(new Font("Verdana", Font.PLAIN, 6));
- showDesc.setText("+");
- string.setFont(new Font("Verdana", Font.PLAIN, 11));
- string.setBackground(getBackground());
- // string.setSize(new Dimension(PARAM_WIDTH, 80));
- string.setEditable(false);
- descPanel.getViewport().setView(string);
- // descPanel.setLocation(2,17);
- descPanel.setVisible(false);
- // string.setMinimumSize(new Dimension(140,80));
- // string.setMaximumSize(new Dimension(280,80));
- final ParamBox me = this;
- finfo = parm.getFurtherDetails();
- if (finfo != null)
- {
- showDesc.setToolTipText("<html>"+JvSwingUtils.wrapTooltip("Click to show brief description<br><img src=\"" + linkImageURL + "\"/> Right click for further information.")+"</html>");
- showDesc.addMouseListener(this);
- }
- else
- {
- showDesc.setToolTipText("<html>"+JvSwingUtils.wrapTooltip("Click to show brief description.")+"</html>");
- }
- showDesc.addActionListener(new ActionListener()
+ // optsAndparams.setPreferredSize(null);
+ FlowLayout fl = new FlowLayout(FlowLayout.LEFT);
+ int sep = fl.getVgap();
+ boolean fh = true;
+ int os = 0, s = jobOptions.getBorder().getBorderInsets(jobOptions).bottom
+ + jobOptions.getBorder().getBorderInsets(jobOptions).top
+ + 2
+ * sep;
+ /**
+ * final height for viewport
+ */
+ int finalh = s;
+ int panewidth = paramPane.getViewport().getSize().width - 120
+ - jobOptions.getBorder().getBorderInsets(jobOptions).left
+ + jobOptions.getBorder().getBorderInsets(jobOptions).right;
+
+ int w = 2
+ * fl.getHgap()
+ + (MAX_OPTWIDTH > OptsAndParamsPage.PARAM_WIDTH ? MAX_OPTWIDTH
+ : OptsAndParamsPage.PARAM_WIDTH);
+ int hgap = fl.getHgap(), cw = hgap;
+
+ if (opanp.getOptSet().size() > 0)
+ {
+
+ jobOptions.setLayout(new MigLayout("", "", ""));
+ jobOptions.removeAll();
+
+ for (OptionBox pbox : opanp.getOptSet().values())