在 JUNG 中更改交互模式边缘形状
我知道使用 EdgeShapeTransformer 可以更改边缘的外观:
vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line()); // for example
但是我正在寻找如何在从一个节点拖动到另一个节点时更改线条的外观以交互地创建边缘。默认情况下,尚未链接到另一个节点的“悬停”边是一条大曲线。请参阅此处的示例了解我的意思。
I am aware of the ability using an EdgeShapeTransformer to change the look of edges:
vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line()); // for example
However I am looking for how to change the way the line looks while dragging from one node to another to create an edge interactively. By default the 'hovering' edge which is not yet linked to another node is a large curved line. See the example here for what I mean.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CubicCurveEdgeEffects 是完成此操作的地方。有一个 EdgeEffects 接口可以用来做其他事情。 SimpleEdgeSupport 类通过 EditingGraphMousePlugin 使用它。
(感谢 Tom Nelson,离线交流。)
CubicCurveEdgeEffects is where it is done. There is an EdgeEffects interface that can be implemented to do other things instead. It is used by the SimpleEdgeSupport class via the EditingGraphMousePlugin.
(Credit to Tom Nelson, offline communication.)