public Object getValue() {
if (btnDefault.getSelection())
return new SpinnerNumberModel();
else {
int index = cmbType.getSelectionIndex();
NumberType type = NumberType.getTypes()[index];
Number init = type.valueOf(spInit.getSelection());
Number min = null;
if (btnMin.getSelection()) {
min = type.valueOf(spMin.getSelection());
}
Number max = null;
if (btnMax.getSelection()) {
max = type.valueOf(spMax.getSelection());
}
Number size = type.valueOf(spStep.getSelection());
return new SpinnerNumberModel(init, (Comparable) min, (Comparable) max, size);
}
}