public Element drawShape(int x,int y,int w,int h,Map<String,Object> style){
  String fillColor=mxUtils.getString(style,mxConstants.STYLE_FILLCOLOR);
  String strokeColor=mxUtils.getString(style,mxConstants.STYLE_STROKECOLOR);
  float strokeWidth=(float)(mxUtils.getFloat(style,mxConstants.STYLE_STROKEWIDTH,1) * scale);
  String shape=mxUtils.getString(style,mxConstants.STYLE_SHAPE);
  Element elem=document.createElement("div");
  if (shape.equals(mxConstants.SHAPE_LINE)) {
    String direction=mxUtils.getString(style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);
    if (direction.equals(mxConstants.DIRECTION_EAST) || direction.equals(mxConstants.DIRECTION_WEST)) {
      y=Math.round(y + h / 2);
      h=1;
    }
 else {
      x=Math.round(y + w / 2);
      w=1;
    }
  }
  if (mxUtils.isTrue(style,mxConstants.STYLE_SHADOW,false) && fillColor != null) {
    Element shadow=(Element)elem.cloneNode(true);
    String s="overflow:hidden;position:absolute;" + "left:" + String.valueOf(x + mxConstants.SHADOW_OFFSETX) + "px;"+ "top:"+ String.valueOf(y + mxConstants.SHADOW_OFFSETY)+ "px;"+ "width:"+ String.valueOf(w)+ "px;"+ "height:"+ String.valueOf(h)+ "px;background:"+ mxConstants.W3C_SHADOWCOLOR+ ";border-style:solid;border-color:"+ mxConstants.W3C_SHADOWCOLOR+ ";border-width:"+ String.valueOf(Math.round(strokeWidth))+ ";";
    shadow.setAttribute("style",s);
    appendHtmlElement(shadow);
  }
  if (shape.equals(mxConstants.SHAPE_IMAGE)) {
    String img=getImageForStyle(style);
    if (img != null) {
      elem=document.createElement("img");
      elem.setAttribute("border","0");
      elem.setAttribute("src",img);
    }
  }
  String s="overflow:hidden;position:absolute;" + "left:" + String.valueOf(x) + "px;"+ "top:"+ String.valueOf(y)+ "px;"+ "width:"+ String.valueOf(w)+ "px;"+ "height:"+ String.valueOf(h)+ "px;background:"+ fillColor+ ";"+ ";border-style:solid;border-color:"+ strokeColor+ ";border-width:"+ String.valueOf(Math.round(strokeWidth))+ ";";
  elem.setAttribute("style",s);
  appendHtmlElement(elem);
  return elem;
}

public Element drawShape ( int x , int y , int w , int h , Map < String , Object > style ) { String fillColor = mxUtils . getString ( style , mxConstants . STYLE_FILLCOLOR ) ; String strokeColor = mxUtils . getString ( style , mxConstants . STYLE_STROKECOLOR ) ; float strokeWidth = ( float ) ( mxUtils . getFloat ( style , mxConstants . STYLE_STROKEWIDTH , 1 ) * scale ) ; String shape = mxUtils . getString ( style , mxConstants . STYLE_SHAPE ) ; Element elem = document . createElement ( "div" ) ; if ( shape . equals ( mxConstants . SHAPE_LINE ) ) { String direction = mxUtils . getString ( style , mxConstants . STYLE_DIRECTION , mxConstants . DIRECTION_EAST ) ; if ( direction . equals ( mxConstants . DIRECTION_EAST ) || direction . equals ( mxConstants . DIRECTION_WEST ) ) { y = Math . round ( y + h / 2 ) ; h = 1 ; } else { x = Math . round ( y + w / 2 ) ; w = 1 ; } } if ( mxUtils . isTrue ( style , mxConstants . STYLE_SHADOW , false ) && fillColor != null ) { Element shadow = ( Element ) elem . cloneNode ( true ) ; String s = "overflow:hidden;position:absolute;" + "left:" + String . valueOf ( x + mxConstants . SHADOW_OFFSETX ) + "px;" + "top:" + String . valueOf ( y + mxConstants . SHADOW_OFFSETY ) + "px;" + "width:" + String . valueOf ( w ) + "px;" + "height:" + String . valueOf ( h ) + "px;background:" + mxConstants . W3C_SHADOWCOLOR + ";border-style:solid;border-color:" + mxConstants . W3C_SHADOWCOLOR + ";border-width:" + String . valueOf ( Math . round ( strokeWidth ) ) + ";" ; shadow . setAttribute ( "style" , s ) ; appendHtmlElement ( shadow ) ; } if ( shape . equals ( mxConstants . SHAPE_IMAGE ) ) { String img = getImageForStyle ( style ) ; if ( img != null ) { elem = document . createElement ( "img" ) ; elem . setAttribute ( "border" , "0" ) ; elem . setAttribute ( "src" , img ) ; } } String s = "overflow:hidden;position:absolute;" + "left:" + String . valueOf ( x ) + "px;" + "top:" + String . valueOf ( y ) + "px;" + "width:" + String . valueOf ( w ) + "px;" + "height:" + String . valueOf ( h ) + "px;background:" + fillColor + ";" + ";border-style:solid;border-color:" + strokeColor + ";border-width:" + String . valueOf ( Math . round ( strokeWidth ) ) + ";" ; elem . setAttribute ( "style" , s ) ; appendHtmlElement ( elem ) ; return elem ; }
draws the shape specified with the style_shape key in the given style .
