1//**********************************************************************************************************************************************************
2//Input Pin
3//**********************************************************************************************************************************************************
4function mxShapeUMLInputPin(bounds, fill, stroke, strokewidth)
5{
6	mxShape.call(this);
7	this.bounds = bounds;
8	this.fill = fill;
9	this.stroke = stroke;
10	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
11	this.dx = 0.5;
12};
13
14/**
15* Extends mxShape.
16*/
17mxUtils.extend(mxShapeUMLInputPin, mxActor);
18
19mxShapeUMLInputPin.prototype.cst = {INPUT_PIN : 'mxgraph.uml25.inputPin'};
20
21mxShapeUMLInputPin.prototype.paintVertexShape = function(c, x, y, w, h)
22{
23	c.translate(x, y);
24
25	c.begin();
26	c.moveTo(0, 0);
27	c.lineTo(w, 0);
28	c.lineTo(w, h);
29	c.lineTo(0, h);
30	c.close();
31	c.fillAndStroke();
32
33	c.setShadow(false);
34
35	c.begin();
36	c.moveTo(w * 0.75, h * 0.5);
37	c.lineTo(w * 0.25, h * 0.5);
38	c.moveTo(w * 0.4, h * 0.4);
39	c.lineTo(w * 0.25, h * 0.5);
40	c.lineTo(w * 0.4, h * 0.6);
41	c.stroke();
42};
43
44mxCellRenderer.registerShape(mxShapeUMLInputPin.prototype.cst.INPUT_PIN, mxShapeUMLInputPin);
45
46mxShapeUMLInputPin.prototype.constraints = null;
47
48//**********************************************************************************************************************************************************
49//Behavior Action
50//**********************************************************************************************************************************************************
51function mxShapeUMLBehaviorAction(bounds, fill, stroke, strokewidth)
52{
53	mxShape.call(this);
54	this.bounds = bounds;
55	this.fill = fill;
56	this.stroke = stroke;
57	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
58	this.dx = 0.5;
59};
60
61mxUtils.extend(mxShapeUMLBehaviorAction, mxActor);
62
63mxShapeUMLBehaviorAction.prototype.cst = {BEHAVIOR_ACTION : 'mxgraph.uml25.behaviorAction'};
64
65/**
66* Function: paintVertexShape
67*
68* Paints the vertex shape.
69*/
70mxShapeUMLBehaviorAction.prototype.paintVertexShape = function(c, x, y, w, h)
71{
72	c.translate(x, y);
73
74	var rounded = mxUtils.getValue(this.style, 'rounded', false);
75	var absArcSize = mxUtils.getValue(this.style, 'absoluteArcSize', false);
76	var arcSize = parseFloat(mxUtils.getValue(this.style, 'arcSize', this.arcSize));
77
78	if (!absArcSize)
79	{
80		arcSize = Math.min(w, h) * arcSize;
81	}
82
83	arcSize = Math.min(arcSize, w * 0.5, h * 0.5);
84
85	if (!rounded)
86	{
87		arcSize = 0;
88	}
89
90	c.begin();
91
92	if (rounded)
93	{
94		c.moveTo(0, arcSize);
95		c.arcTo(arcSize, arcSize, 0, 0, 1, arcSize, 0);
96		c.lineTo(w - arcSize, 0);
97		c.arcTo(arcSize, arcSize, 0, 0, 1, w, arcSize);
98		c.lineTo(w, h - arcSize);
99		c.arcTo(arcSize, arcSize, 0, 0, 1, w - arcSize, h);
100		c.lineTo(arcSize, h);
101		c.arcTo(arcSize, arcSize, 0, 0, 1, 0, h - arcSize);
102	}
103	else
104	{
105		c.moveTo(0, 0);
106		c.lineTo(w, 0);
107		c.lineTo(w, h);
108		c.lineTo(0, h);
109	}
110
111	c.close();
112	c.fillAndStroke();
113
114	c.setShadow(false);
115
116	if (w >= 60 && h >= 40)
117	{
118		c.begin();
119		c.moveTo(w - 60, h * 0.5 + 20);
120		c.lineTo(w - 60, h * 0.5);
121		c.lineTo(w - 20, h * 0.5);
122		c.lineTo(w - 20, h * 0.5 + 20);
123		c.moveTo(w - 40, h * 0.5 - 20);
124		c.lineTo(w - 40, h * 0.5 + 20);
125		c.stroke();
126	}
127};
128
129mxCellRenderer.registerShape(mxShapeUMLBehaviorAction.prototype.cst.BEHAVIOR_ACTION, mxShapeUMLBehaviorAction);
130
131mxShapeUMLBehaviorAction.prototype.constraints = null;
132
133//**********************************************************************************************************************************************************
134//Action
135//**********************************************************************************************************************************************************
136/**
137* Extends mxShape.
138*/
139function mxShapeUMLAction(bounds, fill, stroke, strokewidth)
140{
141	mxShape.call(this);
142	this.bounds = bounds;
143	this.fill = fill;
144	this.stroke = stroke;
145	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
146	this.dx = 0.5;
147};
148
149/**
150* Extends mxShape.
151*/
152mxUtils.extend(mxShapeUMLAction, mxActor);
153
154mxShapeUMLAction.prototype.cst = {ACTION : 'mxgraph.uml25.action'};
155
156/**
157* Function: paintVertexShape
158*
159* Paints the vertex shape.
160*/
161mxShapeUMLAction.prototype.paintVertexShape = function(c, x, y, w, h)
162{
163	c.translate(x, y);
164
165	var absArcSize = mxUtils.getValue(this.style, 'absoluteArcSize', false);
166	var arcSize = parseFloat(mxUtils.getValue(this.style, 'arcSize', this.arcSize));
167
168	if (!absArcSize)
169	{
170		arcSize = Math.min(w, h) * arcSize;
171	}
172
173	arcSize = Math.min(arcSize, w * 0.5, h * 0.5);
174
175	c.begin();
176	c.moveTo(0, arcSize);
177	c.arcTo(arcSize, arcSize, 0, 0, 1, arcSize, 0);
178	c.lineTo(w - arcSize - 10, 0);
179	c.arcTo(arcSize, arcSize, 0, 0, 1, w - 10, arcSize);
180	c.lineTo(w - 10, h - arcSize);
181	c.arcTo(arcSize, arcSize, 0, 0, 1, w - arcSize - 10, h);
182	c.lineTo(arcSize, h);
183	c.arcTo(arcSize, arcSize, 0, 0, 1, 0, h - arcSize);
184	c.close();
185	c.fillAndStroke();
186
187	c.rect(w - 10, h * 0.5 - 10, 10, 20);
188	c.fillAndStroke();
189};
190
191mxCellRenderer.registerShape(mxShapeUMLAction.prototype.cst.ACTION, mxShapeUMLAction);
192
193mxShapeUMLAction.prototype.constraints = null;
194
195//**********************************************************************************************************************************************************
196//Action with parameters
197//**********************************************************************************************************************************************************
198/**
199* Extends mxShape.
200*/
201function mxShapeUMLActionParams(bounds, fill, stroke, strokewidth)
202{
203	mxShape.call(this);
204	this.bounds = bounds;
205	this.fill = fill;
206	this.stroke = stroke;
207	this.strokewidth = (strokewidth != null) ? strokewidth : 1;
208	this.dx = 0.5;
209};
210
211/**
212* Extends mxShape.
213*/
214mxUtils.extend(mxShapeUMLActionParams, mxActor);
215
216mxShapeUMLActionParams.prototype.cst = {ACTION_PARAMS : 'mxgraph.uml25.actionParams'};
217
218/**
219* Function: paintVertexShape
220*
221* Paints the vertex shape.
222*/
223mxShapeUMLActionParams.prototype.paintVertexShape = function(c, x, y, w, h)
224{
225	c.translate(x, y);
226
227	var absArcSize = mxUtils.getValue(this.style, 'absoluteArcSize', false);
228	var arcSize = parseFloat(mxUtils.getValue(this.style, 'arcSize', this.arcSize));
229
230	if (!absArcSize)
231	{
232		arcSize = Math.min(w, h) * arcSize;
233	}
234
235	arcSize = Math.min(arcSize, w * 0.5, h * 0.5);
236
237	c.begin();
238	c.moveTo(20, arcSize);
239	c.arcTo(arcSize, arcSize, 0, 0, 1, 20 + arcSize, 0);
240	c.lineTo(w - arcSize, 0);
241	c.arcTo(arcSize, arcSize, 0, 0, 1, w, arcSize);
242	c.lineTo(w, h - arcSize);
243	c.arcTo(arcSize, arcSize, 0, 0, 1, w - arcSize, h);
244	c.lineTo(20 + arcSize, h);
245	c.arcTo(arcSize, arcSize, 0, 0, 1, 20, h - arcSize);
246	c.close();
247	c.fillAndStroke();
248
249	c.rect(5, h * 0.5 - 17, 20, 34);
250	c.fillAndStroke();
251
252	c.rect(0, h * 0.5 - 13, 10, 10);
253	c.fillAndStroke();
254
255	c.rect(0, h * 0.5 + 3, 10, 10);
256	c.fillAndStroke();
257};
258
259mxCellRenderer.registerShape(mxShapeUMLActionParams.prototype.cst.ACTION_PARAMS, mxShapeUMLActionParams);
260
261mxShapeUMLActionParams.prototype.constraints = null;
262