|Registering children of a group [message #1729403]
||Wed, 13 April 2016 21:01
| Colin Sharples
Registered: July 2009
Location: Wellington, New Zealand
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?
CTG Games Ltd
Wellington, New Zealand
Powered by FUDForum
. Page generated in 0.02193 seconds