Skip to main content



      Home
Home » Eclipse Projects » GEF » Display Child outside ParentContainer
Display Child outside ParentContainer [message #1746343] Thu, 27 October 2016 05:24 Go to next message
Eclipse UserFriend
Hello everybody,

i'm actually facing following problem. Maybe u have already defined an SYSML model with papyrus. Espacially the Internal Block Diagram. I'm writing a GEF Editor witch contains some functions of this SYSML model. My problem is : I know how to define Containers and Childs and i can create Childs in Parents(Containers) but now i have one problem. I can't display the child outside the parent constraints. Not directly outside but consider the following: u have an System with "Ports" and u want these ports to show up directly on the constraint lines of the System. So the port is the Child of the System(parent). I can display the port completly inside the parent, but when i try to move it outside the parent, the GEF-Editor blocks my movement because its not allowed.
Maybe u have a look at the pictures below so everything gets clearer. So u can understand what i mean.

I'm thankfully for every help Smile
Greetings
Re: Display Child outside ParentContainer [message #1746359 is a reply to message #1746343] Thu, 27 October 2016 09:14 Go to previous messageGo to next message
Eclipse UserFriend
Hi korbinian,

GEF 3.x Draw2D restricts the drawing area for children to the bounding box of their parent, i.e. children figures can only draw within the bounds of their parent figure.

As far as I know, you cannot change this behavior. As a workaround, you could increase the bounds of the parent figure, so that the children figures are not clipped at the bounds. I do not know the details for this, but I know that it is a common problem with GEF 3.x Draw2D, so maybe you can find examples online. Another workaround would be to remove the parent-child-relation within the edit-part hierarchy, i.e. let ports and systems have parts on the same level of the hierarchy (if feasible).

However, with the new version of GEF (Neon: GEF4 1.1.0, Oxygen: GEF 5.0.0), where the visualization is based on JavaFX, this restriction was naturally lifted as JavaFX generally allows children to draw outside their parent. So depending on the features that are needed, maybe it is worth to take a look at the current version of GEF.

Best regards,
Matthias
Re: Display Child outside ParentContainer [message #1746408 is a reply to message #1746359] Fri, 28 October 2016 07:01 Go to previous messageGo to next message
Eclipse UserFriend
If you need to do this with GEF-Legacy, you might want to take a look at the GMF runtime. They have added support for such kind of abstractions in terms of their AbstractBorderItemEditPart.
Re: Display Child outside ParentContainer [message #1747160 is a reply to message #1746408] Thu, 10 November 2016 05:56 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alexander,

Thanks for this reply. Now i tried a lot with these Bordered items but i dont get it ... How do they work i read the documentation but there is no clue for me...
do u have a proper example for me how it is done ?
Re: Display Child outside ParentContainer [message #1747577 is a reply to message #1747160] Wed, 16 November 2016 03:16 Go to previous messageGo to next message
Eclipse UserFriend
Hi Korbinian,

We are also developing a system with ports, using GEF4. Our solution was to set the ports as edge source and target decorations. The only problem with this solution is that you cannot have unconnected ports.
Re: Display Child outside ParentContainer [message #1747580 is a reply to message #1747577] Wed, 16 November 2016 03:45 Go to previous message
Eclipse UserFriend
Within GEF4 there is no limitation that children are rendered outside their parents. Things would be easy there.

In GEF 3.x we have such a restriction (within Draw2d). You could work around it on the figure side by overwriting IFigure#getChildren() and remove the clipping there, but you really need to know what you are doing, as updating of dirty regions and repainting then has to be handled in your code as well. I pointed to GMF runtime because they have added respective concepts in their MVC abstractions already. That is probably the better place to start.
Previous Topic:Help to change property when figure changes (eg.: Height and Width)
Next Topic:How to use GEF Shapes editor example
Goto Forum:
  


Current Time: Fri Apr 18 07:30:08 EDT 2025

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

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

Back to the top