Package org.apache.batik.dom.svg

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


    protected void buildShape(BridgeContext ctx,
                              Element e,
                              ShapeNode shapeNode) {

        try {
            SVGOMRectElement re = (SVGOMRectElement) e;

            // 'x' attribute - default is 0
            float x = re.getX().getAnimVal().getValue();

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

            // 'width' attribute - required
            float w = re.getWidth().getAnimVal().getValue();

            // 'height' attribute - required
            float h = re.getHeight().getAnimVal().getValue();

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

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

            Shape shape;
View Full Code Here


    protected void buildShape(BridgeContext ctx,
                              Element e,
                              ShapeNode shapeNode) {

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

        }catch(Exception e){
          logger.error(e.getMessage());
        }
        returnComp = comp;
      }else if (gfxElem instanceof SVGOMRectElement){
        SVGOMRectElement rectElem = (SVGOMRectElement)gfxElem;
        if (isUnderClipPath(rectElem)){
          logger.error("discarding clip-path Rect");
          return null;
        }
       
        float x     = rectElem.getX().getBaseVal().getValue();
        float y     = rectElem.getY().getBaseVal().getValue();
        float width   = rectElem.getWidth().getBaseVal().getValue();
        float height   = rectElem.getHeight().getBaseVal().getValue();
        float rx     = rectElem.getRx().getBaseVal().getValue();
        float ry     = rectElem.getRy().getBaseVal().getValue();
       
        AbstractShape comp;
        //Create a normal rectangle or a round rectangle
        if (rx != 0.0f || ry != 0.0f){
          if (rx > width/2 )
View Full Code Here

TOP

Related Classes of org.apache.batik.dom.svg.SVGOMRectElement

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.