|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.Graph2DViewMouseWheelScrollListener
public class Graph2DViewMouseWheelScrollListener
Scrolls a Graph2DView
's view port in vertical or horizontal direction
in response to mouse wheel events.
Instances of this class should be registered as a listener for mouse wheel
events using method addToCanvas(Graph2DView)
.
Graph2DViewMouseWheelZoomListener
Constructor Summary | |
---|---|
Graph2DViewMouseWheelScrollListener()
Initializes a new Graph2DViewMouseWheelScrollListener
instance. |
Method Summary | |
---|---|
void |
addToCanvas(Graph2DView view)
Adds this listener to the set of listeners that are notified of mouse wheel events for the specified view. |
int |
getHorizontalScrollingModifierMask()
Returns the modifier mask that switches from vertical scrolling to horizontal scrolling. |
boolean |
isSmartScrollingEnabled()
Determines whether or not smart scrolling should be used. |
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Scrolls the view port of the Graph2DView associated to the
specified mouse wheel event in an appropriate direction. |
void |
removeFromCanvas(Graph2DView view)
Removes this listener from the set of listeners that are notified of mouse wheel events for the specified view. |
void |
setHorizontalScrollingModifierMask(int mask)
Specifies the modifier mask that switches from vertical scrolling to horizontal scrolling. |
void |
setSmartScrollingEnabled(boolean enabled)
Specifies whether or not smart scrolling should be used. |
protected boolean |
shouldScrollHorizontally(java.awt.event.MouseWheelEvent e)
Determines if the specified mouse wheel event should result in horizontal scrolling. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Graph2DViewMouseWheelScrollListener()
Graph2DViewMouseWheelScrollListener
instance.
Method Detail |
---|
public void addToCanvas(Graph2DView view)
view.getCanvasComponent().addMouseWheelListener(this);
view
- the Graph2DView
instance whose mouse wheel events
should be handled by this listener.removeFromCanvas(Graph2DView)
public void removeFromCanvas(Graph2DView view)
view.getCanvasComponent().removeMouseWheelListener(this);
view
- the Graph2DView
instance whose mouse wheel events
were handled by this listener.addToCanvas(Graph2DView)
public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Graph2DView
associated to the
specified mouse wheel event in an appropriate direction.
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
e
- the mouse wheel event that triggers scrolling.shouldScrollHorizontally(java.awt.event.MouseWheelEvent)
,
isSmartScrollingEnabled()
public boolean isSmartScrollingEnabled()
modified
mouse wheel events
will scroll horizontally (if and only if a horizontal scroll bar is
visible).
By default, this feature is disabled.
true
is smart scrolling is enabled; false
otherwise.setSmartScrollingEnabled(boolean)
public void setSmartScrollingEnabled(boolean enabled)
modified
mouse wheel events
will scroll horizontally (if and only if a horizontal scroll bar is
visible).
By default, this feature is disabled.
enabled
- if true
smart scrolling will be used.isSmartScrollingEnabled()
public int getHorizontalScrollingModifierMask()
Defaults to InputEvent.SHIFT_MASK
.
setHorizontalScrollingModifierMask(int)
,
shouldScrollHorizontally(java.awt.event.MouseWheelEvent)
,
isSmartScrollingEnabled()
public void setHorizontalScrollingModifierMask(int mask)
Defaults to InputEvent.SHIFT_MASK
.
mask
- the modifier mask used to switch from vertical scrolling to
horizontal scrolling.getHorizontalScrollingModifierMask()
,
shouldScrollHorizontally(java.awt.event.MouseWheelEvent)
,
isSmartScrollingEnabled()
protected boolean shouldScrollHorizontally(java.awt.event.MouseWheelEvent e)
smart scrolling
is enabled and there is only a vertical scroll bar.
e
- the mouse wheel event that triggers scrolling.
true
if the specified mouse wheel event should result
in horizontal scrolling; false
otherwise.isSmartScrollingEnabled()
,
getHorizontalScrollingModifierMask()
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |