Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » how to use zoom
how to use zoom [message #190171] Tue, 02 August 2005 19:36 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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());
Previous Topic:GEF figures don't show in editor
Next Topic:[Installation and Using]
Goto Forum:
  


Current Time: Fri Dec 13 03:17:23 GMT 2024

Powered by FUDForum. Page generated in 0.02418 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top