Change color of a node in Zest
I'm using Zest to draw a graph. However, I want to change the default color o开发者_C百科f 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.
精彩评论