简体   繁体   English

在jGraphX图形编辑器中拖放一组单元格

[英]drag and drop a group of cells in jGraphX graph editor

I am using jGraphX for my application. 我正在使用jGraphX作为我的应用程序。 In jgraphX graph editor program drag and drop of icon from editor palette, it inserts single cell to the graph component. 在jgraphX图编辑器程序中从编辑器调色板中拖放图标,它将单个单元格插入到图形组件中。 eg. 例如。 If I drag and dropped square icon it inserts square cell in graph 如果我拖放方形图标,它会在图形中插入方形单元格

But I need to insert a group of cell to the graph component eg.If i drag and dropped group icon it insert the group cell. 但我需要将一组单元格插入到图形组件中。例如,如果我拖放组图标,则插入组单元格。 group cell contains two square(vertex) cell connected to each other(edge) 组单元格包含两个相互连接的方形(顶点)单元格(边缘)

I have tried it by creating the new template in the editor palette 我通过在编辑器面板中创建新模板来尝试它

mxCell cell=  new mxCell(.......);
mxCell cell1=new mxCell(....);
cell.setTarget(cell);

but it inserts only one cell. 但它只插入一个单元格。 Help me to insert a group of cell in the graph by drag and drop 帮我通过拖放在图表中插入一组单元格

我通过在鼠标拖动事件函数中添加代码(graph.insertVertex和graph.insertEdge)来成功完成它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM