This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Setting individual zoom levels for X and Y axis | ||
---|---|---|---|
Product: | platform | Reporter: | maxnitribitt <maxnitribitt> |
Component: | Graph | Assignee: | issues@platform <issues> |
Status: | NEW --- | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
patch for issue 129169
2nd version patch for 129169 XYZoom |
Description
maxnitribitt
2008-03-04 17:01:06 UTC
Created attachment 57749 [details]
patch for issue 129169
I have tested the patch and updated it so it fits in better with less API changes. You can now set zoommode on the scene: public enum ZoomMode { ZOOM_MODE_VERTICAL_ONLY, ZOOM_MODE_HORIZONTAL_ONLY, ZOOM_MODE_BOTH } I think this is the way most users would like to use it. This also works with existing zoomactions and zoomanimators and getZoomfactor() and setZoomFactor() work without problems. SatelliteComponent also uses the correct Zoomfactors now. I have also introduced maxZoomFactor and minZoomfactor properties, so zooming can be limited. Created attachment 57956 [details]
2nd version patch for 129169 XYZoom
I think it is not necessary to have min-zoom and max-zoom since it would introduce tons-of-methods in Scene class. Instead I would just introduce a ZoomStrategy that would allow to limit zooming at the user-action level. This would be enough since the developer has control over the zoom factor when he/she sets it using Scene.setZoomFactor. Additionally I think it is not necessary to have ZoomModes since all the modes are just combination of zoomfactorx and zoomfactory. For accepting the patch, it has to contains additional information e.g. updated spec. version, api-change description, test, ... I will try to update the patch as soon as possible when i would have time. Thanks for patch. Thanks for considering the change and for the feedback. min and max zoom should not really have been part of this patch and should have been treated separately. I had introduced them since I needed a solution that works with your ZoomAction. I should have removed them before submitting the patch. Nevertheless great to hear that you're thinking about a different solution for the problem! I understand your point about ZoomMode, but it also has some advantages. Of the solutions I was trying, this one is best in terms of backward compatibility. getZoomFactor and setZoomFactor would still be the single points of access for a user in most cases. getZoomFactorX and getZoomFactorY are only exposed in the patch to allow access through SatelliteComponent and maybe could be removed (if ZoomModes were exclusive). API changes could then be kept to a minimum (only the additional setZoomMode() method and the enum). In addition the patch as is works perfectly with your default implementations. All other solutions I could imagine would involve more changes for the library and the user. With the patch as is the only thing a user needs to do is setZoomMode(ZoomMode.ZOOM_MODE_HORIZONTAL_ONLY) and he can use e.g. createZoomAction() without any further changes to his or your code. If I can help writing tests or API change proposals let me know. |