[Zest] Changing the shape of Nodes in zest while using the content provider [message #245038] |
Wed, 20 August 2008 20:03 |
Eclipse User |
|
|
|
Originally posted by: samer_alamir2.yahoo.com
Hello
Am a new user of zest and am using zest with the content provider. i noticed
that if am building the graph node by node then i can control the shape of
the node by extending the GraphNode class as done in the UML example. but
does there exist a way to control the apperance of the different nodes in
the graph while using the content provider.(in other words provide different
shapes for different nodes). i know that we can change the background colors
and other properties of an entity using the IEntityStyleProvider, but what i
need is to change the complete shape (circle, rectangle ... etc). if anyone
had done this befor i would really appreciate if he would inform me with the
way to do this.
Thank you Very much
Samer
|
|
|
|
|
Re: [Zest] Changing the shape of Nodes in zest while using the content provider [message #246132 is a reply to message #245413] |
Thu, 06 November 2008 19:09 |
Eclipse User |
|
|
|
Originally posted by: samer_alamir2.yahoo.com
Thanks alot for your concern, i really appriciate this
Samer Alameer
"Tully Yates" <tully.yates@bbsrc.ac.uk> wrote in message
news:09c7543da9a9513bbd2f2603d091b367$1@www.eclipse.org...
> That didn't work for me...
>
> The UML example shows us to extend GraphNode and then override the
> createFigureForModel method. The problem is when using a content provider
> the method that creates the GraphNode is burried deep and it's private.
>
> I had to change a couple of methods in the API of
> AbstractStructuredGraphViewer from private to protected.
>
> #getNodesMap
> #addGraphModelNode
>
> This allows one to extend the GraphViewer class and then override the
> AbstractStructuredGraphViewer#addGraphModelNode, which is responsible for
> creating the Node.
>
> I then went ahead and added #setGraphNodeDecorator to my extended
> GraphViewer class so that I can register a class for creating GraphNodes.
> This way, the overridden AbstractStructuredGraphViewer#addGraphModelNode
> delegates creation of the extended GraphNode to the class registered by
> #setGraphNodeDecorator.
>
> I intend to do a similar to allow connections can have custom displays
> too.
>
> I will register a bug for this and upload my fixes when I'm sure there is
> no other way around this issue.
>
>
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04690 seconds