protected void drawRect(int x,int y,int w,int h,Color fillColor,Paint fillPaint,Color penColor,boolean shadow,boolean rounded){
  int radius=(rounded) ? getArcSize(w,h) : 0;
  if (fillColor != null || fillPaint != null) {
    if (shadow) {
      g.setColor(mxConstants.SHADOW_COLOR);
      if (rounded) {
        g.fillRoundRect(x + mxConstants.SHADOW_OFFSETX,y + mxConstants.SHADOW_OFFSETY,w,h,radius,radius);
      }
 else {
        g.fillRect(x + mxConstants.SHADOW_OFFSETX,y + mxConstants.SHADOW_OFFSETY,w,h);
      }
    }
    if (fillPaint != null) {
      g.setPaint(fillPaint);
    }
 else {
      g.setColor(fillColor);
    }
    if (rounded) {
      g.fillRoundRect(x,y,w,h,radius,radius);
    }
 else {
      if (g.getClipBounds() != null) {
        Rectangle rect=new Rectangle(x,y,w,h);
        g.fill(rect.intersection(g.getClipBounds()));
      }
 else {
        g.fillRect(x,y,w,h);
      }
    }
  }
  if (penColor != null) {
    g.setColor(penColor);
    if (rounded) {
      g.drawRoundRect(x,y,w,h,radius,radius);
    }
 else {
      g.drawRect(x,y,w,h);
    }
  }
}

protected void drawRect ( int x , int y , int w , int h , Color fillColor , Paint fillPaint , Color penColor , boolean shadow , boolean rounded ) { int radius = ( rounded ) ? getArcSize ( w , h ) : 0 ; if ( fillColor != null || fillPaint != null ) { if ( shadow ) { g . setColor ( mxConstants . SHADOW_COLOR ) ; if ( rounded ) { g . fillRoundRect ( x + mxConstants . SHADOW_OFFSETX , y + mxConstants . SHADOW_OFFSETY , w , h , radius , radius ) ; } else { g . fillRect ( x + mxConstants . SHADOW_OFFSETX , y + mxConstants . SHADOW_OFFSETY , w , h ) ; } } if ( fillPaint != null ) { g . setPaint ( fillPaint ) ; } else { g . setColor ( fillColor ) ; } if ( rounded ) { g . fillRoundRect ( x , y , w , h , radius , radius ) ; } else { if ( g . getClipBounds ( ) != null ) { Rectangle rect = new Rectangle ( x , y , w , h ) ; g . fill ( rect . intersection ( g . getClipBounds ( ) ) ) ; } else { g . fillRect ( x , y , w , h ) ; } } } if ( penColor != null ) { g . setColor ( penColor ) ; if ( rounded ) { g . drawRoundRect ( x , y , w , h , radius , radius ) ; } else { g . drawRect ( x , y , w , h ) ; } } }
draws a rectangle for the given parameters .
