|[GEF4] Recreate selection handles after operation [message #1732853]
||Sat, 21 May 2016 05:48
| Colin Sharples
Registered: July 2009
Location: Wellington, New Zealand
I have some interaction policies that modify the geometry of a part, which will therefore affect the selection handles once the operation is completed. I need to recreate the selection handles afterwards so that they reflect the new state of the model object.|
At first I got hold of the SelectionModel in my IFXOnClickPolicy, and removed and re-added the host part to the selection. However, this creates separate operations in the undo history for the action, deselect and select, so that's not good (the user would have to ctrl-Z 3 times to undo what should be a single operation).
I then saw how some of the standard transaction policies would create a composite operation including a deselect and select, so I tried that. It took me a while to work out what was going on, as it appears that the operation gets executed more than one - I had to add a check in the operation to see if it had already been executed.
I have now got it so that the transaction policy creates a single ReverseUndoCompositeOperation with my operation, a DeselectOperation and a SelectOperation. However, this still does not work, because the SelectOperation always claims to be a no-op, as I am re-selecting the same part that was initially selected. The code runs okay, but now the part loses the selection after the operation is committed.
Is there a way that I can force the SelectOperation to run, or a way to reinvoke the creation of the selection handles without going through a SelectOperation?
CTG Games Ltd
Wellington, New Zealand
Powered by FUDForum
. Page generated in 0.02037 seconds