Placing Child Elements inside Nodes in GEF5 [message #1829459] |
Sat, 04 July 2020 02:29 |
Annamalai Mising name 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.
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 |
|
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
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03810 seconds