paramPane.getViewport().setView(paramList);
jobParameters.add(paramPane, BorderLayout.NORTH);
// jobParameters.add(paramButtons, BorderLayout.SOUTH);
- settingsPanel.setLayout(new BorderLayout());
+ settingsPanel.setLayout(new GridLayout(2,1));
// settingsPanel.add(modified, BorderLayout.NORTH);
JPanel jobOptionsPanel = new JPanel();
+ jobOptionsPanel.setLayout(new BorderLayout());
jobOptionsPanel.setBorder(new TitledBorder("Options"));
jobOptionsPane.getViewport().setView(jobOptions);
- jobOptionsPanel.add(jobOptionsPane);
- settingsPanel.add(jobOptionsPanel, BorderLayout.NORTH);
- settingsPanel.add(jobParameters, BorderLayout.SOUTH);
+ jobOptionsPanel.add(jobOptionsPane, BorderLayout.CENTER);
+ settingsPanel.add(jobOptionsPanel);
+ settingsPanel.add(jobParameters);
setLayout(new BorderLayout());
// setPreferredSize(new Dimension(400, 600));
public class ParamBox extends JPanel implements ChangeListener,
ActionListener
{
- JCheckBox showDesc = new JCheckBox();
+ JButton showDesc = new JButton();
JTextArea string = new JTextArea();
JScrollPane descPanel = new JScrollPane();
ValueConstrain validator = null;
JPanel settingPanel = new JPanel();
+ JPanel controlPanel=new JPanel();
+
boolean integ = false;
boolean choice = false;
-
+ boolean descisvisible=false;
public ParamBox(final WsJobParameters pmlayout, Parameter parm)
{
- setLayout(new FlowLayout(FlowLayout.LEFT));
- setBorder(new TitledBorder(parm.getName()));
setPreferredSize(new Dimension(PARAM_WIDTH, PARAM_CLOSEDHEIGHT));
+ setBorder(new TitledBorder(parm.getName()));
+ setLayout(null);
+ showDesc.setFont(new Font("Verdana", Font.PLAIN, 11));
+ showDesc.setText("?");
string.setFont(new Font("Verdana", Font.PLAIN, 11));
string.setBackground(getBackground());
// string.setSize(new Dimension(PARAM_WIDTH, 80));
string.setEditable(false);
- showDesc.setText("Show Description");
- showDesc.setSelected(false);
- showDesc.setToolTipText(parm.getDescription());
- //showDesc.setLocation(2,2);
- descPanel.setPreferredSize(new Dimension(PARAM_WIDTH-20, 90));
descPanel.getViewport().setView(string);
//descPanel.setLocation(2,17);
descPanel.setVisible(false);
@Override
public void actionPerformed(ActionEvent e)
{
- boolean show = showDesc.isSelected();
- descPanel.setVisible(show);
- me.setPreferredSize(new Dimension(PARAM_WIDTH, (show) ? PARAM_HEIGHT : PARAM_CLOSEDHEIGHT));
+ descisvisible=!descisvisible;
+ descPanel.setVisible(descisvisible);
+ me.setPreferredSize(new Dimension(PARAM_WIDTH, (descisvisible) ? PARAM_HEIGHT : PARAM_CLOSEDHEIGHT));
me.validate();
pmlayout.refreshParamLayout();
}
string.setColumns(32);
string.setText(parm.getDescription());
// name.setToolTipText(parm.getDescription());
- add(showDesc);
+ 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)
}
}
updateControls(parm);
- add(descPanel); // , BorderLayout.NORTH);
+ descPanel.setBounds(new Rectangle(10,PARAM_CLOSEDHEIGHT+10, PARAM_WIDTH-20, PARAM_HEIGHT-PARAM_CLOSEDHEIGHT-30));
+ add(descPanel);
validate();
}
JComboBox choicebox;
public int getBoxHeight()
{
- return (showDesc.isSelected() ? PARAM_HEIGHT : PARAM_CLOSEDHEIGHT);
+ return (descisvisible ? PARAM_HEIGHT : PARAM_CLOSEDHEIGHT);
}
public void updateControls(Parameter parm)
{
{
choicebox = new JComboBox();
choicebox.addActionListener(this);
- add(choicebox);
+ controlPanel.add(choicebox,BorderLayout.CENTER);
}
else
{
slider.addChangeListener(this);
valueField = new JTextField();
valueField.addActionListener(this);
- valueField.setPreferredSize(new Dimension(80, 25));
- JPanel container = new JPanel();
- // container.setLayout(new FlowLayout());
- add(slider);// , BorderLayout.SOUTH);
- add(valueField);// ,BorderLayout.CENTER);
- // add(container, BorderLayout.EAST);
- // container.validate();
+ valueField.setPreferredSize(new Dimension(60, 25));
+ controlPanel.add(slider,BorderLayout.WEST);
+ controlPanel.add(valueField, BorderLayout.EAST);
}
}
Preset p = null;
try
{
- p = service.getPresets().getPresetByName(setname);
+ PresetManager prman = service.getPresets();
+ if (prman!=null)
+ {
+ p = prman.getPresetByName(setname);
+ }
} catch (Exception ex)
{
ex.printStackTrace();