Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse GEF
3.3

org.eclipse.gef.editparts
Class ViewportMouseWheelHelper

java.lang.Object
  extended byorg.eclipse.gef.editparts.ViewportHelper
      extended by
org.eclipse.gef.editparts.ViewportMouseWheelHelper
All Implemented Interfaces:
MouseWheelHelper

public class ViewportMouseWheelHelper
extends org.eclipse.gef.editparts.ViewportHelper
implements MouseWheelHelper

ViewportMouseWheelHelper is the default MouseWheelHelper that should be used to scroll edit parts.

Since:
3.1

Field Summary
protected   GraphicalEditPart owner
           
 
Constructor Summary
ViewportMouseWheelHelper ( GraphicalEditPart part)
          Constructor
ViewportMouseWheelHelper ( GraphicalEditPart part, int lineHeight, int pageHeight)
          Constructor
 
Method Summary
protected   Viewport findViewport ( GraphicalEditPart part)
           
 void handleMouseWheelScrolled (Event event)
          Finds the viewport of the given EditPart and scrolls it as requested.
 void setLineHeight (int height)
          Sets the height (in pixels) that will be scrolled when line scrolling is requested.
 void setPageHeight (int height)
          Sets the height (in pixels) that will be scrolled when page scrolling is requested.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

owner

protected 
GraphicalEditPart owner
Constructor Detail

ViewportMouseWheelHelper

public ViewportMouseWheelHelper(
GraphicalEditPart part)
Constructor

Parameters:
part - the EditPArt that has to be scrolled

ViewportMouseWheelHelper

public ViewportMouseWheelHelper(
GraphicalEditPart part,
                                int lineHeight,
                                int pageHeight)
Constructor

Parameters:
part - the EditPart that has to be scrolled
lineHeight - the new line height
pageHeight - the new page height
See Also:
setLineHeight(int), setPageHeight(int)
Method Detail

handleMouseWheelScrolled

public void handleMouseWheelScrolled(Event event)
Finds the viewport of the given EditPart and scrolls it as requested. If it can't be scrolled then leaves doit to be true so that the given EditPart's ancestors might have a chance to scroll.

Specified by:
handleMouseWheelScrolled in interface MouseWheelHelper
Parameters:
event - The SWT event that was generated as a result of the mouse-wheel scrolling
See Also:
org.eclipse.gef.MouseWheelHelper#handleMouseWheelScrolled(org.eclipse.swt.widgets.Event)

setLineHeight

public void setLineHeight(int height)
Sets the height (in pixels) that will be scrolled when line scrolling is requested. If the line height is set to 0 or less, or not set at all, a default height will be used.

Parameters:
height - the new line height

setPageHeight

public void setPageHeight(int height)
Sets the height (in pixels) that will be scrolled when page scrolling is requested. A page height that is less than the line height will not be respected. If the page height is set to -1, or one is not set at all, the default height will be used. The default height is calculated based on the given EditPart's figure's viewport's size. It will not be less than the line height.

Parameters:
height - the new page height

findViewport

protected 
Viewport findViewport(
GraphicalEditPart part)

Eclipse GEF
3.3

Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire