Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Registering children of a group
Registering children of a group [message #1729403] Wed, 13 April 2016 21:01 Go to next message
Colin Sharples is currently offline Colin SharplesFriend
Messages: 90
Registered: July 2009
Location: Wellington, New Zealand
Member

I have a couple of parts with complex content, so I am using a Group to render them. That is, my part extends AbstractFXContentPart<Group>, and adds the children in createVisual().

I do it like this because the children are purely used for visual purposes, and have no corresponding model objects. An example is a line of trees (the overall view represents a map). The model object is called TreeLine, and is represented by a (gef4.geometry) Polyline. To render this, I have a number of images of trees, and so I create a Group containing several ImageViews spaced along the outline of the Polyline. I don't want to have the actual polyline rendered, so I have also created a transparent javafx Polyline and added that to the Group to act as a proxy for the shape's outline.

In my selection handle part factory, I look for a target of that type, and instead of getting the Group's outline, I use the proxy Polyline to generate the selection handles. The problem is that the selection handle factory is never getting invoked.

I presume this is because it is the Group that is getting registered as the visual for the part, and it is transparent to mouse events and so is not getting picked up by the FXClickDragTool. Is there a way to register the proxy Polyline so that it will pick up the mouse events?


Colin Sharples
CTG Games Ltd
Wellington, New Zealand
Re: Registering children of a group [message #1729442 is a reply to message #1729403] Thu, 14 April 2016 08:29 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 163
Registered: March 2015
Senior Member
This should not be a problem as all visuals that are children of the "main" visual of the content part (in this case the Group) are inserted into the visual-part-map. Actually, the GeometryNode (FX) renders a transparent geometry with a thick stroke on top of itself so that even thin geometries are easily clickable. Can you post your code so that I can investigate?

Regards,
Matthias
Re: Registering children of a group [message #1729458 is a reply to message #1729442] Thu, 14 April 2016 09:54 Go to previous message
Colin Sharples is currently offline Colin SharplesFriend
Messages: 90
Registered: July 2009
Location: Wellington, New Zealand
Member

It's okay, I found the issue. I had refactored my different parts (around 40) into 5 base classes, and then one superclass above those 5, so that I could attach the common policies to the top superclass. The two parts that didn't fit neatly into the other types had just been left extending AbstractFXContentPart directly - I thought I had refactored them to use the common superclass. As you said, all the child visuals are getting registered, they just weren't picking up the common policy. When I changed them to extend the superclass, the selection handles appeared okay.

Thanks Matthias.


Colin Sharples
CTG Games Ltd
Wellington, New Zealand
Previous Topic:Selection of elements in GEF
Next Topic:GEF4 Tooltip
Goto Forum:
  


Current Time: Thu Nov 15 09:26:01 GMT 2018

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

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

Back to the top