public class ViewportAutoexposeHelper extends java.lang.Object implements AutoexposeHelper
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.).AutoexposeHelper.Search| Modifier and Type | Field and Description |
|---|---|
protected GraphicalEditPart |
owner |
| Constructor and Description |
|---|
ViewportAutoexposeHelper(GraphicalEditPart owner)
Constructs a new helper on the given GraphicalEditPart.
|
ViewportAutoexposeHelper(GraphicalEditPart owner,
Insets threshold)
Constructs a new helper on the given GraphicalEditPart.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
detect(Point where)
Returns
true if the given point is inside the viewport, but
near its edge. |
protected Viewport |
findViewport(GraphicalEditPart part) |
boolean |
step(Point where)
Returns
true if the given point is outside the viewport or
near its edge. |
java.lang.String |
toString() |
protected GraphicalEditPart owner
public ViewportAutoexposeHelper(GraphicalEditPart owner)
Viewport somewhere between its contentsPane
and its figure inclusively.owner - the GraphicalEditPart that owns the Viewportpublic ViewportAutoexposeHelper(GraphicalEditPart owner, Insets threshold)
Viewport somewhere between its contentsPane
and its figure inclusively.owner - the GraphicalEditPart that owns the Viewportthreshold - the Expose Threshold to use when determing whether or not a
scroll should occur.public boolean detect(Point where)
true if the given point is inside the viewport, but
near its edge.detect in interface AutoexposeHelperwhere - the mouse's current location in the viewertrue if the location is interestingAutoexposeHelper.detect(org.eclipse.draw2d.geometry.Point)public boolean step(Point where)
true if the given point is outside the viewport or
near its edge. Scrolls the viewport by a calculated (time based) amount
in the current direction.
todo: investigate if we should allow auto expose when the pointer is
outside the viewportstep in interface AutoexposeHelperwhere - the current location of the mouse in the viewerAutoexposeHelper.step(org.eclipse.draw2d.geometry.Point)public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()protected Viewport findViewport(GraphicalEditPart part)
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.