Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 org.eclipse.zest.core.viewers.GraphViewer.setLayoutAlgorithm 来设置布局算法。
我的问题是,当图形被渲染时,节点被绘制得非常接近,并且有时在彼此之上。
有没有办法解决这个问题与编写自己的布局算法?
这是一个老问题,但您当然可以为 zest.layout 组件编写新的布局算法。如您所见,它们中的大多数都从AbstractLayoutAlgorithm. 您也可以更改现有布局,因为它是开源的。我不知道您使用的是哪一个,但大多数布局的行和列的大小是在preLayoutAlgorithm函数中确定/计算的。所以在这里你可以随心所欲地改变一切。您可能必须逐步测试可视化中的更改。
AbstractLayoutAlgorithm
preLayoutAlgorithm