Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » horizontal scroll with mouse wheel
horizontal scroll with mouse wheel [message #238816] Wed, 03 October 2007 12:13 Go to next message
Eclipse UserFriend
Originally posted by:

Hi! All,

Could you please tell me the way to implement horizontal scroll with
mouse wheel event on GraphicalViewer? (like SHIFT button + mouse scroll)

I would be thankful, if you could me some code snippet.

Re: horizontal scroll with mouse wheel [message #720646 is a reply to message #238816] Wed, 31 August 2011 01:56 Go to previous message
Baek, Kyeong Myeong is currently offline Baek, Kyeong MyeongFriend
Messages: 1
Registered: August 2011
Junior Member
try this code in your project
GraphicalViewer viewer = getGraphicalViewer();

KeyHandler keyHandler = new KeyHandler();

		new MouseWheelHandler() {
			final int DELTA = 20;

			public void handleMouseWheel(Event event,
					EditPartViewer viewer) {
				ScalableFreeformRootEditPart rootEditPart_;
				rootEditPart_ = (ScalableFreeformRootEditPart) viewer
				Viewport viewport = rootEditPart_.getZoomManager()
				if (viewport != null) {
							.translate(DELTA * event.count, 0));
					event.doit = false;
Previous Topic:Left and Right scrolling??
Next Topic:Problem with Plotting Example with Draw2D and SWT with the Java platform
Goto Forum:

Current Time: Wed Jun 20 00:19:11 GMT 2018

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

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

Back to the top