use of org.jwildfire.create.tina.script.ScriptParam in project JWildfire by thargor6.
the class ScriptParamsForm method collectFieldValues.
private void collectFieldValues() {
params.clear();
for (Object control : namedControls) {
if (control instanceof JWFNumberField) {
JWFNumberField numberField = (JWFNumberField) control;
params.put(numberField.getName(), new ScriptParam(numberField.getDoubleValue()));
} else if (control instanceof JTextField) {
JTextField textField = (JTextField) control;
params.put(textField.getName(), new ScriptParam(textField.getText()));
} else if (control instanceof JComboBox) {
JComboBox comboBox = (JComboBox) control;
params.put(comboBox.getName(), new ScriptParam((String) comboBox.getSelectedItem()));
} else if (control instanceof JCheckBox) {
JCheckBox checkBox = (JCheckBox) control;
params.put(checkBox.getName(), new ScriptParam(checkBox.isSelected()));
} else {
throw new IllegalStateException(control.getClass().getName());
}
}
}
Aggregations