Examples of AnimatableMotionPointValue


Examples of org.apache.batik.anim.values.AnimatableMotionPointValue

                motionTransform = new AffineTransform();
            }
            if (val == null) {
                motionTransform.setToIdentity();
            } else {
                AnimatableMotionPointValue p = (AnimatableMotionPointValue) val;
                motionTransform.setToTranslation(p.getX(), p.getY());
                motionTransform.rotate(p.getAngle());
            }
            SVGOMDocument d = (SVGOMDocument) ownerDocument;
            d.getAnimatedAttributeListener().otherAnimationChanged(this, type);
        } else {
            super.updateOtherValue(type, val);
View Full Code Here

Examples of org.apache.batik.anim.values.AnimatableMotionPointValue

        if (path == null) {
            path = new ExtendedGeneralPath();
            if (values == null || values.length == 0) {
                if (from != null) {
                    AnimatableMotionPointValue fromPt = (AnimatableMotionPointValue) from;
                    float x = fromPt.getX();
                    float y = fromPt.getY();
                    path.moveTo(x, y);
                    if (to != null) {
                        AnimatableMotionPointValue toPt = (AnimatableMotionPointValue) to;
                        path.lineTo(toPt.getX(), toPt.getY());
                    } else if (by != null) {
                        AnimatableMotionPointValue byPt = (AnimatableMotionPointValue) by;
                        path.lineTo(x + byPt.getX(), y + byPt.getY());
                    } else {
                        throw timedElement.createException
                            ("values.to.by.path.missing",
                             new Object[] { null });
                    }
                } else {
                    if (to != null) {
                        AnimatableMotionPointValue unPt = (AnimatableMotionPointValue)
                            animatableElement.getUnderlyingValue();
                        AnimatableMotionPointValue toPt = (AnimatableMotionPointValue) to;
                        path.moveTo(unPt.getX(), unPt.getY());
                        path.lineTo(toPt.getX(), toPt.getY());
                        this.cumulative = false;
                    } else if (by != null) {
                        AnimatableMotionPointValue byPt = (AnimatableMotionPointValue) by;
                        path.moveTo(0, 0);
                        path.lineTo(byPt.getX(), byPt.getY());
                        this.additive = true;
                    } else {
                        throw timedElement.createException
                            ("values.to.by.path.missing",
                             new Object[] { null });
                    }
                }
            } else {
                AnimatableMotionPointValue pt = (AnimatableMotionPointValue) values[0];
                path.moveTo(pt.getX(), pt.getY());
                for (int i = 1; i < values.length; i++) {
                    pt = (AnimatableMotionPointValue) values[i];
                    path.lineTo(pt.getX(), pt.getY());
                }
            }
        }
        this.path = path;
        pathLength = new PathLength(path);
View Full Code Here

Examples of org.apache.batik.anim.values.AnimatableMotionPointValue

                    ang += Math.PI;
                }
            } else {
                ang = rotateAngle;
            }
            value = new AnimatableMotionPointValue(null, (float) p.getX(),
                                                   (float) p.getY(), ang);
        } else {
            Point2D p = pathLength.pointAtLength(pathLength.lengthOfPath());
            float ang;
            if (rotateAuto) {
                ang = pathLength.angleAtLength(pathLength.lengthOfPath());
                if (rotateAutoReverse) {
                    ang += Math.PI;
                }
            } else {
                ang = rotateAngle;
            }
            value = new AnimatableMotionPointValue(null, (float) p.getX(),
                                                   (float) p.getY(), ang);
        }
        if (cumulative) {
            Point2D p = pathLength.pointAtLength(pathLength.lengthOfPath());
            float ang;
            if (rotateAuto) {
                ang = pathLength.angleAtLength(pathLength.lengthOfPath());
                if (rotateAutoReverse) {
                    ang += Math.PI;
                }
            } else {
                ang = rotateAngle;
            }
            accumulation = new AnimatableMotionPointValue(null, (float) p.getX(),
                                                          (float) p.getY(), ang);
        } else {
            accumulation = null;
        }
View Full Code Here

Examples of org.apache.batik.anim.values.AnimatableMotionPointValue

            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,
View Full Code Here

Examples of org.apache.batik.anim.values.AnimatableMotionPointValue

    /**
     * Returns the underlying value of the animated attribute.  Used for
     * composition of additive animations.
     */
    public AnimatableValue getUnderlyingValue() {
        return new AnimatableMotionPointValue(animationTarget, 0f, 0f, 0f);
    }
View Full Code Here

Examples of org.apache.batik.anim.values.AnimatableMotionPointValue

                motionTransform = new AffineTransform();
            }
            if (val == null) {
                motionTransform.setToIdentity();
            } else {
                AnimatableMotionPointValue p = (AnimatableMotionPointValue) val;
                motionTransform.setToTranslation(p.getX(), p.getY());
                motionTransform.rotate(p.getAngle());
            }
            SVGOMDocument d = (SVGOMDocument) ownerDocument;
            d.getAnimatedAttributeListener().otherAnimationChanged(this, type);
        } else {
            super.updateOtherValue(type, val);
View Full Code Here

Examples of org.apache.batik.anim.values.AnimatableMotionPointValue

        if (path == null) {
            path = new ExtendedGeneralPath();
            if (values == null || values.length == 0) {
                if (from != null) {
                    AnimatableMotionPointValue fromPt = (AnimatableMotionPointValue) from;
                    float x = fromPt.getX();
                    float y = fromPt.getY();
                    path.moveTo(x, y);
                    if (to != null) {
                        AnimatableMotionPointValue toPt = (AnimatableMotionPointValue) to;
                        path.lineTo(toPt.getX(), toPt.getY());
                    } else if (by != null) {
                        AnimatableMotionPointValue byPt = (AnimatableMotionPointValue) by;
                        path.lineTo(x + byPt.getX(), y + byPt.getY());
                    } else {
                        throw timedElement.createException
                            ("values.to.by.path.missing",
                             new Object[] { null });
                    }
                } else {
                    if (to != null) {
                        AnimatableMotionPointValue unPt = (AnimatableMotionPointValue)
                            animatableElement.getUnderlyingValue();
                        AnimatableMotionPointValue toPt = (AnimatableMotionPointValue) to;
                        path.moveTo(unPt.getX(), unPt.getY());
                        path.lineTo(toPt.getX(), toPt.getY());
                        this.cumulative = false;
                    } else if (by != null) {
                        AnimatableMotionPointValue byPt = (AnimatableMotionPointValue) by;
                        path.moveTo(0, 0);
                        path.lineTo(byPt.getX(), byPt.getY());
                        this.additive = true;
                    } else {
                        throw timedElement.createException
                            ("values.to.by.path.missing",
                             new Object[] { null });
                    }
                }
            } else {
                AnimatableMotionPointValue pt = (AnimatableMotionPointValue) values[0];
                path.moveTo(pt.getX(), pt.getY());
                for (int i = 1; i < values.length; i++) {
                    pt = (AnimatableMotionPointValue) values[i];
                    path.lineTo(pt.getX(), pt.getY());
                }
            }
        }
        this.path = path;
        pathLength = new PathLength(path);
View Full Code Here

Examples of org.apache.batik.anim.values.AnimatableMotionPointValue

                    ang += Math.PI;
                }
            } else {
                ang = rotateAngle;
            }
            value = new AnimatableMotionPointValue(null, (float) p.getX(),
                                                   (float) p.getY(), ang);
        } else {
            Point2D p = pathLength.pointAtLength(pathLength.lengthOfPath());
            float ang;
            if (rotateAuto) {
                ang = pathLength.angleAtLength(pathLength.lengthOfPath());
                if (rotateAutoReverse) {
                    ang += Math.PI;
                }
            } else {
                ang = rotateAngle;
            }
            value = new AnimatableMotionPointValue(null, (float) p.getX(),
                                                   (float) p.getY(), ang);
        }
        if (cumulative) {
            Point2D p = pathLength.pointAtLength(pathLength.lengthOfPath());
            float ang;
            if (rotateAuto) {
                ang = pathLength.angleAtLength(pathLength.lengthOfPath());
                if (rotateAutoReverse) {
                    ang += Math.PI;
                }
            } else {
                ang = rotateAngle;
            }
            accumulation = new AnimatableMotionPointValue(null, (float) p.getX(),
                                                          (float) p.getY(), ang);
        } else {
            accumulation = null;
        }
View Full Code Here

Examples of org.apache.batik.anim.values.AnimatableMotionPointValue

                motionTransform = new AffineTransform();
            }
            if (val == null) {
                motionTransform.setToIdentity();
            } else {
                AnimatableMotionPointValue p = (AnimatableMotionPointValue) val;
                motionTransform.setToTranslation(p.getX(), p.getY());
                motionTransform.rotate(p.getAngle());
            }
            SVGOMDocument d = (SVGOMDocument) ownerDocument;
            d.getAnimatedAttributeListener().otherAnimationChanged(this, type);
        } else {
            super.updateOtherValue(type, val);
View Full Code Here

Examples of org.apache.batik.anim.values.AnimatableMotionPointValue

                motionTransform = new AffineTransform();
            }
            if (val == null) {
                motionTransform.setToIdentity();
            } else {
                AnimatableMotionPointValue p = (AnimatableMotionPointValue) val;
                motionTransform.setToTranslation(p.getX(), p.getY());
                motionTransform.rotate(p.getAngle());
            }
            SVGOMDocument d = (SVGOMDocument) ownerDocument;
            d.getAnimatedAttributeListener().otherAnimationChanged(this, type);
        } else {
            super.updateOtherValue(type, val);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.