org.eclipse.gef.editparts
Class ViewportAutoexposeHelper
java.lang.Object
|
+--org.eclipse.gef.editparts.ViewportHelper
|
+--org.eclipse.gef.editparts.ViewportAutoexposeHelper
- All Implemented Interfaces:
- AutoexposeHelper
- public class ViewportAutoexposeHelper
- extends org.eclipse.gef.editparts.ViewportHelper
- implements AutoexposeHelper
An implementation of AutoexposeHelper
that performs
autoscrolling of a Viewport
figure. This helper is for use with
graphical editparts that contain a viewport figure. This helper will search the
editpart and find the viewport. Autoscroll will occur when the detect location is
inside the viewport's bounds, but near its edge. It will continue for as long as the
location continues to meet these criteria. The autoscroll direction is approximated to
the nearest orthogonal or diagonal direction (north, northeast, east, etc.).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
owner
protected GraphicalEditPart owner
ViewportAutoexposeHelper
public ViewportAutoexposeHelper(GraphicalEditPart owner)
- Constructs a new helper on the given GraphicalEditPart. The editpart must have a
Viewport
somewhere between its contentsPane and its figure
inclusively.
- Parameters:
owner
- the GraphicalEditPart that owns the Viewport
detect
public boolean detect(Point where)
- Returns
true
if the given point is inside the viewport, but near its edge.
- Specified by:
detect
in interface AutoexposeHelper
- Parameters:
where
- the mouse's current location in the viewer
- Returns:
true
if the location is interesting- See Also:
AutoexposeHelper.detect(org.eclipse.draw2d.geometry.Point)
step
public boolean step(Point where)
- Returns
true
if the given point is inside the viewport, but near its edge.
Scrolls the viewport by a small amount in the current direction.
- Specified by:
step
in interface AutoexposeHelper
- Parameters:
where
- the current location of the mouse in the viewer
- Returns:
- a hint indicating whether this helper should continue to be invoked
- See Also:
AutoexposeHelper.step(org.eclipse.draw2d.geometry.Point)
findViewport
protected Viewport findViewport(GraphicalEditPart part)
Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.