mxMockupMisc.js 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640
  1. /**
  2. * $Id: mxMockupMisc.js,v 1.5 2013/02/28 13:50:11 mate Exp $
  3. * Copyright (c) 2006-2010, JGraph Ltd
  4. */
  5. //**********************************************************************************************************************************************************
  6. //Playback Controls
  7. //**********************************************************************************************************************************************************
  8. /**
  9. * Extends mxShape.
  10. */
  11. function mxShapeMockupPlaybackControls(bounds, fill, stroke, strokewidth)
  12. {
  13. mxShape.call(this);
  14. this.bounds = bounds;
  15. this.fill = fill;
  16. this.stroke = stroke;
  17. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  18. };
  19. /**
  20. * Extends mxShape.
  21. */
  22. mxUtils.extend(mxShapeMockupPlaybackControls, mxShape);
  23. mxShapeMockupPlaybackControls.prototype.cst = {
  24. SHAPE_PLAYBACK_CONTROLS : 'mxgraph.mockup.misc.playbackControls',
  25. FILL_COLOR2 : 'fillColor2',
  26. STROKE_COLOR2 : 'strokeColor2',
  27. FILL_COLOR3 : 'fillColor3',
  28. STROKE_COLOR3 : 'strokeColor3'
  29. };
  30. /**
  31. * Function: paintVertexShape
  32. *
  33. * Paints the vertex shape.
  34. */
  35. mxShapeMockupPlaybackControls.prototype.paintVertexShape = function(c, x, y, w, h)
  36. {
  37. var controlBarHeight = 30;
  38. var buttonSize = 22;
  39. var h = Math.max(h, controlBarHeight);
  40. var w = Math.max(225, w);
  41. c.translate(x, y);
  42. this.background(c, w, h, controlBarHeight);
  43. c.setShadow(false);
  44. this.foreground(c, w, h, controlBarHeight, buttonSize);
  45. };
  46. mxShapeMockupPlaybackControls.prototype.background = function(c, w, h, controlBarHeight)
  47. {
  48. c.rect(0, (h - controlBarHeight) * 0.5, w, controlBarHeight);
  49. c.fillAndStroke();
  50. }
  51. mxShapeMockupPlaybackControls.prototype.foreground = function(c, w, h, controlBarHeight, buttonSize)
  52. {
  53. var fillColor2 = mxUtils.getValue(this.style, mxShapeMockupPlaybackControls.prototype.cst.FILL_COLOR2, '#99ddff');
  54. var strokeColor2 = mxUtils.getValue(this.style, mxShapeMockupPlaybackControls.prototype.cst.STROKE_COLOR2, 'none');
  55. var fillColor3 = mxUtils.getValue(this.style, mxShapeMockupPlaybackControls.prototype.cst.FILL_COLOR3, '#ffffff');
  56. var strokeColor3 = mxUtils.getValue(this.style, mxShapeMockupPlaybackControls.prototype.cst.STROKE_COLOR3, 'none');
  57. c.setStrokeColor(strokeColor2);
  58. c.setFillColor(fillColor2);
  59. c.ellipse(10, h * 0.5 - buttonSize * 0.5, buttonSize, buttonSize);
  60. c.fillAndStroke();
  61. c.ellipse(40, h * 0.5 - buttonSize * 0.5, buttonSize, buttonSize);
  62. c.fillAndStroke();
  63. c.ellipse(70, h * 0.5 - buttonSize * 0.5, buttonSize, buttonSize);
  64. c.fillAndStroke();
  65. c.ellipse(100, h * 0.5 - buttonSize * 0.5, buttonSize, buttonSize);
  66. c.fillAndStroke();
  67. c.ellipse(130, h * 0.5 - buttonSize * 0.5, buttonSize, buttonSize);
  68. c.fillAndStroke();
  69. c.ellipse(160, h * 0.5 - buttonSize * 0.5, buttonSize, buttonSize);
  70. c.fillAndStroke();
  71. c.ellipse(190, h * 0.5 - buttonSize * 0.5, buttonSize, buttonSize);
  72. c.fillAndStroke();
  73. c.setStrokeColor(strokeColor3);
  74. c.setFillColor(fillColor3);
  75. // start
  76. var t = h * 0.5 - controlBarHeight * 0.5;
  77. c.begin();
  78. c.moveTo(16, t + 10);
  79. c.lineTo(16, t + 20);
  80. c.lineTo(18, t + 20);
  81. c.lineTo(18, t + 10);
  82. c.close();
  83. c.moveTo(20, t + 15);
  84. c.lineTo(25, t + 20);
  85. c.lineTo(25, t + 10);
  86. c.close();
  87. c.fillAndStroke();
  88. // rewind
  89. c.begin();
  90. c.moveTo(44, t + 15);
  91. c.lineTo(49, t + 20);
  92. c.lineTo(49, t + 10);
  93. c.close();
  94. c.moveTo(51, t + 15);
  95. c.lineTo(56, t + 20);
  96. c.lineTo(56, t + 10);
  97. c.close();
  98. c.fillAndStroke();
  99. // back
  100. c.begin();
  101. c.moveTo(77, t + 15);
  102. c.lineTo(82, t + 20);
  103. c.lineTo(82, t + 10);
  104. c.close();
  105. c.fillAndStroke();
  106. // play/pause
  107. c.begin();
  108. c.moveTo(108, t + 10);
  109. c.lineTo(108, t + 20);
  110. c.lineTo(110, t + 20);
  111. c.lineTo(110, t + 10);
  112. c.close();
  113. c.moveTo(117, t + 15);
  114. c.lineTo(112, t + 20);
  115. c.lineTo(112, t + 10);
  116. c.close();
  117. c.fillAndStroke();
  118. // forward
  119. c.begin();
  120. c.moveTo(144, t + 15);
  121. c.lineTo(139, t + 20);
  122. c.lineTo(139, t + 10);
  123. c.close();
  124. c.fillAndStroke();
  125. // fast forward
  126. c.begin();
  127. c.moveTo(171, t + 15);
  128. c.lineTo(166, t + 20);
  129. c.lineTo(166, t + 10);
  130. c.close();
  131. c.moveTo(178, t + 15);
  132. c.lineTo(173, t + 20);
  133. c.lineTo(173, t + 10);
  134. c.close();
  135. c.fillAndStroke();
  136. // end
  137. c.begin();
  138. c.moveTo(203, t + 10);
  139. c.lineTo(203, t + 20);
  140. c.lineTo(205, t + 20);
  141. c.lineTo(205, t + 10);
  142. c.close();
  143. c.moveTo(201, t + 15);
  144. c.lineTo(196, t + 20);
  145. c.lineTo(196, t + 10);
  146. c.close();
  147. c.fillAndStroke();
  148. };
  149. mxCellRenderer.prototype.defaultShapes[mxShapeMockupPlaybackControls.prototype.cst.SHAPE_PLAYBACK_CONTROLS] = mxShapeMockupPlaybackControls;
  150. //**********************************************************************************************************************************************************
  151. //Progress Bar
  152. //**********************************************************************************************************************************************************
  153. /**
  154. * Extends mxShape.
  155. */
  156. function mxShapeMockupProgressBar(bounds, fill, stroke, strokewidth)
  157. {
  158. mxShape.call(this);
  159. this.bounds = bounds;
  160. this.fill = fill;
  161. this.stroke = stroke;
  162. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  163. this.barPos = 20;
  164. };
  165. /**
  166. * Extends mxShape.
  167. */
  168. mxUtils.extend(mxShapeMockupProgressBar, mxShape);
  169. mxShapeMockupProgressBar.prototype.cst = {
  170. SHAPE_PROGRESS_BAR : 'mxgraph.mockup.misc.progressBar',
  171. BAR_POS : 'barPos',
  172. FILL_COLOR2 : 'fillColor2'
  173. };
  174. /**
  175. * Function: paintVertexShape
  176. *
  177. * Paints the vertex shape.
  178. */
  179. mxShapeMockupProgressBar.prototype.paintVertexShape = function(c, x, y, w, h)
  180. {
  181. c.translate(x, y);
  182. this.background(c, w, h);
  183. c.setShadow(false);
  184. this.foreground(c, w, h);
  185. };
  186. mxShapeMockupProgressBar.prototype.background = function(c, w, h)
  187. {
  188. c.roundrect(0, h * 0.5 - 5, w, 10, 5, 5);
  189. c.fillAndStroke();
  190. };
  191. mxShapeMockupProgressBar.prototype.foreground = function(c, w, h)
  192. {
  193. var fillColor2 = mxUtils.getValue(this.style, mxShapeMockupProgressBar.prototype.cst.FILL_COLOR2, '#ddeeff');
  194. var barPos = mxUtils.getValue(this.style, mxShapeMockupProgressBar.prototype.cst.BAR_POS, '80');
  195. barPos = Math.min(barPos, 100);
  196. barPos = Math.max(barPos, 0);
  197. var deadzone = 0;
  198. var virRange = w - 2 * deadzone;
  199. var truePos = deadzone + virRange * barPos / 100;
  200. c.setFillColor(fillColor2);
  201. c.roundrect(0, h * 0.5 - 5, truePos, 10, 5, 5);
  202. c.fillAndStroke();
  203. };
  204. mxCellRenderer.prototype.defaultShapes[mxShapeMockupProgressBar.prototype.cst.SHAPE_PROGRESS_BAR] = mxShapeMockupProgressBar;
  205. Graph.handleFactory[mxShapeMockupProgressBar.prototype.cst.SHAPE_PROGRESS_BAR] = function(state)
  206. {
  207. var handles = [Graph.createHandle(state, ['barPos'], function(bounds)
  208. {
  209. var barPos = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'barPos', this.barPos))));
  210. return new mxPoint(bounds.x + barPos * bounds.width / 100, bounds.y + bounds.height * 0.5);
  211. }, function(bounds, pt)
  212. {
  213. this.state.style['barPos'] = Math.round(1000 * Math.max(0, Math.min(100, (pt.x - bounds.x) * 100 / bounds.width))) / 1000;
  214. })];
  215. return handles;
  216. }
  217. //**********************************************************************************************************************************************************
  218. //Shopping Cart
  219. //**********************************************************************************************************************************************************
  220. /**
  221. * Extends mxShape.
  222. */
  223. function mxShapeMockupShoppingCart(bounds, fill, stroke, strokewidth)
  224. {
  225. mxShape.call(this);
  226. this.bounds = bounds;
  227. this.fill = fill;
  228. this.stroke = stroke;
  229. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  230. };
  231. /**
  232. * Extends mxShape.
  233. */
  234. mxUtils.extend(mxShapeMockupShoppingCart, mxShape);
  235. mxShapeMockupShoppingCart.prototype.cst = {
  236. SHAPE_SHOPPING_CART : 'mxgraph.mockup.misc.shoppingCart'
  237. };
  238. /**
  239. * Function: paintVertexShape
  240. *
  241. * Paints the vertex shape.
  242. */
  243. mxShapeMockupShoppingCart.prototype.paintVertexShape = function(c, x, y, w, h)
  244. {
  245. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  246. c.translate(x, y);
  247. c.setStrokeWidth(3);
  248. c.begin();
  249. c.moveTo(w * 0.975, h * 0.025);
  250. c.lineTo(w * 0.82, h * 0.055);
  251. c.lineTo(w * 0.59, h * 0.66);
  252. c.lineTo(w * 0.7, h * 0.765);
  253. c.arcTo(w * 0.06, h * 0.06, 0, 0, 1, w * 0.665, h * 0.86);
  254. c.lineTo(w * 0.05, h * 0.86);
  255. c.moveTo(w * 0.74, h * 0.26);
  256. c.lineTo(w * 0.03, h * 0.28);
  257. c.lineTo(w * 0.065, h * 0.61);
  258. c.lineTo(w * 0.59, h * 0.66);
  259. c.stroke();
  260. c.setStrokeWidth(1);
  261. c.begin();
  262. c.moveTo(w * 0.15, h * 0.28);
  263. c.lineTo(w * 0.15, h * 0.62);
  264. c.moveTo(w * 0.265, h * 0.275);
  265. c.lineTo(w * 0.265, h * 0.63);
  266. c.moveTo(w * 0.38, h * 0.27);
  267. c.lineTo(w * 0.38, h * 0.64);
  268. c.moveTo(w * 0.495, h * 0.265);
  269. c.lineTo(w * 0.495, h * 0.65);
  270. c.moveTo(w * 0.61, h * 0.265);
  271. c.lineTo(w * 0.61, h * 0.61);
  272. c.stroke();
  273. c.begin();
  274. c.moveTo(w * 0.69, h * 0.405);
  275. c.lineTo(w * 0.045, h * 0.405);
  276. c.moveTo(w * 0.645, h * 0.52);
  277. c.lineTo(w * 0.055, h * 0.52);
  278. c.stroke();
  279. c.setFillColor(strokeColor);
  280. c.ellipse(w * 0.075, h * 0.89, w * 0.1, h * 0.1);
  281. c.fillAndStroke();
  282. c.ellipse(w * 0.62, h * 0.89, w * 0.1, h * 0.1);
  283. c.fillAndStroke();
  284. };
  285. mxCellRenderer.prototype.defaultShapes[mxShapeMockupShoppingCart.prototype.cst.SHAPE_SHOPPING_CART] = mxShapeMockupShoppingCart;
  286. //**********************************************************************************************************************************************************
  287. //Rating
  288. //**********************************************************************************************************************************************************
  289. /**
  290. * Extends mxShape.
  291. */
  292. function mxShapeMockupRating(bounds, fill, stroke, strokewidth)
  293. {
  294. mxShape.call(this);
  295. this.bounds = bounds;
  296. this.fill = fill;
  297. this.stroke = stroke;
  298. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  299. };
  300. /**
  301. * Extends mxShape.
  302. */
  303. mxUtils.extend(mxShapeMockupRating, mxShape);
  304. mxShapeMockupRating.prototype.cst = {
  305. SHAPE_RATING : 'mxgraph.mockup.misc.rating',
  306. RATING_STYLE : 'ratingStyle',
  307. RATING_SCALE : 'ratingScale',
  308. RATING_HEART : 'heart',
  309. RATING_STAR : 'star',
  310. EMPTY_FILL_COLOR : 'emptyFillColor',
  311. GRADE : 'grade'
  312. };
  313. /**
  314. * Function: paintVertexShape
  315. *
  316. * Paints the vertex shape.
  317. */
  318. mxShapeMockupRating.prototype.paintVertexShape = function(c, x, y, w, h)
  319. {
  320. var ratingStyle = mxUtils.getValue(this.style, mxShapeMockupRating.prototype.cst.RATING_STYLE, mxShapeMockupRating.prototype.cst.RATING_STAR);
  321. var grade = mxUtils.getValue(this.style, mxShapeMockupRating.prototype.cst.GRADE, '5');
  322. var ratingScale = mxUtils.getValue(this.style, mxShapeMockupRating.prototype.cst.RATING_SCALE, '10');
  323. c.translate(x, y);
  324. if (ratingStyle === mxShapeMockupRating.prototype.cst.RATING_STAR)
  325. {
  326. for (var i = 0; i < grade; i++)
  327. {
  328. c.begin();
  329. c.moveTo(i * h * 1.5, 0.33 * h);
  330. c.lineTo(i * h * 1.5 + 0.364 * h, 0.33 * h);
  331. c.lineTo(i * h * 1.5 + 0.475 * h, 0);
  332. c.lineTo(i * h * 1.5 + 0.586 * h, 0.33 * h);
  333. c.lineTo(i * h * 1.5 + 0.95 * h, 0.33 * h);
  334. c.lineTo(i * h * 1.5 + 0.66 * h, 0.551 * h);
  335. c.lineTo(i * h * 1.5 + 0.775 * h, 0.9 * h);
  336. c.lineTo(i * h * 1.5 + 0.475 * h, 0.684 * h);
  337. c.lineTo(i * h * 1.5 + 0.175 * h, 0.9 * h);
  338. c.lineTo(i * h * 1.5 + 0.29 * h, 0.551 * h);
  339. c.close();
  340. c.fillAndStroke();
  341. }
  342. }
  343. else if (ratingStyle === mxShapeMockupRating.prototype.cst.RATING_HEART)
  344. {
  345. for (var i = 0; i < grade; i++)
  346. {
  347. c.begin();
  348. c.moveTo(i * h * 1.5 + h * 0.519, h * 0.947);
  349. c.curveTo(i * h * 1.5 + h * 0.558, h * 0.908, i * h * 1.5 + h * 0.778, h * 0.682, i * h * 1.5 + h * 0.916, h * 0.54);
  350. c.curveTo(i * h * 1.5 + h * 1.039, h * 0.414, i * h * 1.5 + h * 1.036, h * 0.229, i * h * 1.5 + h * 0.924, h * 0.115);
  351. c.curveTo(i * h * 1.5 + h * 0.812, 0, i * h * 1.5 + h * 0.631, 0, i * h * 1.5 + h * 0.519, h * 0.115);
  352. c.curveTo(i * h * 1.5 + h * 0.408, 0, i * h * 1.5 + h * 0.227, 0, i * h * 1.5 + h * 0.115, h * 0.115);
  353. c.curveTo(i * h * 1.5 + h * 0.03, h * 0.229, i * h * 1.5, h * 0.414, i * h * 1.5 + h * 0.123, h * 0.54);
  354. c.close();
  355. c.fillAndStroke();
  356. }
  357. }
  358. var emptyFillColor = mxUtils.getValue(this.style, mxShapeMockupRating.prototype.cst.EMPTY_FILL_COLOR, '#ffffff');
  359. c.setFillColor(emptyFillColor);
  360. if (ratingStyle === mxShapeMockupRating.prototype.cst.RATING_STAR)
  361. {
  362. for (var i = grade; i < ratingScale; i++)
  363. {
  364. c.begin();
  365. c.moveTo(i * h * 1.5, 0.33 * h);
  366. c.lineTo(i * h * 1.5 + 0.364 * h, 0.33 * h);
  367. c.lineTo(i * h * 1.5 + 0.475 * h, 0);
  368. c.lineTo(i * h * 1.5 + 0.586 * h, 0.33 * h);
  369. c.lineTo(i * h * 1.5 + 0.95 * h, 0.33 * h);
  370. c.lineTo(i * h * 1.5 + 0.66 * h, 0.551 * h);
  371. c.lineTo(i * h * 1.5 + 0.775 * h, 0.9 * h);
  372. c.lineTo(i * h * 1.5 + 0.475 * h, 0.684 * h);
  373. c.lineTo(i * h * 1.5 + 0.175 * h, 0.9 * h);
  374. c.lineTo(i * h * 1.5 + 0.29 * h, 0.551 * h);
  375. c.close();
  376. c.fillAndStroke();
  377. }
  378. }
  379. else if (ratingStyle === mxShapeMockupRating.prototype.cst.RATING_HEART)
  380. {
  381. for (var i = grade; i < ratingScale; i++)
  382. {
  383. c.begin();
  384. c.moveTo(i * h * 1.5 + h * 0.519, h * 0.947);
  385. c.curveTo(i * h * 1.5 + h * 0.558, h * 0.908, i * h * 1.5 + h * 0.778, h * 0.682, i * h * 1.5 + h * 0.916, h * 0.54);
  386. c.curveTo(i * h * 1.5 + h * 1.039, h * 0.414, i * h * 1.5 + h * 1.036, h * 0.229, i * h * 1.5 + h * 0.924, h * 0.115);
  387. c.curveTo(i * h * 1.5 + h * 0.812, 0, i * h * 1.5 + h * 0.631, 0, i * h * 1.5 + h * 0.519, h * 0.115);
  388. c.curveTo(i * h * 1.5 + h * 0.408, 0, i * h * 1.5 + h * 0.227, 0, i * h * 1.5 + h * 0.115, h * 0.115);
  389. c.curveTo(i * h * 1.5 + h * 0.03, h * 0.229, i * h * 1.5, h * 0.414, i * h * 1.5 + h * 0.123, h * 0.54);
  390. c.close();
  391. c.fillAndStroke();
  392. }
  393. }
  394. };
  395. mxCellRenderer.prototype.defaultShapes[mxShapeMockupRating.prototype.cst.SHAPE_RATING] = mxShapeMockupRating;
  396. //**********************************************************************************************************************************************************
  397. //Mail
  398. //**********************************************************************************************************************************************************
  399. /**
  400. * Extends mxShape.
  401. */
  402. function mxShapeMockupMail(bounds, fill, stroke, strokewidth)
  403. {
  404. mxShape.call(this);
  405. this.bounds = bounds;
  406. this.fill = fill;
  407. this.stroke = stroke;
  408. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  409. };
  410. /**
  411. * Extends mxShape.
  412. */
  413. mxUtils.extend(mxShapeMockupMail, mxShape);
  414. mxShapeMockupMail.prototype.cst = {
  415. SHAPE_MAIL : 'mxgraph.mockup.misc.mail2'
  416. };
  417. /**
  418. * Function: paintVertexShape
  419. *
  420. * Paints the vertex shape.
  421. */
  422. mxShapeMockupMail.prototype.paintVertexShape = function(c, x, y, w, h)
  423. {
  424. c.translate(x, y);
  425. c.rect(0, 0, w, h);
  426. c.fillAndStroke();
  427. c.setShadow(false);
  428. c.begin();
  429. c.moveTo(0, 0);
  430. c.lineTo(w * 0.5, h * 0.5);
  431. c.lineTo(w, 0);
  432. c.stroke();
  433. };
  434. mxCellRenderer.prototype.defaultShapes[mxShapeMockupMail.prototype.cst.SHAPE_MAIL] = mxShapeMockupMail;
  435. //**********************************************************************************************************************************************************
  436. //Volume Slider
  437. //**********************************************************************************************************************************************************
  438. /**
  439. * Extends mxShape.
  440. */
  441. function mxShapeMockupVolumeSlider(bounds, fill, stroke, strokewidth)
  442. {
  443. mxShape.call(this);
  444. this.bounds = bounds;
  445. this.fill = fill;
  446. this.stroke = stroke;
  447. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  448. this.barPos = 80;
  449. };
  450. /**
  451. * Extends mxShape.
  452. */
  453. mxUtils.extend(mxShapeMockupVolumeSlider, mxShape);
  454. mxShapeMockupVolumeSlider.prototype.cst = {
  455. SHAPE_VOLUME_SLIDER : 'mxgraph.mockup.misc.volumeSlider',
  456. BAR_POS : 'barPos',
  457. FILL_COLOR2 : 'fillColor2'
  458. };
  459. /**
  460. * Function: paintVertexShape
  461. *
  462. * Paints the vertex shape.
  463. */
  464. mxShapeMockupVolumeSlider.prototype.paintVertexShape = function(c, x, y, w, h)
  465. {
  466. c.translate(x, y);
  467. var barPos = mxUtils.getValue(this.style, mxShapeMockupVolumeSlider.prototype.cst.BAR_POS, '80');
  468. var fillColor2 = mxUtils.getValue(this.style, mxShapeMockupVolumeSlider.prototype.cst.FILL_COLOR2, '#ddeeff');
  469. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#999999');
  470. //only the progress bar handle needs to be drawn
  471. barPos = Math.min(barPos, 100);
  472. barPos = Math.max(barPos, 0);
  473. var controlBarHeight = 25;
  474. var h = Math.max(h, controlBarHeight);
  475. var w = Math.max(w, 3.5 * controlBarHeight);
  476. var speakerStartX = w - controlBarHeight;
  477. var speakerStartY = (h - controlBarHeight) * 0.5;
  478. c.begin();
  479. c.moveTo(speakerStartX + controlBarHeight * 0.05, speakerStartY + controlBarHeight * 0.35);
  480. c.lineTo(speakerStartX + controlBarHeight * 0.15, speakerStartY + controlBarHeight * 0.35);
  481. c.lineTo(speakerStartX + controlBarHeight * 0.3, speakerStartY + controlBarHeight * 0.2);
  482. c.lineTo(speakerStartX + controlBarHeight * 0.3, speakerStartY + controlBarHeight * 0.8);
  483. c.lineTo(speakerStartX + controlBarHeight * 0.15, speakerStartY + controlBarHeight * 0.65);
  484. c.lineTo(speakerStartX + controlBarHeight * 0.05, speakerStartY + controlBarHeight * 0.65);
  485. c.close();
  486. c.fill();
  487. //draw the handle based on barPos
  488. var barMin = 0;
  489. var barMax = w - controlBarHeight * 1.3;
  490. var videoBarStartY = (h - controlBarHeight) * 0.5;
  491. var barRange = barMax - barMin;
  492. var barPos = barRange * barPos / 100;
  493. var barEnd = barMin + barPos;
  494. var soundStartX = w - controlBarHeight;
  495. var soundStartY = (h - controlBarHeight) * 0.5;
  496. c.begin();
  497. c.moveTo(soundStartX + controlBarHeight * 0.4, soundStartY + controlBarHeight * 0.35);
  498. c.arcTo(controlBarHeight * 0.2, controlBarHeight * 0.3, 0, 0, 1, soundStartX + controlBarHeight * 0.4, soundStartY + controlBarHeight * 0.65);
  499. c.moveTo(soundStartX + controlBarHeight * 0.425, soundStartY + controlBarHeight * 0.25);
  500. c.arcTo(controlBarHeight * 0.225, controlBarHeight * 0.35, 0, 0, 1, soundStartX + controlBarHeight * 0.425, soundStartY + controlBarHeight * 0.75);
  501. c.moveTo(soundStartX + controlBarHeight * 0.5, soundStartY + controlBarHeight * 0.2);
  502. c.arcTo(controlBarHeight * 0.25, controlBarHeight * 0.4, 0, 0, 1, soundStartX + controlBarHeight * 0.5, soundStartY + controlBarHeight * 0.8);
  503. c.fillAndStroke();
  504. //now we draw the video progress bar
  505. var videoBarStartX = 0;
  506. var videoBarStartY = (h - controlBarHeight) * 0.5;
  507. var videoBarEndX = w - controlBarHeight * 1.3;
  508. c.roundrect(videoBarStartX, videoBarStartY + controlBarHeight * 0.35, videoBarEndX, controlBarHeight * 0.3, 5, 5);
  509. c.fill();
  510. c.setShadow(false);
  511. c.setFillColor(fillColor2);
  512. c.roundrect(barMin, videoBarStartY + controlBarHeight * 0.35, barEnd, controlBarHeight * 0.3, 5, 5);
  513. c.fill();
  514. c.ellipse(barEnd - controlBarHeight * 0.25, videoBarStartY + controlBarHeight * 0.25, controlBarHeight * 0.5, controlBarHeight * 0.5);
  515. c.fillAndStroke();
  516. };
  517. mxCellRenderer.prototype.defaultShapes[mxShapeMockupVolumeSlider.prototype.cst.SHAPE_VOLUME_SLIDER] = mxShapeMockupVolumeSlider;
  518. Graph.handleFactory[mxShapeMockupVolumeSlider.prototype.cst.SHAPE_VOLUME_SLIDER] = function(state)
  519. {
  520. var handles = [Graph.createHandle(state, ['barPos'], function(bounds)
  521. {
  522. var barPos = Math.max(0, Math.min(100, parseFloat(mxUtils.getValue(this.state.style, 'barPos', this.barPos))));
  523. return new mxPoint(bounds.x + barPos * (bounds.width - 32.5) / 100, bounds.y + bounds.height * 0.5);
  524. }, function(bounds, pt)
  525. {
  526. this.state.style['barPos'] = Math.round(1000 * Math.max(0, Math.min(100, (pt.x - bounds.x) * 100 / bounds.width))) / 1000;
  527. })];
  528. return handles;
  529. }
  530. //**********************************************************************************************************************************************************
  531. //Edit Icon
  532. //**********************************************************************************************************************************************************
  533. /**
  534. * Extends mxShape.
  535. */
  536. function mxShapeMockupEdit(bounds, fill, stroke, strokewidth)
  537. {
  538. mxShape.call(this);
  539. this.bounds = bounds;
  540. this.fill = fill;
  541. this.stroke = stroke;
  542. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  543. };
  544. /**
  545. * Extends mxShape.
  546. */
  547. mxUtils.extend(mxShapeMockupEdit, mxShape);
  548. mxShapeMockupEdit.prototype.cst = {
  549. SHAPE_EDIT : 'mxgraph.mockup.misc.editIcon'
  550. };
  551. /**
  552. * Function: paintVertexShape
  553. *
  554. * Paints the vertex shape.
  555. */
  556. mxShapeMockupEdit.prototype.paintVertexShape = function(c, x, y, w, h)
  557. {
  558. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#999999');
  559. c.translate(x, y);
  560. c.roundrect(0, 0, w, h, w * 0.05, h * 0.05);
  561. c.fillAndStroke();
  562. c.setShadow(false);
  563. c.setFillColor(strokeColor);
  564. c.begin();
  565. c.moveTo(w * 0.11, h * 0.8);
  566. c.lineTo(w * 0.2, h * 0.89);
  567. c.lineTo(w * 0.05, h * 0.95);
  568. c.close();
  569. c.moveTo(w * 0.74, h * 0.16);
  570. c.lineTo(w * 0.84, h * 0.26);
  571. c.lineTo(w * 0.22, h * 0.88);
  572. c.lineTo(w * 0.12, h * 0.78);
  573. c.close();
  574. c.moveTo(w * 0.755, h * 0.145);
  575. c.lineTo(w * 0.82, h * 0.08);
  576. c.lineTo(w * 0.92, h * 0.18);
  577. c.lineTo(w * 0.855, h * 0.245);
  578. c.close();
  579. c.fill();
  580. };
  581. mxCellRenderer.prototype.defaultShapes[mxShapeMockupEdit.prototype.cst.SHAPE_EDIT] = mxShapeMockupEdit;
  582. //**********************************************************************************************************************************************************
  583. //Print Icon
  584. //**********************************************************************************************************************************************************
  585. /**
  586. * Extends mxShape.
  587. */
  588. function mxShapeMockupPrint(bounds, fill, stroke, strokewidth)
  589. {
  590. mxShape.call(this);
  591. this.bounds = bounds;
  592. this.fill = fill;
  593. this.stroke = stroke;
  594. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  595. };
  596. /**
  597. * Extends mxShape.
  598. */
  599. mxUtils.extend(mxShapeMockupPrint, mxShape);
  600. mxShapeMockupPrint.prototype.cst = {
  601. SHAPE_PRINT : 'mxgraph.mockup.misc.printIcon'
  602. };
  603. /**
  604. * Function: paintVertexShape
  605. *
  606. * Paints the vertex shape.
  607. */
  608. mxShapeMockupPrint.prototype.paintVertexShape = function(c, x, y, w, h)
  609. {
  610. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#999999');
  611. c.translate(x, y);
  612. c.roundrect(0, 0, w, h, w * 0.05, h * 0.05);
  613. c.fillAndStroke();
  614. c.setShadow(false);
  615. c.setFillColor(strokeColor);
  616. c.begin();
  617. c.moveTo(w * 0.15, h * 0.58);
  618. c.arcTo(w * 0.03, h * 0.03, 0, 0, 1, w * 0.18, h * 0.55);
  619. c.lineTo(w * 0.82, h * 0.55);
  620. c.arcTo(w * 0.03, h * 0.03, 0, 0, 1, w * 0.85, h * 0.58);
  621. c.lineTo(w * 0.85, h * 0.82);
  622. c.arcTo(w * 0.03, h * 0.03, 0, 0, 1, w * 0.82, h * 0.85);
  623. c.lineTo(w * 0.18, h * 0.85);
  624. c.arcTo(w * 0.03, h * 0.03, 0, 0, 1, w * 0.15, h * 0.82);
  625. c.close();
  626. c.moveTo(w * 0.7, h * 0.52);
  627. c.lineTo(w * 0.3, h * 0.52);
  628. c.lineTo(w * 0.3, h * 0.15);
  629. c.lineTo(w * 0.55, h * 0.15);
  630. c.lineTo(w * 0.55, h * 0.3);
  631. c.lineTo(w * 0.7, h * 0.3);
  632. c.close();
  633. c.moveTo(w * 0.57, h * 0.15);
  634. c.lineTo(w * 0.7, h * 0.28);
  635. c.lineTo(w * 0.57, h * 0.28);
  636. c.close();
  637. c.fill();
  638. };
  639. mxCellRenderer.prototype.defaultShapes[mxShapeMockupPrint.prototype.cst.SHAPE_PRINT] = mxShapeMockupPrint;
  640. //**********************************************************************************************************************************************************
  641. //Print Icon
  642. //**********************************************************************************************************************************************************
  643. /**
  644. * Extends mxShape.
  645. */
  646. function mxShapeMockupShare(bounds, fill, stroke, strokewidth)
  647. {
  648. mxShape.call(this);
  649. this.bounds = bounds;
  650. this.fill = fill;
  651. this.stroke = stroke;
  652. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  653. };
  654. /**
  655. * Extends mxShape.
  656. */
  657. mxUtils.extend(mxShapeMockupShare, mxShape);
  658. mxShapeMockupShare.prototype.cst = {
  659. SHAPE_SHARE : 'mxgraph.mockup.misc.shareIcon'
  660. };
  661. /**
  662. * Function: paintVertexShape
  663. *
  664. * Paints the vertex shape.
  665. */
  666. mxShapeMockupShare.prototype.paintVertexShape = function(c, x, y, w, h)
  667. {
  668. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#999999');
  669. c.translate(x, y);
  670. c.roundrect(0, 0, w, h, w * 0.05, h * 0.05);
  671. c.fillAndStroke();
  672. c.setShadow(false);
  673. c.setFillColor(strokeColor);
  674. c.begin();
  675. c.moveTo(w * 0.15, h * 0.18);
  676. c.arcTo(w * 0.03, h * 0.03, 0, 0, 1, w * 0.18, h * 0.15);
  677. c.lineTo(w * 0.82, h * 0.15);
  678. c.arcTo(w * 0.03, h * 0.03, 0, 0, 1, w * 0.85, h * 0.18);
  679. c.lineTo(w * 0.85, h * 0.82);
  680. c.arcTo(w * 0.03, h * 0.03, 0, 0, 1, w * 0.82, h * 0.85);
  681. c.lineTo(w * 0.18, h * 0.85);
  682. c.arcTo(w * 0.03, h * 0.03, 0, 0, 1, w * 0.15, h * 0.82);
  683. c.close();
  684. c.fill();
  685. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  686. c.setFillColor(fillColor);
  687. c.begin();
  688. c.moveTo(w * 0.563, h * 0.34);
  689. c.arcTo(w * 0.095, h * 0.095, 0, 1, 1, w * 0.603, h * 0.42);
  690. c.lineTo(w * 0.44, h * 0.5);
  691. c.lineTo(w * 0.602, h * 0.582);
  692. c.arcTo(w * 0.095, h * 0.095, 0, 1, 1, w * 0.563, h * 0.653);
  693. c.lineTo(w * 0.403, h * 0.575);
  694. c.arcTo(w * 0.095, h * 0.095, 0, 1, 1, w * 0.4, h * 0.42);
  695. c.close();
  696. c.fill();
  697. };
  698. mxCellRenderer.prototype.defaultShapes[mxShapeMockupShare.prototype.cst.SHAPE_SHARE] = mxShapeMockupShare;
  699. //**********************************************************************************************************************************************************
  700. //Trashcan Icon
  701. //**********************************************************************************************************************************************************
  702. /**
  703. * Extends mxShape.
  704. */
  705. function mxShapeMockupTrashcan(bounds, fill, stroke, strokewidth)
  706. {
  707. mxShape.call(this);
  708. this.bounds = bounds;
  709. this.fill = fill;
  710. this.stroke = stroke;
  711. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  712. };
  713. /**
  714. * Extends mxShape.
  715. */
  716. mxUtils.extend(mxShapeMockupTrashcan, mxShape);
  717. mxShapeMockupTrashcan.prototype.cst = {
  718. SHAPE_TRASHCAN : 'mxgraph.mockup.misc.trashcanIcon'
  719. };
  720. /**
  721. * Function: paintVertexShape
  722. *
  723. * Paints the vertex shape.
  724. */
  725. mxShapeMockupTrashcan.prototype.paintVertexShape = function(c, x, y, w, h)
  726. {
  727. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#999999');
  728. c.translate(x, y);
  729. c.roundrect(0, 0, w, h, w * 0.05, h * 0.05);
  730. c.fillAndStroke();
  731. c.setShadow(false);
  732. c.setFillColor(strokeColor);
  733. c.begin();
  734. c.moveTo(w * 0.24, h * 0.24);
  735. c.arcTo(w * 0.04, h * 0.04, 0, 0, 1, w * 0.24, h * 0.16);
  736. c.lineTo(w * 0.4, h * 0.16);
  737. c.lineTo(w * 0.4, h * 0.12);
  738. c.lineTo(w * 0.6, h * 0.12);
  739. c.lineTo(w * 0.6, h * 0.16);
  740. c.lineTo(w * 0.76, h * 0.16);
  741. c.arcTo(w * 0.04, h * 0.04, 0, 0, 1, w * 0.76, h * 0.24);
  742. c.close();
  743. c.fill();
  744. c.roundrect(w * 0.26, h * 0.3, w * 0.1, h * 0.6, w * 0.06, h * 0.06);
  745. c.fill();
  746. c.roundrect(w * 0.44, h * 0.3, w * 0.1, h * 0.6, w * 0.06, h * 0.06);
  747. c.fill();
  748. c.roundrect(w * 0.62, h * 0.3, w * 0.1, h * 0.6, w * 0.06, h * 0.06);
  749. c.fill();
  750. };
  751. mxCellRenderer.prototype.defaultShapes[mxShapeMockupTrashcan.prototype.cst.SHAPE_TRASHCAN] = mxShapeMockupTrashcan;
  752. //**********************************************************************************************************************************************************
  753. //Copyright Icon
  754. //**********************************************************************************************************************************************************
  755. /**
  756. * Extends mxShape.
  757. */
  758. function mxShapeMockupCopyright(bounds, fill, stroke, strokewidth)
  759. {
  760. mxShape.call(this);
  761. this.bounds = bounds;
  762. this.fill = fill;
  763. this.stroke = stroke;
  764. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  765. };
  766. /**
  767. * Extends mxShape.
  768. */
  769. mxUtils.extend(mxShapeMockupCopyright, mxShape);
  770. mxShapeMockupCopyright.prototype.cst = {
  771. SHAPE_COPYRIGHT : 'mxgraph.mockup.misc.copyrightIcon'
  772. };
  773. /**
  774. * Function: paintVertexShape
  775. *
  776. * Paints the vertex shape.
  777. */
  778. mxShapeMockupCopyright.prototype.paintVertexShape = function(c, x, y, w, h)
  779. {
  780. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#999999');
  781. c.translate(x, y);
  782. c.ellipse(0, 0, w, h);
  783. c.fillAndStroke();
  784. c.setShadow(false);
  785. c.setFillColor(strokeColor);
  786. c.begin();
  787. c.moveTo(w * 0.713, h * 0.288);
  788. c.arcTo(w * 0.3, h * 0.3, 0, 1, 0, w * 0.713, h * 0.712);
  789. c.lineTo(w * 0.784, h * 0.783);
  790. c.arcTo(w * 0.4, h * 0.4, 0, 1, 1, w * 0.784, h * 0.217);
  791. c.close();
  792. c.fill();
  793. };
  794. mxCellRenderer.prototype.defaultShapes[mxShapeMockupCopyright.prototype.cst.SHAPE_COPYRIGHT] = mxShapeMockupCopyright;
  795. //**********************************************************************************************************************************************************
  796. //Registered Icon
  797. //**********************************************************************************************************************************************************
  798. /**
  799. * Extends mxShape.
  800. */
  801. function mxShapeMockupRegistered(bounds, fill, stroke, strokewidth)
  802. {
  803. mxShape.call(this);
  804. this.bounds = bounds;
  805. this.fill = fill;
  806. this.stroke = stroke;
  807. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  808. };
  809. /**
  810. * Extends mxShape.
  811. */
  812. mxUtils.extend(mxShapeMockupRegistered, mxShape);
  813. mxShapeMockupRegistered.prototype.cst = {
  814. SHAPE_REGISTERED : 'mxgraph.mockup.misc.registeredIcon'
  815. };
  816. /**
  817. * Function: paintVertexShape
  818. *
  819. * Paints the vertex shape.
  820. */
  821. mxShapeMockupRegistered.prototype.paintVertexShape = function(c, x, y, w, h)
  822. {
  823. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#999999');
  824. c.translate(x, y);
  825. c.ellipse(0, 0, w, h);
  826. c.fillAndStroke();
  827. c.setShadow(false);
  828. c.setFillColor(strokeColor);
  829. c.begin();
  830. c.moveTo(w * 0.29, h * 0.9);
  831. c.lineTo(w * 0.29, h * 0.09);
  832. c.lineTo(w * 0.5, h * 0.09);
  833. c.arcTo(w * 0.2195, h * 0.2195, 0, 0, 1, w * 0.545, h * 0.525);
  834. c.lineTo(w * 0.738, h * 0.91);
  835. c.lineTo(w * 0.674, h * 0.91);
  836. c.lineTo(w * 0.4825, h * 0.53);
  837. c.lineTo(w * 0.35, h * 0.53);
  838. c.lineTo(w * 0.35, h * 0.9);
  839. c.close();
  840. c.moveTo(w * 0.35, h * 0.47);
  841. c.lineTo(w * 0.5, h * 0.47);
  842. c.arcTo(w * 0.15, h * 0.15, 0, 0, 0, w * 0.5, h * 0.15);
  843. c.lineTo(w * 0.35, h * 0.15);
  844. c.close();
  845. c.fill();
  846. };
  847. mxCellRenderer.prototype.defaultShapes[mxShapeMockupRegistered.prototype.cst.SHAPE_REGISTERED] = mxShapeMockupRegistered;
  848. //**********************************************************************************************************************************************************
  849. //Volume Icon
  850. //**********************************************************************************************************************************************************
  851. /**
  852. * Extends mxShape.
  853. */
  854. function mxShapeMockupVolume(bounds, fill, stroke, strokewidth)
  855. {
  856. mxShape.call(this);
  857. this.bounds = bounds;
  858. this.fill = fill;
  859. this.stroke = stroke;
  860. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  861. };
  862. /**
  863. * Extends mxShape.
  864. */
  865. mxUtils.extend(mxShapeMockupVolume, mxShape);
  866. mxShapeMockupVolume.prototype.cst = {
  867. SHAPE_VOLUME : 'mxgraph.mockup.misc.volumeIcon'
  868. };
  869. /**
  870. * Function: paintVertexShape
  871. *
  872. * Paints the vertex shape.
  873. */
  874. mxShapeMockupVolume.prototype.paintVertexShape = function(c, x, y, w, h)
  875. {
  876. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#999999');
  877. c.translate(x, y);
  878. c.roundrect(0, 0, w, h, w * 0.05, h * 0.05);
  879. c.fillAndStroke();
  880. c.setShadow(false);
  881. c.setFillColor(strokeColor);
  882. c.begin();
  883. c.moveTo(w * 0.1, h * 0.3);
  884. c.lineTo(w * 0.3, h * 0.3);
  885. c.lineTo(w * 0.5, h * 0.15);
  886. c.lineTo(w * 0.5, h * 0.85);
  887. c.lineTo(w * 0.3, h * 0.7);
  888. c.lineTo(w * 0.1, h * 0.7);
  889. c.close();
  890. c.fill();
  891. c.begin();
  892. c.moveTo(w * 0.6, h * 0.4);
  893. c.arcTo(w * 0.2, h * 0.2, 0, 0, 1, w * 0.6, h * 0.6);
  894. c.moveTo(w * 0.7, h * 0.3);
  895. c.arcTo(w * 0.3, h * 0.3, 0, 0, 1, w * 0.7, h * 0.7);
  896. c.moveTo(w * 0.8, h * 0.2);
  897. c.arcTo(w * 0.4, h * 0.4, 0, 0, 1, w * 0.8, h * 0.8);
  898. c.stroke();
  899. };
  900. mxCellRenderer.prototype.defaultShapes[mxShapeMockupVolume.prototype.cst.SHAPE_VOLUME] = mxShapeMockupVolume;
  901. //**********************************************************************************************************************************************************
  902. //Ruler
  903. //**********************************************************************************************************************************************************
  904. /**
  905. * Extends mxShape.
  906. */
  907. function mxShapeMockupRuler(bounds, fill, stroke, strokewidth)
  908. {
  909. mxShape.call(this);
  910. this.bounds = bounds;
  911. this.fill = fill;
  912. this.stroke = stroke;
  913. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  914. };
  915. /**
  916. * Extends mxShape.
  917. */
  918. mxUtils.extend(mxShapeMockupRuler, mxShape);
  919. mxShapeMockupRuler.prototype.cst = {
  920. SHAPE_RULER : 'mxgraph.mockup.misc.ruler',
  921. ORIENTATION : 'rulerOrient',
  922. UNIT_SIZE : 'unitSize',
  923. FACE_UP : 'up',
  924. FACE_DOWN : 'down'
  925. };
  926. /**
  927. * Function: paintVertexShape
  928. *
  929. * Paints the vertex shape.
  930. */
  931. mxShapeMockupRuler.prototype.paintVertexShape = function(c, x, y, w, h)
  932. {
  933. c.translate(x, y);
  934. this.background(c, w, h);
  935. c.setShadow(false);
  936. this.foreground(c, w, h);
  937. };
  938. mxShapeMockupRuler.prototype.background = function(c, w, h)
  939. {
  940. c.rect(0, 0, w, h);
  941. c.fillAndStroke();
  942. };
  943. mxShapeMockupRuler.prototype.foreground = function(c, w, h)
  944. {
  945. var facing = mxUtils.getValue(this.style, mxShapeMockupRuler.prototype.cst.ORIENTATION, mxShapeMockupRuler.prototype.cst.FACE_DOWN);
  946. var unitSize = mxUtils.getValue(this.style, mxShapeMockupRuler.prototype.cst.UNIT_SIZE, '10');
  947. unitSize = Math.max(unitSize, 1);
  948. var currX = unitSize;
  949. var i = 1;
  950. if (facing === mxShapeMockupRuler.prototype.cst.FACE_DOWN)
  951. {
  952. c.begin();
  953. while (currX < w)
  954. {
  955. var remainder = i % 10;
  956. if (remainder === 0)
  957. {
  958. c.moveTo(currX, h * 0.5);
  959. c.lineTo(currX, h);
  960. }
  961. else if ( remainder === 5)
  962. {
  963. c.moveTo(currX, h * 0.7);
  964. c.lineTo(currX, h);
  965. }
  966. else
  967. {
  968. c.moveTo(currX, h * 0.8);
  969. c.lineTo(currX, h);
  970. }
  971. currX = currX + unitSize;
  972. i = i + 1;
  973. }
  974. c.stroke();
  975. }
  976. else if (facing === mxShapeMockupRuler.prototype.cst.FACE_UP)
  977. {
  978. c.begin();
  979. while (currX < w)
  980. {
  981. var remainder = i % 10;
  982. if (remainder === 0)
  983. {
  984. c.moveTo(currX, h * 0.5);
  985. c.lineTo(currX, 0);
  986. }
  987. else if ( remainder === 5)
  988. {
  989. c.moveTo(currX, h * 0.3);
  990. c.lineTo(currX, 0);
  991. }
  992. else
  993. {
  994. c.moveTo(currX, h * 0.2);
  995. c.lineTo(currX, 0);
  996. }
  997. currX = currX + unitSize;
  998. i = i + 1;
  999. }
  1000. c.stroke();
  1001. }
  1002. };
  1003. mxCellRenderer.prototype.defaultShapes[mxShapeMockupRuler.prototype.cst.SHAPE_RULER] = mxShapeMockupRuler;
  1004. //**********************************************************************************************************************************************************
  1005. //Advanced Ruler
  1006. //**********************************************************************************************************************************************************
  1007. /**
  1008. * Extends mxShape.
  1009. */
  1010. function mxShapeMockupRuler2(bounds, fill, stroke, strokewidth)
  1011. {
  1012. mxShape.call(this);
  1013. this.bounds = bounds;
  1014. this.fill = fill;
  1015. this.stroke = stroke;
  1016. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1017. };
  1018. /**
  1019. * Extends mxShape.
  1020. */
  1021. mxUtils.extend(mxShapeMockupRuler2, mxShape);
  1022. mxShapeMockupRuler2.prototype.cst = {
  1023. SHAPE_RULER : 'mxgraph.mockup.misc.ruler2',
  1024. ORIENTATION : 'rulerOrient',
  1025. UNIT_SIZE : 'unitSize',
  1026. FACE_UP : 'up',
  1027. FACE_DOWN : 'down'
  1028. };
  1029. /**
  1030. * Function: paintVertexShape
  1031. *
  1032. * Paints the vertex shape.
  1033. */
  1034. mxShapeMockupRuler2.prototype.paintVertexShape = function(c, x, y, w, h)
  1035. {
  1036. c.translate(x, y);
  1037. this.background(c, w, h);
  1038. c.setShadow(false);
  1039. this.foreground(c, w, h);
  1040. };
  1041. mxShapeMockupRuler2.prototype.background = function(c, w, h)
  1042. {
  1043. c.rect(0, 0, w, h);
  1044. c.fillAndStroke();
  1045. };
  1046. mxShapeMockupRuler2.prototype.foreground = function(c, w, h)
  1047. {
  1048. var facing = mxUtils.getValue(this.style, mxShapeMockupRuler2.prototype.cst.ORIENTATION, mxShapeMockupRuler2.prototype.cst.FACE_DOWN);
  1049. var fontColor = mxUtils.getValue(this.style, mxConstants.STYLE_FONTCOLOR, '#000000');
  1050. var dx = mxUtils.getValue(this.style, 'dx', '100');
  1051. var unitSize = dx / 10;
  1052. unitSize = Math.max(unitSize, 1);
  1053. c.setFontColor(fontColor);
  1054. var currX = unitSize;
  1055. var i = 1;
  1056. if (facing === mxShapeMockupRuler2.prototype.cst.FACE_DOWN)
  1057. {
  1058. c.begin();
  1059. while (currX < w)
  1060. {
  1061. var remainder = i % 10;
  1062. if (remainder === 0)
  1063. {
  1064. c.moveTo(currX, h - 10);
  1065. c.lineTo(currX, h);
  1066. var unit = this.state.view.graph.getLabel(this.state.cell);
  1067. if (!isNaN(unit))
  1068. {
  1069. c.stroke();
  1070. var num = i * Math.round(100 * unit) / 1000;
  1071. if (i != 10 && num != 0)
  1072. {
  1073. c.text(currX, (h - 10) * 0.5, 0, 0, num.toString(), mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1074. }
  1075. c.begin();
  1076. }
  1077. }
  1078. else if ( remainder === 5)
  1079. {
  1080. c.moveTo(currX, h - 6);
  1081. c.lineTo(currX, h);
  1082. }
  1083. else
  1084. {
  1085. c.moveTo(currX, h - 4);
  1086. c.lineTo(currX, h);
  1087. }
  1088. currX = currX + unitSize;
  1089. i = i + 1;
  1090. }
  1091. c.stroke();
  1092. }
  1093. else if (facing === mxShapeMockupRuler2.prototype.cst.FACE_UP)
  1094. {
  1095. c.begin();
  1096. while (currX < w)
  1097. {
  1098. var remainder = i % 10;
  1099. if (remainder === 0)
  1100. {
  1101. c.moveTo(currX, 10);
  1102. c.lineTo(currX, 0);
  1103. var unit = this.state.view.graph.getLabel(this.state.cell);
  1104. if (!isNaN(unit))
  1105. {
  1106. c.stroke();
  1107. var num = i * Math.round(100 * unit) / 1000;
  1108. if (i != 10 && num != 0)
  1109. {
  1110. c.text(currX, (h + 10) * 0.5, 0, 0, num.toString(), mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1111. }
  1112. c.begin();
  1113. }
  1114. }
  1115. else if ( remainder === 5)
  1116. {
  1117. c.moveTo(currX, 6);
  1118. c.lineTo(currX, 0);
  1119. }
  1120. else
  1121. {
  1122. c.moveTo(currX, 4);
  1123. c.lineTo(currX, 0);
  1124. }
  1125. currX = currX + unitSize;
  1126. i = i + 1;
  1127. }
  1128. c.stroke();
  1129. }
  1130. };
  1131. mxCellRenderer.prototype.defaultShapes[mxShapeMockupRuler2.prototype.cst.SHAPE_RULER] = mxShapeMockupRuler2;
  1132. Graph.handleFactory[mxShapeMockupRuler2.prototype.cst.SHAPE_RULER] = function(state)
  1133. {
  1134. var handles = [Graph.createHandle(state, ['dx', 'spacingLeft', 'align', 'varticalAlign', 'spacingBottom', 'spacingTop', 'spacingRight', 'spacing'], function(bounds)
  1135. {
  1136. var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));
  1137. return new mxPoint(bounds.x + dx, bounds.y + bounds.height - 10);
  1138. }, function(bounds, pt)
  1139. {
  1140. this.state.style['dx'] = Math.round(1000 * Math.max(0, Math.min(bounds.width, pt.x - bounds.x))) / 1000;
  1141. this.state.style['spacingLeft'] = Math.round(1000 * Math.max(0, Math.min(bounds.width, pt.x - bounds.x))) / 1000 - 4;
  1142. this.state.style['align'] = 'left';
  1143. this.state.style['verticalAlign'] = 'middle';
  1144. var facing = mxUtils.getValue(this.state.style, 'rulerOrient', '1');
  1145. if (facing == 'down')
  1146. {
  1147. this.state.style['spacingBottom'] = 10;
  1148. this.state.style['spacingTop'] = 0;
  1149. console.log('down');
  1150. }
  1151. else
  1152. {
  1153. this.state.style['spacingBottom'] = 0;
  1154. this.state.style['spacingTop'] = 10;
  1155. console.log('up');
  1156. }
  1157. this.state.style['spacingRight'] = 0;
  1158. this.state.style['spacing'] = 0;
  1159. })];
  1160. return handles;
  1161. }
  1162. //**********************************************************************************************************************************************************
  1163. //Revision Table
  1164. //**********************************************************************************************************************************************************
  1165. /**
  1166. * Extends mxShape.
  1167. */
  1168. function mxShapeMockupRevisionTable(bounds, fill, stroke, strokewidth)
  1169. {
  1170. mxShape.call(this);
  1171. this.bounds = bounds;
  1172. this.fill = fill;
  1173. this.stroke = stroke;
  1174. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1175. };
  1176. /**
  1177. * Extends mxShape.
  1178. */
  1179. mxUtils.extend(mxShapeMockupRevisionTable, mxShape);
  1180. mxShapeMockupRevisionTable.prototype.cst = {
  1181. SHAPE_REVISION_TABLE : 'mxgraph.mockup.misc.revisionTable',
  1182. MAIN_TEXT : 'mainText',
  1183. TEXT_COLOR : 'textColor',
  1184. TEXT_SIZE : 'textSize'
  1185. };
  1186. /**
  1187. * Function: paintVertexShape
  1188. *
  1189. * Paints the vertex shape.
  1190. */
  1191. mxShapeMockupRevisionTable.prototype.paintVertexShape = function(c, x, y, w, h)
  1192. {
  1193. c.translate(x, y);
  1194. this.background(c, w, h);
  1195. c.setShadow(false);
  1196. this.foreground(c, w, h);
  1197. };
  1198. mxShapeMockupRevisionTable.prototype.background = function(c, w, h)
  1199. {
  1200. c.rect(0, 0, w, h);
  1201. c.fillAndStroke();
  1202. };
  1203. mxShapeMockupRevisionTable.prototype.foreground = function(c, w, h)
  1204. {
  1205. var mainText = mxUtils.getValue(this.style, mxShapeMockupRevisionTable.prototype.cst.MAIN_TEXT, '').toString().split(',');
  1206. var textColor = mxUtils.getValue(this.style, mxShapeMockupRevisionTable.prototype.cst.TEXT_COLOR, '#999999');
  1207. var textSize = mxUtils.getValue(this.style, mxShapeMockupRevisionTable.prototype.cst.TEXT_SIZE, '17');
  1208. c.begin();
  1209. c.moveTo(0, h * 0.33);
  1210. c.lineTo(w, h * 0.33);
  1211. c.moveTo(0, h * 0.67);
  1212. c.lineTo(w, h * 0.67);
  1213. c.moveTo(w * 0.125, h * 0.33);
  1214. c.lineTo(w * 0.125, h);
  1215. c.moveTo(w * 0.5, h * 0.33);
  1216. c.lineTo(w * 0.5, h);
  1217. c.stroke();
  1218. c.setFontSize(textSize);
  1219. c.setFontColor(textColor);
  1220. c.text(w * 0.5, h * 0.165, 0, 0, mainText[0], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1221. c.text(w * 0.0625, h * 0.5, 0, 0, mainText[1], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1222. c.text(w * 0.3125, h * 0.5, 0, 0, mainText[2], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1223. c.text(w * 0.75, h * 0.5, 0, 0, mainText[3], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1224. c.text(w * 0.0625, h * 0.835, 0, 0, mainText[4], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1225. c.text(w * 0.3125, h * 0.835, 0, 0, mainText[5], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1226. c.text(w * 0.75, h * 0.835, 0, 0, mainText[6], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1227. };
  1228. mxCellRenderer.prototype.defaultShapes[mxShapeMockupRevisionTable.prototype.cst.SHAPE_REVISION_TABLE] = mxShapeMockupRevisionTable;
  1229. //**********************************************************************************************************************************************************
  1230. //Status Bar
  1231. //**********************************************************************************************************************************************************
  1232. /**
  1233. * Extends mxShape.
  1234. */
  1235. function mxShapeMockupStatusBar(bounds, fill, stroke, strokewidth)
  1236. {
  1237. mxShape.call(this);
  1238. this.bounds = bounds;
  1239. this.fill = fill;
  1240. this.stroke = stroke;
  1241. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1242. };
  1243. /**
  1244. * Extends mxShape.
  1245. */
  1246. mxUtils.extend(mxShapeMockupStatusBar, mxShape);
  1247. mxShapeMockupStatusBar.prototype.cst = {
  1248. SHAPE_STATUS_BAR : 'mxgraph.mockup.misc.statusBar',
  1249. MAIN_TEXT : 'mainText',
  1250. FILL_COLOR2 : 'fillColor2',
  1251. STROKE_COLOR2 : 'strokeColor2',
  1252. TEXT_COLOR : 'textColor',
  1253. TEXT_SIZE : 'textSize'
  1254. };
  1255. /**
  1256. * Function: paintVertexShape
  1257. *
  1258. * Paints the vertex shape.
  1259. */
  1260. mxShapeMockupStatusBar.prototype.paintVertexShape = function(c, x, y, w, h)
  1261. {
  1262. c.translate(x, y);
  1263. w = Math.max(w, 105);
  1264. this.background(c, w, h);
  1265. c.setShadow(false);
  1266. this.foreground(c, w, h);
  1267. };
  1268. mxShapeMockupStatusBar.prototype.background = function(c, w, h)
  1269. {
  1270. c.rect(0, h * 0.5 - 15, w, 30);
  1271. c.fillAndStroke();
  1272. };
  1273. mxShapeMockupStatusBar.prototype.foreground = function(c, w, h)
  1274. {
  1275. var fillColor2 = mxUtils.getValue(this.style, mxShapeMockupStatusBar.prototype.cst.FILL_COLOR2, '#ddeeff');
  1276. var strokeColor2 = mxUtils.getValue(this.style, mxShapeMockupStatusBar.prototype.cst.STROKE_COLOR2, '#008cff');
  1277. var mainText = mxUtils.getValue(this.style, mxShapeMockupStatusBar.prototype.cst.MAIN_TEXT, '').toString().split(',');
  1278. var textColor = mxUtils.getValue(this.style, mxShapeMockupStatusBar.prototype.cst.TEXT_COLOR, '#999999');
  1279. var textSize = mxUtils.getValue(this.style, mxShapeMockupStatusBar.prototype.cst.TEXT_SIZE, '17');
  1280. c.setFillColor(fillColor2);
  1281. c.roundrect(5, h * 0.5 - 10, (w - 75) * 0.46, 20, 5, 5);
  1282. c.fill();
  1283. c.roundrect(10 + (w - 75) * 0.46, h * 0.5 - 10, (w - 75) * 0.23, 20, 5, 5);
  1284. c.fill();
  1285. c.roundrect(15 + (w - 75) * 0.69, h * 0.5 - 10, (w - 75) * 0.276, 20, 5, 5);
  1286. c.fill();
  1287. c.setFontSize(textSize);
  1288. c.setFontColor(textColor);
  1289. c.text(10, h * 0.5, 0, 0, mainText[0], mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1290. c.text(10 + (w - 75) * 0.575, h * 0.5, 0, 0, mainText[1], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1291. c.text(15 + (w - 75) * 0.828, h * 0.5, 0, 0, mainText[2], mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  1292. c.setStrokeColor(strokeColor2);
  1293. c.ellipse(w - 25, h * 0.5 - 10, 20, 20);
  1294. c.stroke();
  1295. c.begin();
  1296. c.moveTo(w - 55, h * 0.5 + 10);
  1297. c.lineTo(w - 35, h * 0.5 + 10);
  1298. c.stroke();
  1299. };
  1300. mxCellRenderer.prototype.defaultShapes[mxShapeMockupStatusBar.prototype.cst.SHAPE_STATUS_BAR] = mxShapeMockupStatusBar;
  1301. //**********************************************************************************************************************************************************
  1302. //Pin
  1303. //**********************************************************************************************************************************************************
  1304. /**
  1305. * Extends mxShape.
  1306. */
  1307. function mxShapeMockupPin(bounds, fill, stroke, strokewidth)
  1308. {
  1309. mxShape.call(this);
  1310. this.bounds = bounds;
  1311. this.fill = fill;
  1312. this.stroke = stroke;
  1313. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1314. };
  1315. /**
  1316. * Extends mxShape.
  1317. */
  1318. mxUtils.extend(mxShapeMockupPin, mxShape);
  1319. mxShapeMockupPin.prototype.cst = {
  1320. SHAPE_PIN : 'mxgraph.mockup.misc.pin',
  1321. FILL_COLOR2 : 'fillColor2',
  1322. FILL_COLOR3 : 'fillColor3'
  1323. };
  1324. /**
  1325. * Function: paintVertexShape
  1326. *
  1327. * Paints the vertex shape.
  1328. */
  1329. mxShapeMockupPin.prototype.paintVertexShape = function(c, x, y, w, h)
  1330. {
  1331. var fillColor2 = mxUtils.getValue(this.style, mxShapeMockupPin.prototype.cst.FILL_COLOR2, '#000000');
  1332. var fillColor3 = mxUtils.getValue(this.style, mxShapeMockupPin.prototype.cst.FILL_COLOR3, '#000000');
  1333. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1334. c.setShadow(false);
  1335. c.translate(x, y);
  1336. c.setStrokeWidth(3);
  1337. c.setStrokeColor('#666666');
  1338. c.begin();
  1339. c.moveTo(w * 0.5, h * 0.4);
  1340. c.lineTo(w * 0.5, h);
  1341. c.stroke();
  1342. c.setStrokeWidth(2);
  1343. c.setStrokeColor(strokeColor);
  1344. c.setGradient(fillColor2, fillColor3, 0, 0, w, h * 0.4, mxConstants.DIRECTION_SOUTH, 1, 1);
  1345. c.setAlpha(0.9);
  1346. c.ellipse(0, 0, w, h * 0.4);
  1347. c.fillAndStroke();
  1348. c.setFillColor('#ffffff');
  1349. c.setAlpha(0.5);
  1350. c.ellipse(w * 0.2, h * 0.08, w * 0.3, h * 0.12);
  1351. c.fill();
  1352. };
  1353. mxCellRenderer.prototype.defaultShapes[mxShapeMockupPin.prototype.cst.SHAPE_PIN] = mxShapeMockupPin;
  1354. //**********************************************************************************************************************************************************
  1355. //Rounded rectangle (adjustable rounding)
  1356. //**********************************************************************************************************************************************************
  1357. /**
  1358. * Extends mxShape.
  1359. */
  1360. function mxShapeMockupMiscRRect(bounds, fill, stroke, strokewidth)
  1361. {
  1362. mxShape.call(this);
  1363. this.bounds = bounds;
  1364. this.fill = fill;
  1365. this.stroke = stroke;
  1366. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  1367. };
  1368. /**
  1369. * Extends mxShape.
  1370. */
  1371. mxUtils.extend(mxShapeMockupMiscRRect, mxShape);
  1372. mxShapeMockupMiscRRect.prototype.cst = {
  1373. RRECT : 'mxgraph.mockup.misc.rrect',
  1374. R_SIZE : 'rSize'
  1375. };
  1376. /**
  1377. * Function: paintVertexShape
  1378. *
  1379. * Paints the vertex shape.
  1380. */
  1381. mxShapeMockupMiscRRect.prototype.paintVertexShape = function(c, x, y, w, h)
  1382. {
  1383. c.translate(x, y);
  1384. var rSize = parseInt(mxUtils.getValue(this.style, mxShapeMockupMiscRRect.prototype.cst.R_SIZE, '10'));
  1385. c.roundrect(0, 0, w, h, rSize);
  1386. c.fillAndStroke();
  1387. };
  1388. mxCellRenderer.registerShape(mxShapeMockupMiscRRect.prototype.cst.RRECT, mxShapeMockupMiscRRect);
  1389. //**********************************************************************************************************************************************************
  1390. //Anchor (a dummy shape without visuals used for anchoring)
  1391. //**********************************************************************************************************************************************************
  1392. /**
  1393. * Extends mxShape.
  1394. */
  1395. function mxShapeMockupMiscAnchor(bounds, fill, stroke, strokewidth)
  1396. {
  1397. mxShape.call(this);
  1398. this.bounds = bounds;
  1399. };
  1400. /**
  1401. * Extends mxShape.
  1402. */
  1403. mxUtils.extend(mxShapeMockupMiscAnchor, mxShape);
  1404. mxShapeMockupMiscAnchor.prototype.cst = {
  1405. ANCHOR : 'mxgraph.mockup.misc.anchor'
  1406. };
  1407. /**
  1408. * Function: paintVertexShape
  1409. *
  1410. * Paints the vertex shape.
  1411. */
  1412. mxShapeMockupMiscAnchor.prototype.paintVertexShape = function(c, x, y, w, h)
  1413. {
  1414. };
  1415. mxCellRenderer.registerShape(mxShapeMockupMiscAnchor.prototype.cst.ANCHOR, mxShapeMockupMiscAnchor);