Вопрос

I'm using Zest to draw a graph. However, I want to change the default color of the graphnode to another color based on its label. For example: Label: red => color of the node is red.

Это было полезно?

Решение

If you are using the GraphViewer API of Zest (similar to JFace viewers), let your LabelProvider extend IEntityStyleProvider that provides the necessary getBackgroundColor() callback method (among others).

However, if you are using the base Graph API, then you have to set the color of all the nodes manually using the GraphNodes set*Color methods.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top