Bug 424943 - ResizableEditPolicy#getResizeCommand duplicates request ignoring some request values
Summary: ResizableEditPolicy#getResizeCommand duplicates request ignoring some request...
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 3.9.100 (Luna) M5   Edit
Assignee: Alexander Nyßen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 424942
  Show dependency tree
 
Reported: 2014-01-06 10:52 EST by Vincent Lorenzo CLA
Modified: 2015-04-16 07:12 EDT (History)
1 user (show)

See Also:
nyssen: iplog+
nyssen: luna+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lorenzo CLA 2014-01-06 10:52:42 EST
In the method org.eclipse.gef.editpolicies.ResizableEditPolicy#getResizeCommand, I think that you forgot these lines after the request creation : 
		req.setCenteredResize(request.isCenteredResize());
		req.setConstrainedMove(request.isConstrainedMove());
		req.setConstrainedResize(request.isConstrainedResize());
		req.setSnapToEnabled(request.isSnapToEnabled());
		
You have the same problem in getResizeCommand. 

For my usecase, I'm working on resize and probably on move in the future.
Please, could you add them in your code? Thank you.
Regards, 
-- 
Vincent Lorenzo
Comment 1 Alexander Nyßen CLA 2014-01-06 15:54:45 EST
These values are actually initialized within the related ResizeTracker#updateSourceRequest after the command has been returned by the policy. As such, we could add these lines but they won't have any direct effect. 

Did you notice some misbehavior that resulted from these missing lines?
Comment 2 Vincent Lorenzo CLA 2014-01-08 04:34:42 EST
(In reply to Alexander Nyssen from comment #1)
> These values are actually initialized within the related
> ResizeTracker#updateSourceRequest after the command has been returned by the
> policy. As such, we could add these lines but they won't have any direct
> effect. 
> 
> Did you notice some misbehavior that resulted from these missing lines?

There is not misbehavior, I report this bug because I'm overriding XYLayoutEditPolicy and I would like to use the method isConstrainedResize(). Unfortunately, this boolean value has not been initialized during the copy of the request.

Adding these lines in GEF will avoid us to do this minor change in all our subclasses of ResizableEditPolicy. 

Regards, 
-- 
Vincent Lorenzo
Comment 3 Alexander Nyßen CLA 2014-01-08 12:35:48 EST
Applied the proposed changes. Pushed to origin/master. Will be available in 3.10.0 M5.
Comment 4 Alexander Nyßen CLA 2015-03-20 08:30:37 EDT
Lorenzo, could you please sign the CLA and confirm that your contribution complies to the http://www.eclipse.org/legal/CoO.php?
Comment 5 Alexander Nyßen CLA 2015-03-22 05:55:38 EDT
(In reply to Alexander Nyßen from comment #4)
> Lorenzo, could you please sign the CLA and confirm that your contribution
> complies to the http://www.eclipse.org/legal/CoO.php?

Sorry, Vincent of course.
Comment 6 Vincent Lorenzo CLA 2015-04-16 07:11:36 EDT
Hi Alexander, 
as you asked me by email. I signed the CLA and I confirm than I have the right to make contribution.

    I have authored 100% of the contribution.
    I have the necessary rights to submit this contribution, including any necessary permissions from my employer.
    I am providing this contribution under the license(s) associated with the Eclipse Foundation project I am contributing to.
    I understand and agree that Eclipse projects and my contributions are public, and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with the license(s) involved.
Comment 7 Alexander Nyßen CLA 2015-04-16 07:12:23 EDT
Thanks very much!