private static void extractRectItem(SvgTree avg,SvgLeafNode child,Node currentGroupNode){
  logger.log(Level.FINE,"Rect found" + currentGroupNode.getTextContent());
  if (currentGroupNode.getNodeType() == Node.ELEMENT_NODE) {
    float x=0;
    float y=0;
    float width=Float.NaN;
    float height=Float.NaN;
    NamedNodeMap a=currentGroupNode.getAttributes();
    int len=a.getLength();
    boolean pureTransparent=false;
    for (int j=0; j < len; j++) {
      Node n=a.item(j);
      String name=n.getNodeName();
      String value=n.getNodeValue();
      if (name.equals(SVG_STYLE)) {
        addStyleToPath(child,value);
        if (value.contains("opacity:0;")) {
          pureTransparent=true;
        }
      }
 else       if (presentationMap.containsKey(name)) {
        child.fillPresentationAttributes(name,value);
      }
 else       if (name.equals("clip-path") && value.startsWith("url(#SVGID_")) {
      }
 else       if (name.equals("x")) {
        x=Float.parseFloat(value);
      }
 else       if (name.equals("y")) {
        y=Float.parseFloat(value);
      }
 else       if (name.equals("width")) {
        width=Float.parseFloat(value);
      }
 else       if (name.equals("height")) {
        height=Float.parseFloat(value);
      }
 else       if (name.equals("style")) {
      }
    }
    if (!pureTransparent && avg != null && !Float.isNaN(x) && !Float.isNaN(y) && !Float.isNaN(width) && !Float.isNaN(height)) {
      PathBuilder builder=new PathBuilder();
      builder.absoluteMoveTo(x,y);
      builder.relativeHorizontalTo(width);
      builder.relativeVerticalTo(height);
      builder.relativeHorizontalTo(-width);
      builder.relativeClose();
      child.setPathData(builder.toString());
    }
  }
}

private static void extractRectItem ( SvgTree avg , SvgLeafNode child , Node currentGroupNode ) { logger . log ( Level . FINE , "Rect found" + currentGroupNode . getTextContent ( ) ) ; if ( currentGroupNode . getNodeType ( ) == Node . ELEMENT_NODE ) { float x = 0 ; float y = 0 ; float width = Float . NaN ; float height = Float . NaN ; NamedNodeMap a = currentGroupNode . getAttributes ( ) ; int len = a . getLength ( ) ; boolean pureTransparent = false ; for ( int j = 0 ; j < len ; j ++ ) { Node n = a . item ( j ) ; String name = n . getNodeName ( ) ; String value = n . getNodeValue ( ) ; if ( name . equals ( SVG_STYLE ) ) { addStyleToPath ( child , value ) ; if ( value . contains ( "opacity:0;" ) ) { pureTransparent = true ; } } else if ( presentationMap . containsKey ( name ) ) { child . fillPresentationAttributes ( name , value ) ; } else if ( name . equals ( "clip-path" ) && value . startsWith ( "url(#SVGID_" ) ) { } else if ( name . equals ( "x" ) ) { x = Float . parseFloat ( value ) ; } else if ( name . equals ( "y" ) ) { y = Float . parseFloat ( value ) ; } else if ( name . equals ( "width" ) ) { width = Float . parseFloat ( value ) ; } else if ( name . equals ( "height" ) ) { height = Float . parseFloat ( value ) ; } else if ( name . equals ( "style" ) ) { } } if ( ! pureTransparent && avg != null && ! Float . isNaN ( x ) && ! Float . isNaN ( y ) && ! Float . isNaN ( width ) && ! Float . isNaN ( height ) ) { PathBuilder builder = new PathBuilder ( ) ; builder . absoluteMoveTo ( x , y ) ; builder . relativeHorizontalTo ( width ) ; builder . relativeVerticalTo ( height ) ; builder . relativeHorizontalTo ( - width ) ; builder . relativeClose ( ) ; child . setPathData ( builder . toString ( ) ) ; } } }
convert rectangle element into a path .
