*/
protected class AnimatableAngleValueFactory extends CSSValueFactory {
protected AnimatableValue createAnimatableValue(AnimationTarget target,
String pn, Value v) {
FloatValue fv = (FloatValue) v;
short unit;
switch (fv.getPrimitiveType()) {
case CSSPrimitiveValue.CSS_NUMBER:
case CSSPrimitiveValue.CSS_DEG:
unit = SVGAngle.SVG_ANGLETYPE_DEG;
break;
case CSSPrimitiveValue.CSS_RAD:
unit = SVGAngle.SVG_ANGLETYPE_RAD;
break;
case CSSPrimitiveValue.CSS_GRAD:
unit = SVGAngle.SVG_ANGLETYPE_GRAD;
break;
default:
// XXX Do something better than returning null.
return null;
}
return new AnimatableAngleValue(target, fv.getFloatValue(), unit);
}