Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » eclipse, GEF: how to use zoom
eclipse, GEF: how to use zoom [message #192033] Fri, 12 August 2005 22:02
Eclipse UserFriend
Originally posted by: no.yes.maybe

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 3.1 update within Eclipse GUI errors (network)
Next Topic:What is the best way to make a thick arrow connector?
Goto Forum:
  


Current Time: Tue Jan 14 06:38:53 GMT 2025

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

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

Back to the top