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

Bug 450814

Summary: Extend API of ViewportModel with getter and setter for zoomfactor
Product: [Tools] GEF Reporter: Markus Muehlbrandt <markus.muehlbrandt>
Component: GEF MVCAssignee: Matthias Wienand <matthias.wienand>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: matthias.wienand
Version: unspecified   
Target Milestone: 3.10.0 (Mars) M4   
Hardware: All   
OS: All   
Whiteboard:

Description Markus Muehlbrandt CLA 2014-11-10 04:55:59 EST
The ZoomModel is replaced by the ViewportModel. On the ViewportModel the zoomfactor has to be set with setContentsTransform method which requires an AffineTransform object.

So the developer has to use some lower level API functionality to set zoom factors. It would be nice to have simple getters and setters for the zoom factor to keep the functionality of the previous ZoomModel within the ViewportModel.
Comment 1 Matthias Wienand CLA 2014-12-04 08:41:57 EST
I extended the AffineTransform class with methods to query zoom factor (#getScaleX(), #getScaleY()), rotation (#getRotation()), and translation (#getTranslateX(), #getTranslateY()). This should make it easy to use the API as is. I will update this ticket when the API advances.
Comment 2 Matthias Wienand CLA 2014-12-04 10:11:59 EST
We decided not to change the API of the ViewportModel. Therefore, I resolve this ticket as fixed for target milestone 3.10.0M4.