Extends mxShape to implement an actor shape. If a custom shape with one filled area is needed, then this shape’s redrawPath should be overridden.
function SampleShape() { } SampleShape.prototype = new mxActor(); SampleShape.prototype.constructor = vsAseShape; mxCellRenderer.prototype.defaultShapes['sample'] = SampleShape; SampleShape.prototype.redrawPath = function(path, x, y, w, h) { path.moveTo(0, 0); path.lineTo(w, h); // ... path.close(); }
This shape is registered under mxConstants.SHAPE_ACTOR in mxCellRenderer.
mxActor | Extends mxShape to implement an actor shape. |
Functions | |
mxActor | Constructs a new actor shape. |
paintVertexShape | Redirects to redrawPath for subclasses to work. |
redrawPath | Draws the path for this shape. |
function mxActor( bounds, fill, stroke, strokewidth )
Constructs a new actor shape.
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>. |
Constructs a new actor shape.
function mxActor( bounds, fill, stroke, strokewidth )
Redirects to redrawPath for subclasses to work.
mxActor.prototype.paintVertexShape = function( c, x, y, w, h )
Draws the path for this shape.
mxActor.prototype.redrawPath = function( c, x, y, w, h )
Holds the mxRectangle that specifies the bounds of this shape.
mxShape.prototype.bounds