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:connection feedbacks
Next Topic:Adding a Ctrl-i keystroke
Goto Forum:

Current Time: Tue Oct 25 22:49:27 GMT 2016

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

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