/** * Returns the parsed 'calcMode' attribute from the animation element. */ protected int parseCalcMode() { // If the attribute being animated has only non-additive values, take // the animation as having calcMode="discrete". if (animationType == AnimationEngine.ANIM_TYPE_CSS && !targetElement.isPropertyAdditive(attributeLocalName) || animationType == AnimationEngine.ANIM_TYPE_XML && !targetElement.isAttributeAdditive(attributeNamespaceURI, attributeLocalName)) { return SimpleAnimation.CALC_MODE_DISCRETE; } String calcModeString = element.getAttributeNS(null, SVG_CALC_MODE_ATTRIBUTE); if (calcModeString.length() == 0) { return getDefaultCalcMode(); } else if (calcModeString.equals(SMILConstants.SMIL_LINEAR_VALUE)) { return SimpleAnimation.CALC_MODE_LINEAR; } else if (calcModeString.equals(SMILConstants.SMIL_DISCRETE_VALUE)) { return SimpleAnimation.CALC_MODE_DISCRETE; } else if (calcModeString.equals(SMILConstants.SMIL_PACED_VALUE)) { return SimpleAnimation.CALC_MODE_PACED; } else if (calcModeString.equals(SMILConstants.SMIL_SPLINE_VALUE)) { return SimpleAnimation.CALC_MODE_SPLINE; } throw new BridgeException (ctx, element, ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED, new Object[] { SVG_CALC_MODE_ATTRIBUTE, calcModeString }); }
/** * Returns the parsed 'calcMode' attribute from the animation element. */ protected int parseCalcMode() { // If the attribute being animated has only non-additive values, take // the animation as having calcMode="discrete". if (animationType == AnimationEngine.ANIM_TYPE_CSS && !targetElement.isPropertyAdditive(attributeLocalName) || animationType == AnimationEngine.ANIM_TYPE_XML && !targetElement.isAttributeAdditive(attributeNamespaceURI, attributeLocalName)) { return SimpleAnimation.CALC_MODE_DISCRETE; } String calcModeString = element.getAttributeNS(null, SVG_CALC_MODE_ATTRIBUTE); if (calcModeString.length() == 0) { return getDefaultCalcMode(); } else if (calcModeString.equals(SMILConstants.SMIL_LINEAR_VALUE)) { return SimpleAnimation.CALC_MODE_LINEAR; } else if (calcModeString.equals(SMILConstants.SMIL_DISCRETE_VALUE)) { return SimpleAnimation.CALC_MODE_DISCRETE; } else if (calcModeString.equals(SMILConstants.SMIL_PACED_VALUE)) { return SimpleAnimation.CALC_MODE_PACED; } else if (calcModeString.equals(SMILConstants.SMIL_SPLINE_VALUE)) { return SimpleAnimation.CALC_MODE_SPLINE; } throw new BridgeException (ctx, element, ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED, new Object[] { SVG_CALC_MODE_ATTRIBUTE, calcModeString }); }
/** * Returns the parsed 'calcMode' attribute from the animation element. */ protected int parseCalcMode() { // If the attribute being animated has only non-additive values, take // the animation as having calcMode="discrete". if (animationType == AnimationEngine.ANIM_TYPE_CSS && !targetElement.isPropertyAdditive(attributeLocalName) || animationType == AnimationEngine.ANIM_TYPE_XML && !targetElement.isAttributeAdditive(attributeNamespaceURI, attributeLocalName)) { return SimpleAnimation.CALC_MODE_DISCRETE; } String calcModeString = element.getAttributeNS(null, SVG_CALC_MODE_ATTRIBUTE); if (calcModeString.length() == 0) { return getDefaultCalcMode(); } else if (calcModeString.equals(SMILConstants.SMIL_LINEAR_VALUE)) { return SimpleAnimation.CALC_MODE_LINEAR; } else if (calcModeString.equals(SMILConstants.SMIL_DISCRETE_VALUE)) { return SimpleAnimation.CALC_MODE_DISCRETE; } else if (calcModeString.equals(SMILConstants.SMIL_PACED_VALUE)) { return SimpleAnimation.CALC_MODE_PACED; } else if (calcModeString.equals(SMILConstants.SMIL_SPLINE_VALUE)) { return SimpleAnimation.CALC_MODE_SPLINE; } throw new BridgeException (ctx, element, ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED, new Object[] { SVG_CALC_MODE_ATTRIBUTE, calcModeString }); }