editor-commons.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <mxEditor>
  2. <ui>
  3. <resource basename="/rfEngine/graph/resources/mxApplication"/>
  4. </ui>
  5. <mxDefaultPopupMenu as="popupHandler">
  6. <add as="cut" action="cut" icon="/rfEngine/graph/images/cut.gif"/>
  7. <add as="copy" action="copy" icon="/rfEngine/graph/images/copy.gif"/>
  8. <add as="paste" action="paste" icon="/rfEngine/graph/images/paste.gif"/>
  9. <separator/>
  10. <add as="delete" action="delete" icon="/rfEngine/graph/images/delete.gif" if="cell"/>
  11. <separator/>
  12. <add as="properties" action="showProperties" icon="/rfEngine/graph/images/properties.gif"/>
  13. <separator/>
  14. <add as="breakpoint" action="breakpoint" icon="/rfEngine/graph/images/debug_s.gif" if="cell"/>
  15. </mxDefaultPopupMenu>
  16. <include name="/rfEngine/graph/config/keyhandler-commons.xml"/>
  17. <Array as="actions">
  18. <add as="open"><![CDATA[
  19. function (editor)
  20. {
  21. editor.open(mxUtils.prompt('Enter filename', 'workflow.xml'));
  22. }
  23. ]]></add>
  24. <add as="openHref"><![CDATA[
  25. function (editor, cell)
  26. {
  27. cell = cell || editor.graph.getSelectionCell();
  28. if (cell == null)
  29. {
  30. cell = editor.graph.getCurrentRoot();
  31. if (cell == null)
  32. {
  33. cell = editor.graph.getModel().getRoot();
  34. }
  35. }
  36. if (cell != null)
  37. {
  38. var href = cell.getAttribute('href');
  39. if (href != null && href.length > 0)
  40. {
  41. window.open(href);
  42. }
  43. else
  44. {
  45. mxUtils.alert('No URL defined. Showing properties...');
  46. editor.execute('showProperties', cell);
  47. }
  48. }
  49. }
  50. ]]></add>
  51. <add as="editStyle"><![CDATA[
  52. function (editor)
  53. {
  54. var cell = editor.graph.getSelectionCell();
  55. if (cell != null)
  56. {
  57. var model = editor.graph.getModel();
  58. var style = mxUtils.prompt(mxResources.get('enterStyle'), model.getStyle(cell) || '');
  59. if (style != null)
  60. {
  61. model.setStyle(cell, style);
  62. }
  63. }
  64. }
  65. ]]></add>
  66. <add as="fillColor"><![CDATA[
  67. function (editor)
  68. {
  69. var color = mxUtils.prompt(mxResources.get('enterColorname'), 'red');
  70. if (color != null)
  71. {
  72. editor.graph.model.beginUpdate();
  73. try
  74. {
  75. editor.graph.setCellStyles("strokeColor", color);
  76. editor.graph.setCellStyles("fillColor", color);
  77. }
  78. finally
  79. {
  80. editor.graph.model.endUpdate();
  81. }
  82. }
  83. }
  84. ]]></add>
  85. <add as="gradientColor"><![CDATA[
  86. function (editor)
  87. {
  88. var color = mxUtils.prompt(mxResources.get('enterColorname'), 'white');
  89. if (color != null)
  90. {
  91. editor.graph.setCellStyles("gradientColor", color);
  92. }
  93. }
  94. ]]></add>
  95. <add as="strokeColor"><![CDATA[
  96. function (editor)
  97. {
  98. var color = mxUtils.prompt(mxResources.get('enterColorname'), 'red');
  99. if (color != null)
  100. {
  101. editor.graph.setCellStyles("strokeColor", color);
  102. }
  103. }
  104. ]]></add>
  105. <add as="fontColor"><![CDATA[
  106. function (editor)
  107. {
  108. var color = mxUtils.prompt(mxResources.get('enterColorname'), 'red');
  109. if (color != null)
  110. {
  111. editor.graph.setCellStyles("fontColor", color);
  112. }
  113. }
  114. ]]></add>
  115. <add as="fontFamily"><![CDATA[
  116. function (editor)
  117. {
  118. var family = mxUtils.prompt(mxResources.get('enterFontfamily'), 'Arial');
  119. if (family != null && family.length > 0)
  120. {
  121. editor.graph.setCellStyles("fontFamily", family);
  122. }
  123. }
  124. ]]></add>
  125. <add as="fontSize"><![CDATA[
  126. function (editor)
  127. {
  128. var size = mxUtils.prompt(mxResources.get('enterFontsize'), '10');
  129. if (size != null && size > 0 && size < 999)
  130. {
  131. editor.graph.setCellStyles("fontSize", size);
  132. }
  133. }
  134. ]]></add>
  135. <add as="image"><![CDATA[
  136. function (editor)
  137. {
  138. var image = mxUtils.prompt(mxResources.get('enterImageUrl'),
  139. '../views/product/rfEngine/graph/images/image.gif');
  140. if (image != null)
  141. {
  142. editor.graph.setCellStyles("image", image);
  143. }
  144. }
  145. ]]></add>
  146. <add as="opacity"><![CDATA[
  147. function (editor)
  148. {
  149. var opacity = mxUtils.prompt(mxResources.get('enterOpacity'), '100');
  150. if (opacity != null && opacity >= 0 && opacity <= 100)
  151. {
  152. editor.graph.setCellStyles("opacity", opacity);
  153. }
  154. }
  155. ]]></add>
  156. <add as="straightConnector"><![CDATA[
  157. function (editor)
  158. {
  159. editor.graph.setCellStyle("straightEdge");
  160. }
  161. ]]></add>
  162. <add as="redStraightConnector"><![CDATA[
  163. function (editor)
  164. {
  165. editor.graph.setCellStyle("redStraightEdge");
  166. }
  167. ]]></add>
  168. <add as="elbowConnector"><![CDATA[
  169. function (editor)
  170. {
  171. editor.graph.setCellStyle("");
  172. }
  173. ]]></add>
  174. <add as="arrowConnector"><![CDATA[
  175. function (editor)
  176. {
  177. editor.graph.setCellStyle("arrowEdge");
  178. }
  179. ]]></add>
  180. <add as="toggleOrientation"><![CDATA[
  181. function (editor, cell)
  182. {
  183. editor.graph.toggleCellStyles(mxConstants.STYLE_HORIZONTAL, true);
  184. }
  185. ]]></add>
  186. <add as="toggleRounded"><![CDATA[
  187. function (editor)
  188. {
  189. editor.graph.toggleCellStyles(mxConstants.STYLE_ROUNDED);
  190. }
  191. ]]></add>
  192. <add as="toggleShadow"><![CDATA[
  193. function (editor)
  194. {
  195. editor.graph.toggleCellStyles(mxConstants.STYLE_SHADOW);
  196. }
  197. ]]></add>
  198. <add as="horizontalTree"><![CDATA[
  199. function (editor, cell)
  200. {
  201. cell = cell || editor.graph.getSelectionCell();
  202. if (cell == null)
  203. {
  204. cell = editor.graph.getDefaultParent();
  205. }
  206. editor.treeLayout(cell, true);
  207. }
  208. ]]></add>
  209. <add as="verticalTree"><![CDATA[
  210. function (editor, cell)
  211. {
  212. cell = cell || editor.graph.getSelectionCell();
  213. if (cell == null)
  214. {
  215. cell = editor.graph.getDefaultParent();
  216. }
  217. editor.treeLayout(cell, false);
  218. }
  219. ]]></add>
  220. </Array>
  221. </mxEditor>