|[GEF4] Selection handles for different actions [message #1732753]
||Thu, 19 May 2016 21:42
| Colin Sharples
Registered: July 2009
Location: Wellington, New Zealand
For some of my parts, I would like to be able to generate a different set of selection handles depending on the action the user wants to perform.|
For example, I have a part that manages a GeometricNode<Polyline>. The default action is to manipulate the shape of the line, so the selection handle factory creates handles to move each line segment and to create new segments. That's all working fine.
Now I want to add an action that lets the user split the line into two at one of the bendpoints in the line, so I want a different set of selection handles, only on the bendpoints, that will indicate which bendpoint is to be used to split the line. Triggering that mode would be either by a gesture (e.g. ctrl+click) or from a context menu button.
Looking at FXDefaultSelectionHandlePartFactory, I can't see any way that I can indicate what mode it should create handles for - it only accepts a SelectionBehavior, and as far as I can see the contextMap is always hardcoded as an empty map. Does that mean I need to create a different type of handle part factory, and invoke that from a custom policy? I'd like something reasonably generic, as I have several different scenarios that have a similar mechanism.
CTG Games Ltd
Wellington, New Zealand
Powered by FUDForum
. Page generated in 0.01415 seconds