try {
double doubleVal = Double.parseDouble(valStr);
String units = element.getAttributeValue("units");
ValueContainer container =
(ValueContainer) findObject(ValueContainer.class);
AngleValue value = definitionsFactory.createAngleValue();
value.setAngle(doubleVal);
value.setUnits(units);
container.addValue(value);
} catch (NumberFormatException nfe) {
System.out.println("Invalid angle: '" + valStr + "'");
}
} else if (name.equals("stringValue")) {
ValueContainer container =
(ValueContainer) findObject(ValueContainer.class);
StringValue value = definitionsFactory.createStringValue();
value.setString(element.getText());
container.addValue(value);
} else if (name.equals("colorValue")) {
ValueContainer container =
(ValueContainer) findObject(ValueContainer.class);
ColorValue value = definitionsFactory.createColorValue();
value.setColorName(element.getText());
container.addValue(value);
} else if (name.equals("inheritValue")) {
ValueContainer container =
(ValueContainer) findObject(ValueContainer.class);
InheritValue value = definitionsFactory.createInheritValue();
container.addValue(value);
} else if (name.equals("percentageValue")) {
String valStr = element.getText();
try {
double percentVal = Double.parseDouble(valStr);
PercentageValue value =
definitionsFactory.createPercentageValue();
value.setPercentage(percentVal);
ValueContainer container =
(ValueContainer) findObject(ValueContainer.class);
container.addValue(value);
} catch (NumberFormatException nfe) {
System.out.println("Invalid percentage: '" + valStr + "'");
}
} else if (name.equals("timeValue")) {
String valStr = element.getText();
try {
double doubleVal = Double.parseDouble(valStr);
String units = element.getAttributeValue("units");
ValueContainer container =
(ValueContainer) findObject(ValueContainer.class);
TimeValue value = definitionsFactory.createTimeValue();
value.setTime(doubleVal);
value.setUnits(units);
container.addValue(value);
} catch (NumberFormatException nfe) {
System.out.println("Invalid time: '" + valStr + "'");
}
} else if (name.equals("pairValue")) {
PairValueContainer pair = new PairValueContainer();
pushObject(pair);
processThemePropertyChildren(element);
popObject();
PairValue value = definitionsFactory.createPairValue();
value.setFirst(pair.getFirst());
value.setSecond(pair.getSecond());
ValueContainer container =
(ValueContainer) findObject(ValueContainer.class);
container.addValue(value);
} else if (name.equals("listValue")) {
ListValueContainer pair = new ListValueContainer();
pushObject(pair);
processThemePropertyChildren(element);
popObject();
ListValue value = definitionsFactory.createListValue();
Value next = null;
while((next = pair.getNext())!=null){
value.setNext(next);
}
ValueContainer container =
(ValueContainer) findObject(ValueContainer.class);
container.addValue(value);
} else if (name.equals("frequencyValue")) {
String valStr = element.getText();
try {
double doubleVal = Double.parseDouble(valStr);
String units = element.getAttributeValue("units");
ValueContainer container =
(ValueContainer) findObject(ValueContainer.class);
FrequencyValue value = definitionsFactory.createFrequencyValue();
value.setNumber(doubleVal);
value.setUnits(units);
container.addValue(value);
} catch (NumberFormatException nfe) {
System.out.println("Invalid frequency: '" + valStr + "'");
}
} else if (name.equals("fractionValue")) {
PairValueContainer pair = new PairValueContainer();
pushObject(pair);
processThemePropertyChildren(element);
popObject();
FractionValue value = definitionsFactory.createFractionValue();
value.setNumerator(pair.getFirst());
value.setDenominator(pair.getSecond());
ValueContainer container =
(ValueContainer) findObject(ValueContainer.class);
container.addValue(value);
} else if (name.equals("keywordRef")) {