- 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><p>Click to show brief description, and right click to open link for further information.</p></html>");
- showDesc.addMouseListener(this);
- }
- else
- {
- showDesc.setToolTipText("<html><p>Click to show brief description.</p></html>");
- }
- showDesc.addActionListener(new ActionListener()
- {
-
- public void actionPerformed(ActionEvent e)
- {
- descisvisible = !descisvisible;
- descPanel.setVisible(descisvisible);
- me.setPreferredSize(new Dimension(PARAM_WIDTH,
- (descisvisible) ? PARAM_HEIGHT : PARAM_CLOSEDHEIGHT));
- me.validate();
- pmlayout.refreshParamLayout();
- }
- });
- string.setWrapStyleWord(true);
- string.setLineWrap(true);
- string.setColumns(32);
- string.setText(parm.getDescription());
- JPanel firstrow = new JPanel();
- firstrow.setLayout(null);
- controlPanel.setLayout(new BorderLayout());
- controlPanel.setBounds(new Rectangle(39, 10, PARAM_WIDTH - 70,
- PARAM_CLOSEDHEIGHT - 50));
- showDesc.setBounds(new Rectangle(10, 10, 16, 16));
- firstrow.add(showDesc);
- firstrow.add(controlPanel);
- firstrow.setBounds(new Rectangle(10, 20, PARAM_WIDTH - 30,
- PARAM_CLOSEDHEIGHT - 30));
- add(firstrow);
- validator = parm.getValidValue();
- parameter = parm;
- if (validator != null)
- {
- integ = validator.getType() == Type.Integer;
- }
- else
- {
- if (parameter.getPossibleValues() != null)
- {
- choice = true;
- }
- }
- updateControls(parm);
- descPanel.setBounds(new Rectangle(10, PARAM_CLOSEDHEIGHT,
- PARAM_WIDTH - 20, PARAM_HEIGHT - PARAM_CLOSEDHEIGHT - 5));
- add(descPanel);
- validate();
- }
-
- public void init()
- {
- // reset the widget's initial value.
- lastVal = null;
- }
-
- boolean adjusting = false;
-
- ParameterI parameter;
-
- JComboBox choicebox;
-
- public int getBoxHeight()
- {
- return (descisvisible ? PARAM_HEIGHT : PARAM_CLOSEDHEIGHT);
- }
-
- public void updateControls(ParameterI parm)
- {
- adjusting = true;
- boolean init = (choicebox == null && valueField == null);
- float fVal = 0f;
- int iVal = 0;
- if (init)
+ // 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())