mxEllipse.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * Copyright (c) 2006-2015, JGraph Ltd
  3. * Copyright (c) 2006-2015, Gaudenz Alder
  4. */
  5. /**
  6. * Class: mxEllipse
  7. *
  8. * Extends <mxShape> to implement an ellipse shape.
  9. * This shape is registered under <mxConstants.SHAPE_ELLIPSE>
  10. * in <mxCellRenderer>.
  11. *
  12. * Constructor: mxEllipse
  13. *
  14. * Constructs a new ellipse shape.
  15. *
  16. * Parameters:
  17. *
  18. * bounds - <mxRectangle> that defines the bounds. This is stored in
  19. * <mxShape.bounds>.
  20. * fill - String that defines the fill color. This is stored in <fill>.
  21. * stroke - String that defines the stroke color. This is stored in <stroke>.
  22. * strokewidth - Optional integer that defines the stroke width. Default is
  23. * 1. This is stored in <strokewidth>.
  24. */
  25. function mxEllipse(bounds, fill, stroke, strokewidth)
  26. {
  27. mxShape.call(this);
  28. this.bounds = bounds;
  29. this.fill = fill;
  30. this.stroke = stroke;
  31. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  32. };
  33. /**
  34. * Extends mxShape.
  35. */
  36. mxUtils.extend(mxEllipse, mxShape);
  37. /**
  38. * Function: paintVertexShape
  39. *
  40. * Paints the ellipse shape.
  41. */
  42. mxEllipse.prototype.paintVertexShape = function(c, x, y, w, h)
  43. {
  44. c.ellipse(x, y, w, h);
  45. c.fillAndStroke();
  46. };
  47. __mxOutput.mxEllipse = typeof mxEllipse !== 'undefined' ? mxEllipse : undefined;