简体   繁体   English

Java Prefuse图将节点复制到另一个图

[英]Java Prefuse graph copying a node to another graph

I have a 2x2 grid of graphs in JPanels. 我在JPanels中有一个2x2的图形网格。 In the top left graph i have a load of nodes, when I click on a node I want that node to be copied to the next graph so it appears there. 在左上方的图形中,我有大量的节点,当我单击一个节点时,我希望将该节点复制到下一个图形,以便它出现在此处。 Firstly I am making the graphs Then I add data to the top left graph Then I attach those graphs to panels by creating visualisation, and a display based on that visualization. 首先,我正在制作图形,然后将数据添加到左上方的图形,然后通过创建可视化效果并将这些图形附加到面板上,并基于该可视化效果进行显示。 I add a ControlListener to the display to handle clicking on nodes - I pass that the graph I want the node to be copied into Then in the itemClicked method, I am doing Node node = graph.addNode(). 我在显示器上添加了一个ControlListener来处理对节点的单击-我传递了想要将节点复制到的图形。然后在itemClicked方法中,我正在执行Node node = graph.addNode()。 I get no errors, but I dont see the node either. 我没有收到任何错误,但也没有看到该节点。 Any ideas why - do I have to refresh the graph or something? 为什么有任何想法-我是否必须刷新图表或其他内容?

通过在添加节点的可视化文件上运行操作列表来刷新图形。

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

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