sch_test/mxclient/js/shape/mxEllipse.js

49 lines
1.1 KiB
JavaScript

/**
* Copyright (c) 2006-2015, JGraph Ltd
* Copyright (c) 2006-2015, Gaudenz Alder
*/
/**
* Class: mxEllipse
*
* Extends <mxShape> to implement an ellipse shape.
* This shape is registered under <mxConstants.SHAPE_ELLIPSE>
* in <mxCellRenderer>.
*
* Constructor: mxEllipse
*
* Constructs a new ellipse shape.
*
* Parameters:
*
* bounds - <mxRectangle> that defines the bounds. This is stored in
* <mxShape.bounds>.
* fill - String that defines the fill color. This is stored in <fill>.
* stroke - String that defines the stroke color. This is stored in <stroke>.
* strokewidth - Optional integer that defines the stroke width. Default is
* 1. This is stored in <strokewidth>.
*/
function mxEllipse(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
};
/**
* Extends mxShape.
*/
mxUtils.extend(mxEllipse, mxShape);
/**
* Function: paintVertexShape
*
* Paints the ellipse shape.
*/
mxEllipse.prototype.paintVertexShape = function(c, x, y, w, h)
{
c.ellipse(x, y, w, h);
c.fillAndStroke();
};