0

我需要根据该属性值向自定义边缘形状(扩展)添加一个新属性以mxConnector更改边缘的颜色。示例如下:

function ExecutorEdge()
{
    mxConnector.call(this);
};
mxUtils.extend(ExecutorEdge, mxConnector);
ExecutorEdge.prototype.customProperties = [
    {name: 'trxSort', dispName: 'Transaction Sort', type: 'enum', defVal:'orig',
        enumList:[
            {val:'orig', dispName:'Original'},
            {val:'info', dispName:'Informational'},
            {val:'doc', dispName:'Documental'}
        ]}
];

mxCellRenderer.registerShape('executorEdge', ExecutorEdge);

我设法为扩展的自定义形状做同样的事情,mxEllipse但使用 Edge,属性甚至不会出现在属性表上。

4

1 回答 1

0

我的错,我将我的新形状设置为endArrowproperty not shape。使用问题描述中的代码并如下创建 Edge 模板可以正常工作。新的自定义属性已成功添加。

this.createEdgeTemplateEntry('shape=executorEdge;html=1;', 50, 50, '', 'Executor Link', null, tags)
于 2020-01-17T13:38:07.710 回答