У меня есть XML-файл, в котором создается фигура, и эта фигура добавляется в mxStencilsRegistry. Но я хочу добавить эту форму в mxcellrender.registerShape (). поэтому я не могу понять, как добавить трафареты в mxcellrenderer.
Ниже я добавил свой трафарет.
<shape h="100" name="Script Task" strokewidth="inherit" w="73.4">
<connections/>
<background>
<path>
<move x="61.7" y="0"/>
<arc large-arc-flag="0" rx="40" ry="40" sweep-flag="0" x="61.7" x-axis-rotation="0" y="50"/>
<arc large-arc-flag="0" rx="40" ry="40" sweep-flag="1" x="61.7" x-axis-rotation="0" y="100"/>
<line x="11.7" y="100"/>
<arc large-arc-flag="0" rx="40" ry="40" sweep-flag="0" x="11.7" x-axis-rotation="0" y="50"/>
<arc large-arc-flag="0" rx="40" ry="40" sweep-flag="1" x="11.7" x-axis-rotation="0" y="0"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
<path>
<move x="21.7" y="50"/>
<line x="51.7" y="50"/>
<move x="13.7" y="30"/>
<line x="43.7" y="30"/>
<move x="15.7" y="10"/>
<line x="45.7" y="10"/>
<move x="29.7" y="70"/>
<line x="59.7" y="70"/>
<move x="27.7" y="90"/>
<line x="57.7" y="90"/>
</path>
<stroke/>
</foreground>
</shape>
вещи, которые я пробовал.
function a(){
mxShape.call(this)
}
mxUtils.extends(a, mxShape)
a.prototype.stencils = stencils.xml
mxcellrenderer.registerShape("script_task", a)
но форма не зарегистрирована.
Я хочу зарегистрировать фигуру, чтобы создать пользовательские свойства для фигуры tat, используя
mxcellrenderer.defaultShape.script_task.prototype.customProperties = [{}]
, поэтому любой может помочь мне понять, как зарегистрировать фигуру stencil.xml в mxcellrenderer.