Package org.w3c.dom.svg

Examples of org.w3c.dom.svg.SVGMatrix


        _spiralElement.setTrait("fill", "none");
        _spiralElement.setFloatTrait("stroke-width", 3);
        _spiralElement.setFloatTrait("fill-opacity", 0.9f);

        // Do some transformations on the path.
        final SVGMatrix transform = _spiralElement.getMatrixTrait("transform");
        if (_displayHeight > _displayWidth) {
            transform.mTranslate(Util.convertDefaultValue(110, true), 0);
        } else {
            transform.mTranslate(0, Util.convertDefaultValue(-110, true));
        }

        _spiralElement.setMatrixTrait("transform", transform);

        // Create an image element.
View Full Code Here


            _greenElement.setFloatTrait("cx", Util.convertDefaultValue(200,
                    true));
            _greenElement.setFloatTrait("cy", Util.convertDefaultValue(180,
                    false));

            final SVGMatrix transform =
                    _spiralElement.getMatrixTrait("transform");
            if (_displayHeight > _displayWidth) {
                transform.mTranslate(Util.convertDefaultValue(-70, true), Util
                        .convertDefaultValue(40, false));
            } else {
                transform.mTranslate(Util.convertDefaultValue(60, true), Util
                        .convertDefaultValue(-50, false));
            }

            _spiralElement.setMatrixTrait("transform", transform);
View Full Code Here

          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());
          logger.debug(mat.getD());
          logger.debug(mat.getE());
          logger.debug(mat.getF());
          SVGRect bbox = svgGom.getBBox();
          logger.debug("BBOx: X:" + bbox.getX() + " Y:" + bbox.getY() + " Width:" + bbox.getWidth() + " Height:" + bbox.getHeight());
          */
         
          //Hack, because if no width/height is specified default of 1.0
          //is assumed by batik -> things may get scaled too small
          if ( !(width == 1 && height == 1) ){
            currentLocalTransformMatrix = new Matrix(mat.getA(), mat.getC(),   0, mat.getE(),
                                   mat.getB(), mat.getD(),   0, mat.getF(),
                                   0,       0,       1,       0,
                                   0,       0,       0,       1
            );
            //logger.debug("Matrix: " + currentLocalTransformMatrix);
            group.setLocalMatrix(currentLocalTransformMatrix);
View Full Code Here

TOP

Related Classes of org.w3c.dom.svg.SVGMatrix

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.