Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
86 lines (83 loc) · 2.09 KB

File metadata and controls

86 lines (83 loc) · 2.09 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**
* $Id: mxActor.js,v 1.2 2012/11/22 10:40:09 gaudenz Exp $
* Copyright (c) 2006-2010, JGraph Ltd
*/
/**
* Class: mxActor
*
* 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.
*
* Example:
*
* (code)
* 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();
* }
* (end)
*
* This shape is registered under <mxConstants.SHAPE_ACTOR> in
* <mxCellRenderer>.
*
* Constructor: mxActor
*
* Constructs a new actor 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 mxActor(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(mxActor, mxShape);
/**
* Function: paintVertexShape
*
* Redirects to redrawPath for subclasses to work.
*/
mxActor.prototype.paintVertexShape = function(c, x, y, w, h)
{
c.translate(x, y);
c.begin();
this.redrawPath(c, x, y, w, h);
c.fillAndStroke();
};
/**
* Function: redrawPath
*
* Draws the path for this shape.
*/
mxActor.prototype.redrawPath = function(c, x, y, w, h)
{
var width = w/3;
c.moveTo(0, h);
c.curveTo(0, 3 * h / 5, 0, 2 * h / 5, w / 2, 2 * h / 5);
c.curveTo(w / 2 - width, 2 * h / 5, w / 2 - width, 0, w / 2, 0);
c.curveTo(w / 2 + width, 0, w / 2 + width, 2 * h / 5, w / 2, 2 * h / 5);
c.curveTo(w, 2 * h / 5, w, 3 * h / 5, w, h);
c.close();
};
Morty Proxy This is a proxified and sanitized view of the page, visit original site.