Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top