/** * $Id: mxRectangleShape.js,v 1.17 2012-09-26 07:51:29 gaudenz Exp $ * Copyright (c) 2006-2010, JGraph Ltd */ /** * Class: mxRectangleShape * * Extends to implement a rectangle shape. * This shape is registered under * in . * * Constructor: mxRectangleShape * * Constructs a new rectangle shape. * * Parameters: * * bounds - that defines the bounds. This is stored in * . * fill - String that defines the fill color. This is stored in . * stroke - String that defines the stroke color. This is stored in . * strokewidth - Optional integer that defines the stroke width. Default is * 1. This is stored in . */ function mxRectangleShape(bounds, fill, stroke, strokewidth) { this.bounds = bounds; this.fill = fill; this.stroke = stroke; this.strokewidth = (strokewidth != null) ? strokewidth : 1; }; /** * Extends mxShape. */ mxRectangleShape.prototype = new mxShape(); mxRectangleShape.prototype.constructor = mxRectangleShape; /** * Function: createVml * * Creates and returns the VML node to represent this shape. */ mxRectangleShape.prototype.createVml = function() { var name = (this.isRounded) ? 'v:roundrect' : 'v:rect'; var node = document.createElement(name); this.configureVmlShape(node); return node; }; /** * Function: createSvg * * Creates and returns the SVG node to represent this shape. */ mxRectangleShape.prototype.createSvg = function() { return this.createSvgGroup('rect'); };