/** * Creates a new AnimatableValue from a string. */ public AnimatableValue createValue(AnimationTarget target, String ns, String ln, boolean isCSS, String s) { short pcInterp = target.getPercentageInterpretation(ns, ln, isCSS); try { parser.parse(s); return new AnimatableLengthValue (target, type, value, pcInterp); } catch (ParseException e) { // XXX Do something better than returning null. return null; } }
/** * Returns the absolute distance between this value and the specified other * value. */ public float distanceTo(AnimatableValue other) { AnimatableLengthValue o = (AnimatableLengthValue) other; float v1 = target.svgToUserSpace(lengthValue, lengthType, percentageInterpretation); float v2 = target.svgToUserSpace(o.lengthValue, o.lengthType, o.percentageInterpretation); return Math.abs(v1 - v2); }
protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { Paint p = PaintServer.convertPaint (target.getElement(), null, v, 1.0f, ctx); if (p instanceof Color) { Color c = (Color) p; return new AnimatableColorValue(target, c.getRed() / 255f, c.getGreen() / 255f, c.getBlue() / 255f); } // XXX Indicate that the parsed value wasn't a Color? return null; } }
target.addTargetListener(namespaceURI, localName, false, targetListener); sandwich.listenerRegistered = true; } else if (!usesUnderlying && sandwich.listenerRegistered) { target.removeTargetListener(namespaceURI, localName, false, targetListener); sandwich.listenerRegistered = false; target.updateAttributeValue(namespaceURI, localName, av); sandwich.shouldUpdate = false; target.addTargetListener(null, propertyName, true, targetListener); sandwich.listenerRegistered = true; } else if (!usesUnderlying && sandwich.listenerRegistered) { target.removeTargetListener(null, propertyName, true, targetListener); sandwich.listenerRegistered = false; target.updatePropertyValue(propertyName, null); target.updatePropertyValue(propertyName, av); anim.isDirty = false; target.updateOtherValue(type, av); sandwich.shouldUpdate = false;
Sandwich sandwich = (Sandwich) e2.getValue(); if (sandwich.listenerRegistered) { target.removeTargetListener(namespaceURI, localName, false, targetListener); Sandwich sandwich = (Sandwich) e2.getValue(); if (sandwich.listenerRegistered) { target.removeTargetListener(null, propertyName, true, targetListener);
/** * Returns the underlying value of the animated attribute. Used for * composition of additive animations. This should be overridden in * descendant classes that are for 'other' animations. */ public AnimatableValue getUnderlyingValue() { if (animationType == AnimationEngine.ANIM_TYPE_XML) { return animationTarget.getUnderlyingValue(attributeNamespaceURI, attributeLocalName); } else { return eng.getUnderlyingCSSValue(element, animationTarget, attributeLocalName); } }
target.addTargetListener(namespaceURI, localName, false, targetListener); sandwich.listenerRegistered = true; } else if (!usesUnderlying && sandwich.listenerRegistered) { target.removeTargetListener(namespaceURI, localName, false, targetListener); sandwich.listenerRegistered = false; target.updateAttributeValue(namespaceURI, localName, av); sandwich.shouldUpdate = false; target.addTargetListener(null, propertyName, true, targetListener); sandwich.listenerRegistered = true; } else if (!usesUnderlying && sandwich.listenerRegistered) { target.removeTargetListener(null, propertyName, true, targetListener); sandwich.listenerRegistered = false; target.updatePropertyValue(propertyName, null); target.updatePropertyValue(propertyName, av); anim.isDirty = false; target.updateOtherValue(type, av); sandwich.shouldUpdate = false;
Sandwich sandwich = (Sandwich) e2.getValue(); if (sandwich.listenerRegistered) { target.removeTargetListener(namespaceURI, localName, false, targetListener); Sandwich sandwich = (Sandwich) e2.getValue(); if (sandwich.listenerRegistered) { target.removeTargetListener(null, propertyName, true, targetListener);
/** * Returns the underlying value of the animated attribute. Used for * composition of additive animations. This should be overridden in * descendant classes that are for 'other' animations. */ public AnimatableValue getUnderlyingValue() { if (animationType == AnimationEngine.ANIM_TYPE_XML) { return animationTarget.getUnderlyingValue(attributeNamespaceURI, attributeLocalName); } else { return eng.getUnderlyingCSSValue(element, animationTarget, attributeLocalName); } }
target.addTargetListener(namespaceURI, localName, false, targetListener); sandwich.listenerRegistered = true; } else if (!usesUnderlying && sandwich.listenerRegistered) { target.removeTargetListener(namespaceURI, localName, false, targetListener); sandwich.listenerRegistered = false; target.updateAttributeValue(namespaceURI, localName, av); sandwich.shouldUpdate = false; target.addTargetListener(null, propertyName, true, targetListener); sandwich.listenerRegistered = true; } else if (!usesUnderlying && sandwich.listenerRegistered) { target.removeTargetListener(null, propertyName, true, targetListener); sandwich.listenerRegistered = false; target.updatePropertyValue(propertyName, null); target.updatePropertyValue(propertyName, av); anim.isDirty = false; target.updateOtherValue(type, av); sandwich.shouldUpdate = false;
/** * Creates a new AnimatableValue from a string. */ public AnimatableValue createValue(AnimationTarget target, String ns, String ln, boolean isCSS, String s) { short pcInterp = target.getPercentageInterpretation(ns, ln, isCSS); try { parser.parse(s); return new AnimatableLengthValue (target, type, value, pcInterp); } catch (ParseException e) { // XXX Do something better than returning null. return null; } }
/** * Returns the absolute distance between this value and the specified other * value. */ public float distanceTo(AnimatableValue other) { AnimatableLengthValue o = (AnimatableLengthValue) other; float v1 = target.svgToUserSpace(lengthValue, lengthType, percentageInterpretation); float v2 = target.svgToUserSpace(o.lengthValue, o.lengthType, o.percentageInterpretation); return Math.abs(v1 - v2); }
protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { Paint p = PaintServer.convertPaint (target.getElement(), null, v, 1.0f, ctx); if (p instanceof Color) { Color c = (Color) p; return new AnimatableColorValue(target, c.getRed() / 255f, c.getGreen() / 255f, c.getBlue() / 255f); } // XXX Indicate that the parsed value wasn't a Color? return null; } }
Sandwich sandwich = (Sandwich) e2.getValue(); if (sandwich.listenerRegistered) { target.removeTargetListener(namespaceURI, localName, false, targetListener); Sandwich sandwich = (Sandwich) e2.getValue(); if (sandwich.listenerRegistered) { target.removeTargetListener(null, propertyName, true, targetListener);
/** * Returns the underlying value of the animated attribute. Used for * composition of additive animations. This should be overridden in * descendant classes that are for 'other' animations. */ public AnimatableValue getUnderlyingValue() { if (animationType == AnimationEngine.ANIM_TYPE_XML) { return animationTarget.getUnderlyingValue(attributeNamespaceURI, attributeLocalName); } else { return eng.getUnderlyingCSSValue(element, animationTarget, attributeLocalName); } }
/** * Creates a new AnimatableValue from a string. */ public AnimatableValue createValue(AnimationTarget target, String ns, String ln, boolean isCSS, String s) { short pcInterp = target.getPercentageInterpretation(ns, ln, isCSS); try { parser.parse(s); return new AnimatableLengthValue (target, type, value, pcInterp); } catch (ParseException e) { // XXX Do something better than returning null. return null; } }
/** * Returns the absolute distance between this value and the specified other * value. */ public float distanceTo(AnimatableValue other) { AnimatableLengthValue o = (AnimatableLengthValue) other; float v1 = target.svgToUserSpace(lengthValue, lengthType, percentageInterpretation); float v2 = target.svgToUserSpace(o.lengthValue, o.lengthType, o.percentageInterpretation); return Math.abs(v1 - v2); }
protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { Paint p = PaintServer.convertPaint (target.getElement(), null, v, 1.0f, ctx); if (p instanceof Color) { Color c = (Color) p; return new AnimatableColorValue(target, c.getRed() / 255f, c.getGreen() / 255f, c.getBlue() / 255f); } // XXX Indicate that the parsed value wasn't a Color? return null; } }
/** * Creates a new AnimatableValue from a string. */ public AnimatableValue createValue(AnimationTarget target, String ns, String ln, boolean isCSS, String s) { try { short pcInterp = target.getPercentageInterpretation (ns, ln, isCSS); parser.parse(s); return new AnimatableLengthListValue (target, producer.getLengthTypeArray(), producer.getLengthValueArray(), pcInterp); } catch (ParseException e) { // XXX Do something better than returning null. return null; } }
(res.lengthType, res.percentageInterpretation, toLength.lengthType, toLength.percentageInterpretation)) { res.lengthValue = target.svgToUserSpace (res.lengthValue, res.lengthType, res.percentageInterpretation); res.lengthType = SVGLength.SVG_LENGTHTYPE_NUMBER; toValue = toLength.target.svgToUserSpace (toLength.lengthValue, toLength.lengthType, toLength.percentageInterpretation); accLength.lengthType, accLength.percentageInterpretation)) { res.lengthValue = target.svgToUserSpace (res.lengthValue, res.lengthType, res.percentageInterpretation); res.lengthType = SVGLength.SVG_LENGTHTYPE_NUMBER; accValue = accLength.target.svgToUserSpace (accLength.lengthValue, accLength.lengthType, accLength.percentageInterpretation);