Sidebar-Arrows2.js 6.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. (function()
  2. {
  3. // Adds Arrow shapes with control points
  4. Sidebar.prototype.addArrows2Palette = function()
  5. {
  6. var s = 'html=1;shadow=0;dashed=0;align=center;verticalAlign=middle;shape=mxgraph.arrows2.';
  7. var s2 = 'html=1;shadow=0;dashed=0;fillColor=none;strokeColor=none;shape=mxgraph.arrows2.';
  8. var gn = 'mxgraph.arrows2';
  9. var dt = 'arrow ';
  10. var sb = this;
  11. var fns = [
  12. this.createVertexTemplateEntry(s + 'arrow;dy=0.6;dx=40;notch=0;',
  13. 100, 70, '', 'Arrow Right', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'right').join(' ')),
  14. this.createVertexTemplateEntry(s + 'arrow;dy=0.6;dx=40;flipH=1;notch=0;',
  15. 100, 70, '', 'Arrow Left', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'leftt').join(' ')),
  16. this.createVertexTemplateEntry(s + 'arrow;dy=0.6;dx=40;direction=north;notch=0;',
  17. 70, 100, '', 'Arrow Up', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'up').join(' ')),
  18. this.createVertexTemplateEntry(s + 'arrow;dy=0.6;dx=40;direction=south;notch=0;',
  19. 70, 100, '', 'Arrow Down', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'down').join(' ')),
  20. this.createVertexTemplateEntry(s + 'arrow;dy=0;dx=30;notch=30;',
  21. 100, 60, '', 'Chevron Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'chevron').join(' ')),
  22. this.createVertexTemplateEntry(s + 'arrow;dy=0.6;dx=40;notch=15;',
  23. 100, 70, '', 'Notched Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'notched').join(' ')),
  24. this.createVertexTemplateEntry(s + 'arrow;dy=0;dx=10;notch=10;',
  25. 100, 30, '', 'Notched Signal-In Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'notched signal in').join(' ')),
  26. this.createVertexTemplateEntry(s + 'arrow;dy=0;dx=10;notch=0;',
  27. 100, 30, '', 'Signal-In Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'signal in').join(' ')),
  28. this.createVertexTemplateEntry(s + 'arrow;dy=0.67;dx=20;notch=0;',
  29. 100, 60, '', 'Slender Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'slender').join(' ')),
  30. this.createVertexTemplateEntry(s + 'twoWayArrow;dy=0.6;dx=35;',
  31. 100, 60, '', 'Two Way Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'two way').join(' ')),
  32. this.createVertexTemplateEntry(s + 'twoWayArrow;dy=0.65;dx=22;',
  33. 100, 60, '', 'Slender Two Way Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'slender two way').join(' ')),
  34. this.createVertexTemplateEntry(s + 'stylisedArrow;dy=0.6;dx=40;notch=15;feather=0.4;',
  35. 100, 60, '', 'Stylised Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'stylised notch notched').join(' ')),
  36. this.createVertexTemplateEntry(s + 'sharpArrow;dy1=0.67;dx1=18;dx2=18;notch=0;',
  37. 100, 60, '', 'Sharp Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'sharp').join(' ')),
  38. this.createVertexTemplateEntry(s + 'sharpArrow2;dy1=0.67;dx1=18;dx2=18;dy3=0.15;dx3=27;notch=0;',
  39. 100, 60, '', 'Sharp Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'sharp').join(' ')),
  40. this.createVertexTemplateEntry(s + 'calloutArrow;dy=10;dx=20;notch=60;arrowHead=10;',
  41. 100, 60, '', 'Callout with Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'callout').join(' ')),
  42. this.createVertexTemplateEntry(s + 'bendArrow;dy=15;dx=38;notch=0;arrowHead=55;rounded=0;',
  43. 100, 100, '', 'Bend Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'bend').join(' ')),
  44. this.createVertexTemplateEntry(s + 'bendArrow;dy=15;dx=38;notch=0;arrowHead=55;rounded=1;',
  45. 100, 100, '', 'Bend Arrow (rounded)', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'bend rounded').join(' ')),
  46. this.createVertexTemplateEntry(s + 'bendDoubleArrow;dy=15;dx=38;arrowHead=55;rounded=0;',
  47. 100, 100, '', 'Bend Double Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'bend double two way').join(' ')),
  48. this.createVertexTemplateEntry(s + 'bendDoubleArrow;dy=15;dx=38;arrowHead=55;rounded=1;',
  49. 100, 100, '', 'Bend Double Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'bend double two way').join(' ')),
  50. this.createVertexTemplateEntry(s + 'calloutDoubleArrow;dy=10;dx=20;notch=24;arrowHead=10;',
  51. 100, 50, '', 'Callout with Double Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'callout double two way').join(' ')),
  52. this.createVertexTemplateEntry(s + 'calloutQuadArrow;dy=10;dx=20;notch=24;arrowHead=10;',
  53. 100, 100, '', 'Callout with Quad Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'callout quad four war').join(' ')),
  54. this.createVertexTemplateEntry(s + 'calloutDouble90Arrow;dy1=10;dx1=20;dx2=70;dy2=70;arrowHead=10;',
  55. 100, 100, '', 'Callout with Double Arrow 90' + String.fromCharCode(176), null, null, this.getTagsForStencil(gn, 'arrow', dt + 'callout double two way orthogonal').join(' ')),
  56. this.createVertexTemplateEntry(s + 'quadArrow;dy=10;dx=20;notch=24;arrowHead=10;',
  57. 100, 100, '', 'Quad Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'four way quad').join(' ')),
  58. this.createVertexTemplateEntry(s + 'triadArrow;dy=10;dx=20;arrowHead=40;',
  59. 100, 70, '', 'Triad Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'three way triad').join(' ')),
  60. this.createVertexTemplateEntry(s + 'tailedArrow;dy1=10;dx1=20;notch=0;arrowHead=20;dx2=25;dy2=30;',
  61. 100, 60, '', 'Tailed Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'tailed').join(' ')),
  62. this.createVertexTemplateEntry(s + 'tailedNotchedArrow;dy1=10;dx1=20;notch=20;arrowHead=20;dx2=25;dy2=30;',
  63. 100, 60, '', 'Tailed Arrow with Notch', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'tailed notch notched').join(' ')),
  64. this.createVertexTemplateEntry(s + 'stripedArrow;dy=0.6;dx=40;notch=25;',
  65. 100, 70, '', 'Striped Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'striped').join(' ')),
  66. this.createVertexTemplateEntry(s + 'jumpInArrow;dy=15;dx=38;arrowHead=55;',
  67. 100, 100, '', 'Jump-In Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'jump in').join(' ')),
  68. this.createVertexTemplateEntry(s + 'uTurnArrow;dy=11;arrowHead=43;dx2=25;',
  69. 100, 100, '', 'U Turn Arrow', null, null, this.getTagsForStencil(gn, 'arrow', dt + 'u turn uturn').join(' '))
  70. ];
  71. this.addPalette('arrows2', mxResources.get('arrows'), false, mxUtils.bind(this, function(content)
  72. {
  73. for (var i = 0; i < fns.length; i++)
  74. {
  75. content.appendChild(fns[i](content));
  76. }
  77. }));
  78. };
  79. })();