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.
我正在使用 Zest 绘制图表。但是,我想根据其标签将 graphnode 的默认颜色更改为另一种颜色。例如: Label: red => 节点的颜色为红色。
如果您使用 Zest 的 GraphViewer API(类似于 JFace 查看器),请让您的 LabelProvider 扩展 IEntityStyleProvider,它提供必要的 getBackgroundColor() 回调方法(以及其他方法)。
但是,如果您使用的是基本 Graph API,则必须使用 GraphNodes set*Color 方法手动设置所有节点的颜色。