/** * 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); }
/** * 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); }
/** * 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); }
(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);
(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);
(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);
accLengthList.lengthTypes[i], accLengthList.percentageInterpretation)) { newLengthValue = target.svgToUserSpace (newLengthValue, newLengthType, percentageInterpretation); newLengthType = SVGLength.SVG_LENGTHTYPE_NUMBER; if (hasTo) { toV = to.target.svgToUserSpace (toLengthList.lengthValues[i], toLengthList.lengthTypes[i], accV = accumulation.target.svgToUserSpace (accLengthList.lengthValues[i], accLengthList.lengthTypes[i],
accLengthList.lengthTypes[i], accLengthList.percentageInterpretation)) { newLengthValue = target.svgToUserSpace (newLengthValue, newLengthType, percentageInterpretation); newLengthType = SVGLength.SVG_LENGTHTYPE_NUMBER; if (hasTo) { toV = to.target.svgToUserSpace (toLengthList.lengthValues[i], toLengthList.lengthTypes[i], accV = accumulation.target.svgToUserSpace (accLengthList.lengthValues[i], accLengthList.lengthTypes[i],
accLengthList.lengthTypes[i], accLengthList.percentageInterpretation)) { newLengthValue = target.svgToUserSpace (newLengthValue, newLengthType, percentageInterpretation); newLengthType = SVGLength.SVG_LENGTHTYPE_NUMBER; if (hasTo) { toV = to.target.svgToUserSpace (toLengthList.lengthValues[i], toLengthList.lengthTypes[i], accV = accumulation.target.svgToUserSpace (accLengthList.lengthValues[i], accLengthList.lengthTypes[i],
protected AnimatableValue[] parseValues(String s) { try { LengthPairListParser lplp = new LengthPairListParser(); LengthArrayProducer lap = new LengthArrayProducer(); lplp.setLengthListHandler(lap); lplp.parse(s); short[] types = lap.getLengthTypeArray(); float[] values = lap.getLengthValueArray(); AnimatableValue[] ret = new AnimatableValue[types.length / 2]; for (int i = 0; i < types.length; i += 2) { float x = animationTarget.svgToUserSpace (values[i], types[i], AnimationTarget.PERCENTAGE_VIEWPORT_WIDTH); float y = animationTarget.svgToUserSpace (values[i + 1], types[i + 1], AnimationTarget.PERCENTAGE_VIEWPORT_HEIGHT); ret[i / 2] = new AnimatableMotionPointValue(animationTarget, x, y, 0); } return ret; } catch (ParseException pEx ) { throw new BridgeException (ctx, element, pEx, ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED, new Object[] { SVG_VALUES_ATTRIBUTE, s }); } }
protected AnimatableValue[] parseValues(String s) { try { LengthPairListParser lplp = new LengthPairListParser(); LengthArrayProducer lap = new LengthArrayProducer(); lplp.setLengthListHandler(lap); lplp.parse(s); short[] types = lap.getLengthTypeArray(); float[] values = lap.getLengthValueArray(); AnimatableValue[] ret = new AnimatableValue[types.length / 2]; for (int i = 0; i < types.length; i += 2) { float x = animationTarget.svgToUserSpace (values[i], types[i], AnimationTarget.PERCENTAGE_VIEWPORT_WIDTH); float y = animationTarget.svgToUserSpace (values[i + 1], types[i + 1], AnimationTarget.PERCENTAGE_VIEWPORT_HEIGHT); ret[i / 2] = new AnimatableMotionPointValue(animationTarget, x, y, 0); } return ret; } catch (ParseException pEx ) { throw new BridgeException (ctx, element, pEx, ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED, new Object[] { SVG_VALUES_ATTRIBUTE, s }); } }
protected AnimatableValue[] parseValues(String s) { try { LengthPairListParser lplp = new LengthPairListParser(); LengthArrayProducer lap = new LengthArrayProducer(); lplp.setLengthListHandler(lap); lplp.parse(s); short[] types = lap.getLengthTypeArray(); float[] values = lap.getLengthValueArray(); AnimatableValue[] ret = new AnimatableValue[types.length / 2]; for (int i = 0; i < types.length; i += 2) { float x = animationTarget.svgToUserSpace (values[i], types[i], AnimationTarget.PERCENTAGE_VIEWPORT_WIDTH); float y = animationTarget.svgToUserSpace (values[i + 1], types[i + 1], AnimationTarget.PERCENTAGE_VIEWPORT_HEIGHT); ret[i / 2] = new AnimatableMotionPointValue(animationTarget, x, y, 0); } return ret; } catch (ParseException pEx ) { throw new BridgeException (ctx, element, pEx, ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED, new Object[] { SVG_VALUES_ATTRIBUTE, s }); } }