/** * Returns a zero value of this AnimatableValue's type. */ public AnimatableValue getZeroValue() { float[] vs = new float[lengthValues.length]; return new AnimatableLengthListValue (target, lengthTypes, vs, percentageInterpretation); }
/** * Returns the CSS text representation of the value. * Length lists can never be used for CSS properties. */ public String getCssText() { StringBuffer sb = new StringBuffer(); if (lengthValues.length > 0) { sb.append(formatNumber(lengthValues[0])); sb.append(AnimatableLengthValue.UNITS[lengthTypes[0] - 1]); } for (int i = 1; i < lengthValues.length; i++) { sb.append(','); sb.append(formatNumber(lengthValues[i])); sb.append(AnimatableLengthValue.UNITS[lengthTypes[i] - 1]); } return sb.toString(); } }
/** * Updates the animated value with the given {@link AnimatableValue}. */ protected void updateAnimatedValue(AnimatableValue val) { if (val == null) { hasAnimVal = false; } else { hasAnimVal = true; AnimatableLengthListValue animLengths = (AnimatableLengthListValue) val; if (animVal == null) { animVal = new AnimSVGLengthList(); } animVal.setAnimatedValue(animLengths.getLengthTypes(), animLengths.getLengthValues()); } fireAnimatedAttributeListeners(); }
/** * Updates the animated value with the given {@link AnimatableValue}. */ protected void updateAnimatedValue(AnimatableValue val) { if (val == null) { hasAnimVal = false; } else { hasAnimVal = true; AnimatableLengthListValue animLengths = (AnimatableLengthListValue) val; if (animVal == null) { animVal = new AnimSVGLengthList(); } animVal.setAnimatedValue(animLengths.getLengthTypes(), animLengths.getLengthValues()); } fireAnimatedAttributeListeners(); }
/** * Returns a zero value of this AnimatableValue's type. */ public AnimatableValue getZeroValue() { float[] vs = new float[lengthValues.length]; return new AnimatableLengthListValue (target, lengthTypes, vs, percentageInterpretation); }
/** * Updates the animated value with the given {@link AnimatableValue}. */ protected void updateAnimatedValue(AnimatableValue val) { if (val == null) { hasAnimVal = false; } else { hasAnimVal = true; AnimatableLengthListValue animLengths = (AnimatableLengthListValue) val; if (animVal == null) { animVal = new AnimSVGLengthList(); } animVal.setAnimatedValue(animLengths.getLengthTypes(), animLengths.getLengthValues()); } fireAnimatedAttributeListeners(); }
/** * Returns the CSS text representation of the value. * Length lists can never be used for CSS properties. */ public String getCssText() { StringBuffer sb = new StringBuffer(); if (lengthValues.length > 0) { sb.append(formatNumber(lengthValues[0])); sb.append(AnimatableLengthValue.UNITS[lengthTypes[0] - 1]); } for (int i = 1; i < lengthValues.length; i++) { sb.append(','); sb.append(formatNumber(lengthValues[i])); sb.append(AnimatableLengthValue.UNITS[lengthTypes[i] - 1]); } return sb.toString(); } }
/** * Returns a zero value of this AnimatableValue's type. */ public AnimatableValue getZeroValue() { float[] vs = new float[lengthValues.length]; return new AnimatableLengthListValue (target, lengthTypes, vs, percentageInterpretation); }
/** * Returns the CSS text representation of the value. * Length lists can never be used for CSS properties. */ public String getCssText() { StringBuffer sb = new StringBuffer(); if (lengthValues.length > 0) { sb.append(formatNumber(lengthValues[0])); sb.append(AnimatableLengthValue.UNITS[lengthTypes[0] - 1]); } for (int i = 1; i < lengthValues.length; i++) { sb.append(','); sb.append(formatNumber(lengthValues[i])); sb.append(AnimatableLengthValue.UNITS[lengthTypes[i] - 1]); } return sb.toString(); } }
/** * 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; } }
/** * 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; } }
/** * 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; } }
/** * Returns the base value of the attribute as an {@link AnimatableValue}. */ public AnimatableValue getUnderlyingValue(AnimationTarget target) { SVGLengthList ll = getBaseVal(); int n = ll.getNumberOfItems(); short[] types = new short[n]; float[] values = new float[n]; for (int i = 0; i < n; i++) { SVGLength l = ll.getItem(i); types[i] = l.getUnitType(); values[i] = l.getValueInSpecifiedUnits(); } return new AnimatableLengthListValue (target, types, values, target.getPercentageInterpretation (getNamespaceURI(), getLocalName(), false)); }
/** * Returns the base value of the attribute as an {@link AnimatableValue}. */ public AnimatableValue getUnderlyingValue(AnimationTarget target) { SVGLengthList ll = getBaseVal(); int n = ll.getNumberOfItems(); short[] types = new short[n]; float[] values = new float[n]; for (int i = 0; i < n; i++) { SVGLength l = ll.getItem(i); types[i] = l.getUnitType(); values[i] = l.getValueInSpecifiedUnits(); } return new AnimatableLengthListValue (target, types, values, target.getPercentageInterpretation (getNamespaceURI(), getLocalName(), false)); }
/** * Returns the base value of the attribute as an {@link AnimatableValue}. */ public AnimatableValue getUnderlyingValue(AnimationTarget target) { SVGLengthList ll = getBaseVal(); int n = ll.getNumberOfItems(); short[] types = new short[n]; float[] values = new float[n]; for (int i = 0; i < n; i++) { SVGLength l = ll.getItem(i); types[i] = l.getUnitType(); values[i] = l.getValueInSpecifiedUnits(); } return new AnimatableLengthListValue (target, types, values, target.getPercentageInterpretation (getNamespaceURI(), getLocalName(), false)); }
res = new AnimatableLengthListValue(target); res.lengthTypes = new short[len]; res.lengthValues = new float[len];
res = new AnimatableLengthListValue(target); res.lengthTypes = new short[len]; res.lengthValues = new float[len];
res = new AnimatableLengthListValue(target); res.lengthTypes = new short[len]; res.lengthValues = new float[len];