super.restore(node);
undoSupport.restoreStart();
op.changeBatchStarted();
Set keys;
if (node.hasChild(SliderTag)) {
XmlNode sliderNode = node.getChild(SliderTag);
keys = sliders.keySet();
for (Iterator i=keys.iterator(); i.hasNext(); ) {
String key = (String) i.next();
GenericSlider slider = (GenericSlider) sliders.get(key);
try {
int version = sliderNode.getVersion();
if ((version >= 3) || (version < 0)) {
double value = Double.parseDouble(
sliderNode.getAttribute(key)
);
slider.setConfiguredValue(value);
}
else {
int value = Integer.parseInt(sliderNode.getAttribute(key));
slider.setSliderPosition(value);
}
}
catch (NumberFormatException e) {
throw new XMLException(
"Value at attribute \"" + key + "\" is not a number", e
);
}
}
}
if (node.hasChild(CheckBoxTag)) {
XmlNode checkboxNode = node.getChild(CheckBoxTag);
keys = checkboxes.keySet();
for (Iterator i=keys.iterator(); i.hasNext(); ) {
String key = (String) i.next();
JCheckBox checkbox = (JCheckBox) checkboxes.get(key);
String value = checkboxNode.getAttribute(key);
checkbox.setSelected(value.equals("True"));
}
}
if (node.hasChild(ChoiceTag)) {
XmlNode choiceNode = node.getChild(ChoiceTag);
keys = choices.keySet();
for (Iterator i=keys.iterator(); i.hasNext(); ) {
String key = (String) i.next();
JComboBox choice = (JComboBox) choices.get(key);
String value = choiceNode.getAttribute(key);
choice.setSelectedItem(value);
}
}
op.changeBatchEnded();
undoSupport.restoreEnd();