gpt4 book ai didi

java - 在 JUNG 图中拾取/移动/调整大小/删除注释

转载 作者:行者123 更新时间:2023-12-01 14:52:25 24 4
gpt4 key购买 nike

JUNG 是否能够从图表中选取、移动、调整大小或删除Annotation 对象?

编辑:

考虑了AnnotationDemo之后(由 @sdasdadas 引用),确定了以下感兴趣的代码(第 126-134 行):

// Get the RenderContext for this visualization viewer
RenderContext<String,Number> rc = vv.getRenderContext();

// Create a new AnnotatingGraphMousePlugin with default settings.
// The AnnotatingGraphMousePlugin class is a subclass of AbstractGraphMousePlugin
// and also implements the interfaces MouseListener and MouseMotionListener. As
// such, the respective overridden methods would be a interesting place to embed
// the logic for the required behavior. However I am still not sure!
AnnotatingGraphMousePlugin<String,Number> annotatingPlugin =
new AnnotatingGraphMousePlugin<String,Number>(rc);

// Create a GraphMouse for the main view, using the annotating mouse plugin.
final AnnotatingModalGraphMouse<String,Number> graphMouse =
new AnnotatingModalGraphMouse<String,Number>(rc, annotatingPlugin);

和(第 174-180 行):

// Create annotation controls to allow the selection of color, shape, fill,
// and z-order. None of these controls is of interest to us.
AnnotationControls<String,Number> annotationControls =
new AnnotationControls<String,Number>(annotatingPlugin);

根据上面显示的评论,我最初的问题仍然相同。

<小时/>

最佳答案

是的,看看 AnnotationsDemo .

关于java - 在 JUNG 图中拾取/移动/调整大小/删除注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14701732/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com