// Iterate over the property pairs to ensure values are set.
for (Iterator<PropertyPair> it = propertyPairs.iterator(); it.hasNext();) {
try {
PropertyPair theMorph = it.next();
String styleName = theMorph.end.getName();
Property start = theMorph.start;
Property end = theMorph.end;
if (start == null) {
// Attempt to get value from the DOM
start = new Property(styleName + ":"
+ StyleImplementation.getComputedStyle(effectElement, styleName));
}
// Now determine that type of change that is required.
ChangeInterface theChange;
if (StyleImplementation.isColour(start.toString())) {
// It's a colour change
theChange = new NChangeColorAction(start.getValue(), end.getValue());
determinedEffects.put(styleName, theChange);
theChange.setUp(effectElement, styleName, switchFrameNumber);
} else if (StyleImplementation.isClip(start.toString())) {
// It's a clip change
// Order of check moved due to Issue #108
theChange = new NChangeClipAction(start.getUnitizedValue(),
end.getUnitizedValue());
determinedEffects.put(styleName, theChange);
theChange.setUp(effectElement, styleName, switchFrameNumber);
} else if (StyleImplementation.isScalar(start.toString(),
start.getUnitizedValue())) {
// It's a scalar change
theChange = new NChangeScalarAction(start.getValue()
+ start.getUnits(), end.getValue() + end.getUnits());
determinedEffects.put(styleName, theChange);
theChange.setUp(effectElement, styleName, switchFrameNumber);
} else {
// Assume its a binary style
GWT.log(
"GWT-FX: Assuming that "
+ start.getName()
+ " is a style attribute that switches as a binary (have you forgotten to include the unit (px/pt/em etc)?",
null);
theChange = new NChangeBinaryAction(start.getValue(), end.getValue());
determinedEffects.put(styleName, theChange);
theChange.setUp(effectElement, styleName, switchFrameNumber);
}
} catch (RuntimeException e) {
GWT.log("MorphEffect CSS Style Exception", e);