質問

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