Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Placing Child Elements inside Nodes in GEF5
Placing Child Elements inside Nodes in GEF5 [message #1829459] Sat, 04 July 2020 02:29 Go to next message
Annamalai Mising name is currently offline Annamalai Mising nameFriend
Messages: 126
Registered: July 2009
Senior Member
Hi

I need to develop a diagram as attached using GEF4/5. I could find only 2 articles on GEF4/5. 1 from Itemis Site and 1 from Frank Blog [gitHub]. In both the examples they teach only 1 Child Node on the Canvas.

index.php/fa/38483/0/
Is there any example similar to UML Diagram using GEF4/5 wherein Class Node contains, Attribute Node and Method Nodes and then has relationships.

Regards
Malai

[Updated on: Sat, 04 July 2020 10:42]

Report message to a moderator

Re: Placing Child Elements inside Nodes in GEF5 [message #1829474 is a reply to message #1829459] Sat, 04 July 2020 14:02 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Malai,

the Zest Graph Example that is contained within GEF is able to render nested graphs inside nodes of a main graph. Therefore, you can look at that code to see an implementation of multiple layers of controllers. The two methods mainly responsible for this to work are: https://github.com/eclipse/gef/blob/5d8a055f859d92c0e8c0a6ef774bae9101f9bc6c/org.eclipse.gef.zest.fx/src/org/eclipse/gef/zest/fx/parts/NodePart.java#L342 and https://github.com/eclipse/gef/blob/5d8a055f859d92c0e8c0a6ef774bae9101f9bc6c/org.eclipse.gef.zest.fx/src/org/eclipse/gef/zest/fx/parts/NodePart.java#L225

Moreover, you can look at the following slides published by Alexander to get an overview of what you can do with GEF (btw we just call it GEF now, the outdated 3.x codebase is called GEF Legacy): https://www.slideshare.net/AlexanderNyssen/gef-500-from-a-users-perspective

Once you know how to synchronize your semantic model (contents) with the controller hierarchy (parts), then it will be straightforward to work with multiple layers of controllers.

That being said, I believe in most cases you really do not need many layers. IIRC, the tools depicted in the "from a user's perspective" slides are implemented with one or two layers of parts below the root part. The visual hierarchy and the controller hierarchy do not have to match one-to-one. Therefore, a UML-like class "card" could be represented by just one content part, for example, that would be responsible for rendering the box, title, attributes, and methods sections. Relations could be modeled on the same level as the classes.

Best regards,
Matthias
Re: Placing Child Elements inside Nodes in GEF5 [message #1830492 is a reply to message #1829474] Mon, 27 July 2020 19:29 Go to previous messageGo to next message
Annamalai Mising name is currently offline Annamalai Mising nameFriend
Messages: 126
Registered: July 2009
Senior Member
Hi Matthias

Thanks for your prompt reply. I managed to learn a little bit of GEF5 based on the various examples by Items, Frank and then TMDmaker editor migration code.
I did manage to create 1st draft of my diagram. Thanks for your detailed reply.

i understood the importance of doGetContentChildren(), doAddChildVisual(), doRemoveChildVisual()

Regards
Malai
Re: Placing Child Elements inside Nodes in GEF5 [message #1830736 is a reply to message #1830492] Sun, 02 August 2020 06:33 Go to previous messageGo to next message
Tamas Miklossy is currently offline Tamas MiklossyFriend
Messages: 157
Registered: February 2016
Senior Member
Hello Malai,

If you are interested in GEF 5.x UML Class Diagram Editor (wherein Class Node contains, Attribute Node and Method Nodes and then has relationships), I suggest you to take a look at the Papyrus GEFx: Papyrus with GEF5.x project presented at the EclipseCon Europe 2019.

- Presentation video (at 27:46) : https://www.youtube.com/watch?v=TmjahlJo76c&feature=youtu.be&t=1666
- Source code on GitHub: https://github.com/eclipsesource/papyrus-gefx

Moreover, you can find further information about GEF 5.x in the further reading section of the GEF Wiki: https://github.com/eclipse/gef/wiki#further-reading

Hope that helps,
Tamás
Re: Placing Child Elements inside Nodes in GEF5 [message #1833283 is a reply to message #1830736] Thu, 08 October 2020 12:11 Go to previous message
Annamalai Mising name is currently offline Annamalai Mising nameFriend
Messages: 126
Registered: July 2009
Senior Member
Thanks Tamas

We finally managed to create some basic GEF5 Diagrams. Thanks for your link.
I have setup the papyrus code also. But yet to get it compiled and running.

Regards
Malai
Previous Topic:Difficuty installing GEF DOT in Eclipse
Next Topic:Snap To Object - GEF5
Goto Forum:
  


Current Time: Fri Mar 29 00:48:21 GMT 2024

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

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

Back to the top