Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 493590

Summary: FXRotateSelectedOnHandleDragPolicy should allow subclasses to override invalid gesture detection
Product: [Tools] GEF Reporter: Colin Sharples <ctg>
Component: GEF MVCAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: 0.2.0   
Target Milestone: 4.0.0 (Neon) RC1   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Colin Sharples CLA 2016-05-12 18:49:56 EDT
FXRotateSelectedOnHandleDragPolicy hard-codes the detection of a valid gesture to look for the control key being pressed. This is fine where this policy is being used with a selection handle that can initiate other transformations. However, if you use this policy with a dedicated rotation selection handle, it means that the user still has to hold down the control key to activate the policy.

It would be better to created a protected method to decide if the MouseEvent is a valid gesture, with the default implementation checking that control is pressed. This would allow a subclass to specify a different gesture (e.g. alt key or no meta key).

With the current implementation, you have to copy the whole class rather than just subclass to alter the behaviour.
Comment 1 Alexander Nyßen CLA 2016-05-13 08:17:22 EDT
While we are quite late in the game (i.e. we are behind feature/API freeze), I think this is a reasonable request that should be included in 4.0.0. I have nevertheless generalized it to provide respective callbacks for all our interaction policies. I pushed my changes to origin/master and resolve this as fixed in 4.0.0 RC1.