how to use zoom [message #190171] |
Tue, 02 August 2005 19:36 |
Eclipse User |
|
|
|
Originally posted by: no.yes.maybe
Can someone point me to an example that uses the zoom feature?
Thanks,
Roberto
|
|
|
Re: how to use zoom [message #190208 is a reply to message #190171] |
Tue, 02 August 2005 20:52 |
Eclipse User |
|
|
|
Originally posted by: jjefferies.acm.org
check out the Logic example.
In LogicEditor.java, you'll notice this:
ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();
List zoomLevels = new ArrayList(3);
zoomLevels.add(ZoomManager.FIT_ALL);
zoomLevels.add(ZoomManager.FIT_WIDTH);
zoomLevels.add(ZoomManager.FIT_HEIGHT);
root.getZoomManager().setZoomLevelContributions(zoomLevels);
IAction zoomIn = new ZoomInAction(root.getZoomManager());
IAction zoomOut = new ZoomOutAction(root.getZoomManager());
getActionRegistry().registerAction(zoomIn);
getActionRegistry().registerAction(zoomOut);
getSite().getKeyBindingService().registerAction(zoomIn);
getSite().getKeyBindingService().registerAction(zoomOut);
viewer.setRootEditPart(root);
This is where the Zoom functionality is initialized.
You will then be able to get the ZoomManager from the Viewer:
ZoomManager manager = (ZoomManager)getGraphicalViewer()
.getProperty(ZoomManager.class.toString());
|
|
|
Powered by
FUDForum. Page generated in 0.02418 seconds