Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [Zest] Changing the shape of Nodes in zest while using the content provider
[Zest] Changing the shape of Nodes in zest while using the content provider [message #245038] Wed, 20 August 2008 20:03 Go to next message
Eclipse UserFriend
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 #245344 is a reply to message #245038] Fri, 05 September 2008 10:20 Go to previous messageGo to next message
Zhiqiang Qian is currently offline Zhiqiang QianFriend
Messages: 76
Registered: July 2009
Member
I think you can just overwrite the getFactory() method of GraphViewer to
return your own IStylingGraphModelFactory implementation.

Samer wrote:
> 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 #245413 is a reply to message #245344] Tue, 09 September 2008 23:13 Go to previous messageGo to next message
Tully Yates is currently offline Tully YatesFriend
Messages: 7
Registered: July 2009
Junior Member
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.
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 Go to previous messageGo to next message
Eclipse UserFriend
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.
>
>
Is Zest hiding too much? was.. Re: [Zest] Changing the shape of Nodes in zest while using the conten [message #246208 is a reply to message #245413] Mon, 17 November 2008 05:18 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
Tully,

I also saw your earlier post about changin zest manifest to export
internals and I have to agree with your approach. Did you ever put in a
bug request on this one? I love Zest but I've been really frustrated by
how much everything is locked up. Its a really nice idea to hide all of
this stuff and I can understand the Zest group wanting to keep API
evolution open, but it is really really limiting. There are a bunch of
things I want to do with Zest that I simply can't do without just
getting rid of the current restrictions and providing that version.

I'd like to lobby for...

Sooner: a release of Zest that really does nothing more than expose
some internals and mark some of those methods as public protected. I'm
totally happy with a "use at your own risk" javadoc..

Later: some re-factoring such that Zest becomes a bit more of a generic
layout and graph management api that exposes all of the basic feature
functionality in a more extensible / common way for general GEF edit
parts.

I do appreciate that there is a tension here -- part of the great
appeal of Zest is in the simplicity of getting the basics working and
making it hard to break things.

Ian, et.al., comments?


On 2008-09-09 16:13:06 -0700, tully.yates@bbsrc.ac.uk (Tully Yates) said:

> 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.
Re: Is Zest hiding too much? was.. Re: [Zest] Changing the shape of Nodes in zest while using the co [message #246211 is a reply to message #246208] Mon, 17 November 2008 06:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.ddress.here

In article <gfqus0$o9n$1@build.eclipse.org>, milesparker@gmail.com
says...>
>
> I'd like to lobby for...
>
> Sooner: a release of Zest that really does nothing more than expose
> some internals and mark some of those methods as public protected. I'm
> totally happy with a "use at your own risk" javadoc..
>
> Later: some re-factoring such that Zest becomes a bit more of a generic
> layout and graph management api that exposes all of the basic feature
> functionality in a more extensible / common way for general GEF edit
> parts.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=247788
Re: Is Zest hiding too much? was.. Re: [Zest] Changing the shape of Nodes in zest while using the co [message #246214 is a reply to message #246211] Mon, 17 November 2008 08:22 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
See my reply.. I'm not sure if a more generic enhancement request is
needed here, but I also agree with the point about discouraged access
on internals. I have on a couple of occasions found it neccessary to
cast to an internal swt platform implementation and I think this is a
reasonable thing to allow at minimum.

On 2008-11-16 22:13:36 -0800, Gerald B. Rosenberg <no@ddress.here> said:

> In article <gfqus0$o9n$1@build.eclipse.org>, milesparker@gmail.com
> says...>
>>
>> I'd like to lobby for...
>>
>> Sooner: a release of Zest that really does nothing more than expose
>> some internals and mark some of those methods as public protected. I'm
>> totally happy with a "use at your own risk" javadoc..
>>
>> Later: some re-factoring such that Zest becomes a bit more of a generic
>> layout and graph management api that exposes all of the basic feature
>> functionality in a more extensible / common way for general GEF edit
>> parts.
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=247788
Re: Is Zest hiding too much? was.. Re: [Zest] Changing the shape of Nodes in zes [message #246335 is a reply to message #246208] Tue, 25 November 2008 08:30 Go to previous messageGo to next message
Tully Yates is currently offline Tully YatesFriend
Messages: 7
Registered: July 2009
Junior Member
Miles Parker wrote:

> I also saw your earlier post about changin zest manifest to export
> internals and I have to agree with your approach. Did you ever put in a
> bug request on this one?

I noticed that a bug is already registered for this see:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=215040

I attached the required exposure of private methods, and the steps
necessary to produce the desired functionality.


Just make sure you implement the IConnectionStyleProvider interface in
your LabelProvider, otherwise your connection styles won't show up.

http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.tools. gef/msg20878.html


Sorry for not announcing it here earlier!
Re: Is Zest hiding too much? was.. Re: [Zest] Changing the shape of Nodes in zes [message #246659 is a reply to message #246335] Tue, 23 December 2008 20:41 Go to previous message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
Just updated the bug report with a hack for creating a figure using the image.

bug 215040

On 2008-11-25 03:30:51 -0500, tully.yates@bbsrc.ac.uk (Tully Yates) said:

> Miles Parker wrote:
>
>> I also saw your earlier post about changin zest manifest to export
>> internals and I have to agree with your approach. Did you ever put in a
>> bug request on this one?
>
> I noticed that a bug is already registered for this see:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=215040
>
> I attached the required exposure of private methods, and the steps
> necessary to produce the desired functionality.
>
>
> Just make sure you implement the IConnectionStyleProvider interface in
> your LabelProvider, otherwise your connection styles won't show up.
>
> http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.tools. gef/msg20878.html
>
>
> Sorry for not announcing it here earlier!
Previous Topic:PropertySheetPage query
Next Topic:[Announce] GEF 3.4.2 M200811041126 is available
Goto Forum:
  


Current Time: Thu Apr 25 07:53:16 GMT 2024

Powered by FUDForum. Page generated in 0.03933 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top