jung ObservableCachingLayout 与 staticLayout
我试图从布局中获取 x 和 y 坐标,但是当从 VisualizationViewer 获取布局时,返回的类型不是staticLayout而是 >ObservableCachingLayout(当然它不能转换为静态)。 有没有办法从 VisualizationViewer 获取静态布局? 或者从可视化中获取 x 和 y 的方法?谢谢
i m trying to get the x and y cordinate from the layout but when geting the layout from a VisualizationViewer the returned type is not staticLayout but ObservableCachingLayout (of course it couldn't be casted to static).
Is there a way to get the staticlayout from a VisualizationViewer ?
Or a way to get the x and y from the viz ? thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要从
Layout
获取 x 和 y 坐标,请调用layout.transform(vertex)
。 (Layout
是从顶点到Point
对象的Transformer
。)StaticLayout
是Layout 的实例
允许用户轻松指定每个顶点的坐标;它适用于您已经拥有坐标并且不需要算法来确定它们的情况。To get the x and y coordinate from the
Layout
, you calllayout.transform(vertex)
. (ALayout
is aTransformer
from vertices toPoint
objects.)StaticLayout
is an instance ofLayout
that allows the user to easily specify the coordinates of each vertex; it's intended for the case in which you already have coordinates and don't need an algorithm to determine them.