Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Zest - Zooming functionality via mouse wheel
Zest - Zooming functionality via mouse wheel [message #946520] Tue, 16 October 2012 09:02 Go to next message
Alexander von Eich is currently offline Alexander von EichFriend
Messages: 7
Registered: March 2012
Junior Member
Hello,

I included a ZoomContributionViewItem in the RCP toolbar to zoom a zest graph. This works very well. But now I want to zoom using a mouse wheel. I dont have an idea how I could achieve this. Or is using the ZoomContribution the only way to zoom a ZEST Graph?

Regards

Alexander
Re: Zest - Zooming functionality via mouse wheel [message #957913 is a reply to message #946520] Thu, 25 October 2012 15:47 Go to previous message
Johan Schulz is currently offline Johan SchulzFriend
Messages: 20
Registered: November 2010
Junior Member
I use this snippet in my Viewpart to get the default zoom behavior CTRL+MWheel.

viewer.getGraphControl().addMouseWheelListener( new MouseWheelListener() {
            @Override
            public void mouseScrolled(final MouseEvent ev) {
                if (( ev.stateMask & SWT.CTRL ) == 0)
                    return;
                                
                if (ev.count > 0) {
                    viewer.getGraphControl().getZoomManager().zoomOut();
                } else if (ev.count < 0) {
                    viewer.getGraphControl().getZoomManager().zoomIn();
                }
            }
        } );


Regards

Johan
Previous Topic:[Zest] Refreshing attribute of a node *Solved*
Next Topic:DnD Gui
Goto Forum:
  


Current Time: Sat Dec 20 03:54:02 GMT 2014

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

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