Package org.apache.flex.forks.batik.dom.svg

Examples of org.apache.flex.forks.batik.dom.svg.AbstractSVGAnimatedLength


        try {
            SVGOMRectElement re = (SVGOMRectElement) e;

            // 'x' attribute - default is 0
            AbstractSVGAnimatedLength _x =
                (AbstractSVGAnimatedLength) re.getX();
            float x = _x.getCheckedValue();

            // 'y' attribute - default is 0
            AbstractSVGAnimatedLength _y =
                (AbstractSVGAnimatedLength) re.getY();
            float y = _y.getCheckedValue();

            // 'width' attribute - required
            AbstractSVGAnimatedLength _width =
                (AbstractSVGAnimatedLength) re.getWidth();
            float w = _width.getCheckedValue();

            // 'height' attribute - required
            AbstractSVGAnimatedLength _height =
                (AbstractSVGAnimatedLength) re.getHeight();
            float h = _height.getCheckedValue();

            // 'rx' attribute - default is 0
            AbstractSVGAnimatedLength _rx =
                (AbstractSVGAnimatedLength) re.getRx();
            float rx = _rx.getCheckedValue();
            if (rx > w / 2) {
                rx = w / 2;
            }

            // 'ry' attribute - default is rx
            AbstractSVGAnimatedLength _ry =
                (AbstractSVGAnimatedLength) re.getRy();
            float ry = _ry.getCheckedValue();
            if (ry > h / 2) {
                ry = h / 2;
            }

            Shape shape;
View Full Code Here


                              ShapeNode shapeNode) {
        try {
            SVGOMEllipseElement ee = (SVGOMEllipseElement) e;

            // 'cx' attribute - default is 0
            AbstractSVGAnimatedLength _cx =
                (AbstractSVGAnimatedLength) ee.getCx();
            float cx = _cx.getCheckedValue();

            // 'cy' attribute - default is 0
            AbstractSVGAnimatedLength _cy =
                (AbstractSVGAnimatedLength) ee.getCy();
            float cy = _cy.getCheckedValue();

            // 'rx' attribute - required
            AbstractSVGAnimatedLength _rx =
                (AbstractSVGAnimatedLength) ee.getRx();
            float rx = _rx.getCheckedValue();

            // 'ry' attribute - required
            AbstractSVGAnimatedLength _ry =
                (AbstractSVGAnimatedLength) ee.getRy();
            float ry = _ry.getCheckedValue();

            shapeNode.setShape(new Ellipse2D.Float(cx - rx, cy - ry,
                                                   rx * 2, ry * 2));
        } catch (LiveAttributeException ex) {
            throw new BridgeException(ctx, ex);
View Full Code Here

        try {
            SVGOMLineElement le = (SVGOMLineElement) e;

            // 'x1' attribute - default is 0
            AbstractSVGAnimatedLength _x1 =
                (AbstractSVGAnimatedLength) le.getX1();
            float x1 = _x1.getCheckedValue();

            // 'y1' attribute - default is 0
            AbstractSVGAnimatedLength _y1 =
                (AbstractSVGAnimatedLength) le.getY1();
            float y1 = _y1.getCheckedValue();

            // 'x2' attribute - default is 0
            AbstractSVGAnimatedLength _x2 =
                (AbstractSVGAnimatedLength) le.getX2();
            float x2 = _x2.getCheckedValue();

            // 'y2' attribute - default is 0
            AbstractSVGAnimatedLength _y2 =
                (AbstractSVGAnimatedLength) le.getY2();
            float y2 = _y2.getCheckedValue();

            shapeNode.setShape(new Line2D.Float(x1, y1, x2, y2));
        } catch (LiveAttributeException ex) {
            throw new BridgeException(ctx, ex);
        }
View Full Code Here

                                                Element element) {
        try {
            SVGImageElement ie = (SVGImageElement) element;

            // 'x' attribute - default is 0
            AbstractSVGAnimatedLength _x =
                (AbstractSVGAnimatedLength) ie.getX();
            float x = _x.getCheckedValue();

            // 'y' attribute - default is 0
            AbstractSVGAnimatedLength _y =
                (AbstractSVGAnimatedLength) ie.getY();
            float y = _y.getCheckedValue();

            // 'width' attribute - required
            AbstractSVGAnimatedLength _width =
                (AbstractSVGAnimatedLength) ie.getWidth();
            float w = _width.getCheckedValue();

            // 'height' attribute - required
            AbstractSVGAnimatedLength _height =
                (AbstractSVGAnimatedLength) ie.getHeight();
            float h = _height.getCheckedValue();

            return new Rectangle2D.Float(x, y, w, h);
        } catch (LiveAttributeException ex) {
            throw new BridgeException(ctx, ex);
        }
View Full Code Here

            return inheritMap;
        }

        try {
            // textLength
            AbstractSVGAnimatedLength textLength =
                (AbstractSVGAnimatedLength) tce.getTextLength();
            if (textLength.isSpecified()) {
                if (inheritMap == null) {
                    inheritMap = new HashMap();
                }

                Object value = new Float(textLength.getCheckedValue());
                result.put
                    (GVTAttributedCharacterIterator.TextAttribute.BBOX_WIDTH,
                     value);
                inheritMap.put
                    (GVTAttributedCharacterIterator.TextAttribute.BBOX_WIDTH,
View Full Code Here

                    return;
                } else if (ln.equals(SVG_WIDTH_ATTRIBUTE)
                        || ln.equals(SVG_HEIGHT_ATTRIBUTE)) {
                    SVGImageElement ie = (SVGImageElement) e;
                    ImageNode imageNode = (ImageNode) node;
                    AbstractSVGAnimatedLength _attr;
                    if (ln.charAt(0) == 'w') {
                        _attr = (AbstractSVGAnimatedLength) ie.getWidth();
                    } else {
                        _attr = (AbstractSVGAnimatedLength) ie.getHeight();
                    }
                    float val = _attr.getCheckedValue();
                    if (val == 0 || imageNode.getImage() instanceof ShapeNode) {
                        rebuildImageNode();
                    } else {
                        updateImageBounds();
                    }
View Full Code Here

            float x = 0;
            float y = 0;
            // x and y have no meaning on the outermost 'svg' element
            if (!isOutermost) {
                // 'x' attribute - default is 0
                AbstractSVGAnimatedLength _x =
                    (AbstractSVGAnimatedLength) se.getX();
                x = _x.getCheckedValue();

                // 'y' attribute - default is 0
                AbstractSVGAnimatedLength _y =
                    (AbstractSVGAnimatedLength) se.getY();
                y = _y.getCheckedValue();
            }

            // 'width' attribute - default is 100%
            AbstractSVGAnimatedLength _width =
                (AbstractSVGAnimatedLength) se.getWidth();
            float w = _width.getCheckedValue();

            // 'height' attribute - default is 100%
            AbstractSVGAnimatedLength _height =
                (AbstractSVGAnimatedLength) se.getHeight();
            float h = _height.getCheckedValue();

            // 'visibility'
            cgn.setVisible(CSSUtilities.convertVisibility(e));

            // 'viewBox' and "preserveAspectRatio' attributes
View Full Code Here

                    SVGOMSVGElement se = (SVGOMSVGElement) e;
                    // X & Y are ignored on outermost SVG.
                    boolean isOutermost = doc.getRootElement() == e;
                    if (!isOutermost) {
                        // 'x' attribute - default is 0
                        AbstractSVGAnimatedLength _x =
                            (AbstractSVGAnimatedLength) se.getX();
                        float x = _x.getCheckedValue();

                        // 'y' attribute - default is 0
                        AbstractSVGAnimatedLength _y =
                            (AbstractSVGAnimatedLength) se.getY();
                        float y = _y.getCheckedValue();

                        AffineTransform positionTransform =
                            AffineTransform.getTranslateInstance(x, y);
                        CanvasGraphicsNode cgn;
                        cgn = (CanvasGraphicsNode)node;

                        cgn.setPositionTransform(positionTransform);
                        return;
                    }
                } else if (ln.equals(SVG_VIEW_BOX_ATTRIBUTE)
                        || ln.equals(SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE)) {
                    SVGDocument doc = (SVGDocument)e.getOwnerDocument();
                    SVGOMSVGElement se = (SVGOMSVGElement) e;
                    boolean isOutermost = doc.getRootElement() == e;

                    // X & Y are ignored on outermost SVG.
                    float x = 0;
                    float y = 0;
                    if (!isOutermost) {
                        // 'x' attribute - default is 0
                        AbstractSVGAnimatedLength _x =
                            (AbstractSVGAnimatedLength) se.getX();
                        x = _x.getCheckedValue();

                        // 'y' attribute - default is 0
                        AbstractSVGAnimatedLength _y =
                            (AbstractSVGAnimatedLength) se.getY();
                        y = _y.getCheckedValue();
                    }
                   
                    // 'width' attribute - default is 100%
                    AbstractSVGAnimatedLength _width =
                        (AbstractSVGAnimatedLength) se.getWidth();
                    float w = _width.getCheckedValue();
                   
                    // 'height' attribute - default is 100%
                    AbstractSVGAnimatedLength _height =
                        (AbstractSVGAnimatedLength) se.getHeight();
                    float h = _height.getCheckedValue();
                   
                    CanvasGraphicsNode cgn;
                    cgn = (CanvasGraphicsNode)node;
                   
                    // 'viewBox' and "preserveAspectRatio' attributes
View Full Code Here

                                               BridgeContext ctx) {
        AffineTransform at = super.computeTransform(e, ctx);
        SVGUseElement ue = (SVGUseElement) e;
        try {
            // 'x' attribute - default is 0
            AbstractSVGAnimatedLength _x =
                (AbstractSVGAnimatedLength) ue.getX();
            float x = _x.getCheckedValue();

            // 'y' attribute - default is 0
            AbstractSVGAnimatedLength _y =
                (AbstractSVGAnimatedLength) ue.getY();
            float y = _y.getCheckedValue();

            AffineTransform xy = AffineTransform.getTranslateInstance(x, y);
            xy.preConcatenate(at);
            return xy;
        } catch (LiveAttributeException ex) {
View Full Code Here

                              ShapeNode shapeNode) {
        try {
            SVGOMCircleElement ce = (SVGOMCircleElement) e;

            // 'cx' attribute - default is 0
            AbstractSVGAnimatedLength _cx =
                (AbstractSVGAnimatedLength) ce.getCx();
            float cx = _cx.getCheckedValue();

            // 'cy' attribute - default is 0
            AbstractSVGAnimatedLength _cy =
                (AbstractSVGAnimatedLength) ce.getCy();
            float cy = _cy.getCheckedValue();

            // 'r' attribute - required
            AbstractSVGAnimatedLength _r =
                (AbstractSVGAnimatedLength) ce.getR();
            float r = _r.getCheckedValue();

            float x = cx - r;
            float y = cy - r;
            float w = r * 2;
            shapeNode.setShape(new Ellipse2D.Float(x, y, w, w));
View Full Code Here

TOP

Related Classes of org.apache.flex.forks.batik.dom.svg.AbstractSVGAnimatedLength

Copyright © 2018 www.massapicom. 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.