Examples of SVGOMSVGElement


Examples of org.apache.batik.dom.svg.SVGOMSVGElement

            // In some cases we converted document fragments which didn't
            // have a parent SVG element, this check makes sure only the
            // real root of the SVG Document tries to do negotiation with
            // the UA.
            SVGDocument doc = (SVGDocument)e.getOwnerDocument();
            SVGOMSVGElement se = (SVGOMSVGElement) e;
            boolean isOutermost = (doc.getRootElement() == e);
            float x = 0;
            float y = 0;
            // x and y have no meaning on the outermost 'svg' element
            if (!isOutermost) {
                // 'x' attribute - default is 0
                x = se.getX().getAnimVal().getValue();

                // 'y' attribute - default is 0
                y = se.getY().getAnimVal().getValue();
            }

            // 'width' attribute - default is 100%
            float w = se.getWidth().getAnimVal().getValue();

            // 'height' attribute - default is 100%
            float h = se.getHeight().getAnimVal().getValue();

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

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

Examples of org.apache.batik.dom.svg.SVGOMSVGElement

                        || ln.equals(SVG_HEIGHT_ATTRIBUTE)) {
                    rebuild = true;
                } else if (ln.equals(SVG_X_ATTRIBUTE)
                        || ln.equals(SVG_Y_ATTRIBUTE)) {
                    SVGDocument doc = (SVGDocument)e.getOwnerDocument();
                    SVGOMSVGElement se = (SVGOMSVGElement) e;
                    // X & Y are ignored on outermost SVG.
                    boolean isOutermost = doc.getRootElement() == e;
                    if (!isOutermost) {
                        // 'x' attribute - default is 0
                        float x = se.getX().getAnimVal().getValue();

                        // 'y' attribute - default is 0
                        float y = se.getY().getAnimVal().getValue();

                        AffineTransform positionTransform =
                            AffineTransform.getTranslateInstance(x, y);
                        CanvasGraphicsNode cgn;
                        cgn = (CanvasGraphicsNode)node;
View Full Code Here

Examples of org.apache.batik.dom.svg.SVGOMSVGElement

            String attrName = evt.getAttrName();
            boolean rebuild = false;
            if (attrName.equals(SVG_VIEW_BOX_ATTRIBUTE) ||
                       attrName.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
                    x = se.getX().getAnimVal().getValue();

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

Examples of org.apache.batik.dom.svg.SVGOMSVGElement

            // In some cases we converted document fragments which didn't
            // have a parent SVG element, this check makes sure only the
            // real root of the SVG Document tries to do negotiation with
            // the UA.
            SVGDocument doc = (SVGDocument)e.getOwnerDocument();
            SVGOMSVGElement se = (SVGOMSVGElement) e;
            boolean isOutermost = (doc.getRootElement() == e);
            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
            SVGOMAnimatedRect vb = (SVGOMAnimatedRect) se.getViewBox();
            SVGAnimatedPreserveAspectRatio par = se.getPreserveAspectRatio();
            AffineTransform viewingTransform =
                ViewBox.getPreserveAspectRatioTransform(e, vb, par, w, h, ctx);

            float actualWidth = w;
            float actualHeight = h;
View Full Code Here

Examples of org.apache.batik.dom.svg.SVGOMSVGElement

                        || ln.equals(SVG_HEIGHT_ATTRIBUTE)) {
                    rebuild = true;
                } else if (ln.equals(SVG_X_ATTRIBUTE)
                        || ln.equals(SVG_Y_ATTRIBUTE)) {
                    SVGDocument doc = (SVGDocument)e.getOwnerDocument();
                    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
                    SVGOMAnimatedRect vb = (SVGOMAnimatedRect) se.getViewBox();
                    SVGAnimatedPreserveAspectRatio par = se.getPreserveAspectRatio();
                    AffineTransform newVT = ViewBox.getPreserveAspectRatioTransform
                        (e, vb, par, w, h, ctx);

                    AffineTransform oldVT = cgn.getViewingTransform();
                    if ((newVT.getScaleX() != oldVT.getScaleX()) ||
View Full Code Here

Examples of org.apache.batik.dom.svg.SVGOMSVGElement

        group.setLocalMatrix(currentLocalTransformMatrix);
       
        //IF its <svg> element get the transform
        //(to honor the viewBox and the width/height attributes
        if (node instanceof SVGOMSVGElement ){
          SVGOMSVGElement svgGom = ((SVGOMSVGElement)node);
          Element viewPort = svgGom.getViewportElement();
          if (viewPort != null)
            logger.debug("Viewport " + viewPort.getNodeName());
         
//          SVGMatrix mat = svgGom.getScreenCTM();
         
          SVGAnimatedLength widthA = svgGom.getWidth();
          SVGAnimatedLength heightA = svgGom.getHeight();
         
          SVGLength w = widthA.getBaseVal();
          float width = w.getValue();
         
          SVGLength h = heightA.getBaseVal();
          float height = h.getValue();
         
          logger.debug("-> SVG Width: " + width + " Height: " + height);
         
         
          SVGMatrix mat = svgGom.getCTM();
          /*
          logger.debug("mat: " + mat.toString());
          logger.debug(mat.getA());
          logger.debug(mat.getB());
          logger.debug(mat.getC());
View Full Code Here

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

            // In some cases we converted document fragments which didn't
            // have a parent SVG element, this check makes sure only the
            // real root of the SVG Document tries to do negotiation with
            // the UA.
            SVGDocument doc = (SVGDocument)e.getOwnerDocument();
            SVGOMSVGElement se = (SVGOMSVGElement) e;
            boolean isOutermost = (doc.getRootElement() == e);
            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
            SVGOMAnimatedRect vb = (SVGOMAnimatedRect) se.getViewBox();
            SVGAnimatedPreserveAspectRatio par = se.getPreserveAspectRatio();
            AffineTransform viewingTransform =
                ViewBox.getPreserveAspectRatioTransform(e, vb, par, w, h, ctx);

            float actualWidth = w;
            float actualHeight = h;
View Full Code Here

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

                        || ln.equals(SVG_HEIGHT_ATTRIBUTE)) {
                    rebuild = true;
                } else if (ln.equals(SVG_X_ATTRIBUTE)
                        || ln.equals(SVG_Y_ATTRIBUTE)) {
                    SVGDocument doc = (SVGDocument)e.getOwnerDocument();
                    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
                    SVGOMAnimatedRect vb = (SVGOMAnimatedRect) se.getViewBox();
                    SVGAnimatedPreserveAspectRatio par = se.getPreserveAspectRatio();
                    AffineTransform newVT = ViewBox.getPreserveAspectRatioTransform
                        (e, vb, par, w, h, ctx);

                    AffineTransform oldVT = cgn.getViewingTransform();
                    if ((newVT.getScaleX() != oldVT.getScaleX()) ||
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.