public abstract class IlvAbstractScrollInteractor extends IlvManagerViewInteractor
IlvAbstractScrollInteractor
is a base class for interactors
that scroll the view while dragging the mouse.Constructor and Description |
---|
IlvAbstractScrollInteractor()
Creates a new instance of
IlvAbstractScrollInteractor . |
Modifier and Type | Method and Description |
---|---|
protected void |
adjustPointIfOutsideView(IlvPoint p,
IlvPoint q)
Corrects the input point
p so that if p is
outside the view, it is only a limited amount outside the view. |
protected void |
detach()
Called when the interactor is detached from the current manager view.
|
protected boolean |
doAutoScroll(MouseEvent event)
Checks whether the input event should start the dragging scroll
timer.
|
protected abstract boolean |
dragscroll(MouseEvent event)
Called by the dragging scroll timer to scroll the view.
|
double |
getMaximumScrollDistance()
Returns the maximal distance of scroll operations when the mouse moves
outside the manager view.
|
int |
getScrollTiming()
Returns the timing of repetitive scroll operations when the mouse moves
outside
the manager view.
|
boolean |
isProgressiveScroll()
Returns whether progressive scrolling is enabled.
|
void |
setMaximumScrollDistance(double distance)
Sets the maximal distance of scroll operations when the mouse moves outside
the manager view.
|
void |
setProgressiveScroll(boolean enable)
Sets whether progressive scrolling is enabled.
|
void |
setScrollTiming(int timing)
Sets the timing of repetitive scroll operations when the mouse pointer
moves outside the manager view.
|
protected void |
startDraggingScrollTimer()
Starts the dragging scroll timer.
|
protected void |
stopDraggingScrollTimer()
Stop the dragging scroll timer.
|
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, attach, disableEvents, drawGhost, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, handleExpose, isXORGhost, processEvent, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhost
public IlvAbstractScrollInteractor()
IlvAbstractScrollInteractor
.public void setScrollTiming(int timing)
IlvManagerViewInteractor.ensureVisible(ilog.views.IlvPoint)
is allowed, the view starts scrolling in order
to make the dragged rectangle visible.
If the scroll timing is zero, the view only scrolls when the mouse moves.
If the scroll timing is larger than zero, the interactor triggers
repetitive scroll operations automatically, that is, the view continues
scrolling as long as the mouse pointer is outside the view, even if the
mouse pointer does not move. The scroll timing is the time in milliseconds
between triggering two scroll operations. Usual timings
are between 50 and 1000 ms.
By default, the scroll timing is 0.public int getScrollTiming()
setScrollTiming(int)
public void setMaximumScrollDistance(double distance)
IlvManagerViewInteractor.ensureVisible(ilog.views.IlvPoint)
is allowed, the view starts scrolling in order
to make the dragged rectangle visible.
The scroll operations can be repetitive (see setScrollTiming(int)
).
The speed of the scrolling depends on the scroll timing but also on the
distance the view is translated in each scroll step.
If the maximum scroll distance is below zero, the scroll distance is
unlimited and depends on the how far the mouse pointer is outside the view.
If the maximum scroll distance is a positive number, the scroll distance is
limited, that is, the view is translated in each scroll step at most this
distance.
By default, the maximum scroll distance is -1.public double getMaximumScrollDistance()
setMaximumScrollDistance(double)
public void setProgressiveScroll(boolean enable)
IlvManagerViewInteractor.ensureVisible(ilog.views.IlvPoint)
is allowed, the view starts scrolling in order
to make the dragged rectangle visible.
When a maximum scroll distance is given, the view scrolls only a limited
amount for each event. If progressive scrolling is enabled, the amount
depends on the distance of the mouse pointer outside the view. If
progressive scrolling is disabled, the scroll amount is constant.
This option has only an effect if the maximum scroll distance is a positive
number.
By default, progressive scrolling is enabled.public boolean isProgressiveScroll()
setProgressiveScroll(boolean)
protected void detach()
detach
in class IlvManagerViewInteractor
IlvManagerViewInteractor.attach(ilog.views.IlvManagerView)
protected abstract boolean dragscroll(MouseEvent event)
protected boolean doAutoScroll(MouseEvent event)
dragscroll(java.awt.event.MouseEvent)
repetitively until the mouse is inside
the view again.event
- The event.true
if the event has been processed,
false
otherwise.protected void startDraggingScrollTimer()
protected void stopDraggingScrollTimer()
protected void adjustPointIfOutsideView(IlvPoint p, IlvPoint q)
p
so that if p
is
outside the view, it is only a limited amount outside the view.
If p is inside the view, it does nothing.
The purpose of this correction is to limit the view shifting caused by
IlvManagerViewInteractor.ensureVisible(ilog.views.IlvPoint)
.p
- The point to be corrected.q
- The reference point before the dragging.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.