|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.ViewMode y.view.AutoDragViewMode
public class AutoDragViewMode
ViewMode implementation that adds automatic scrolling capabilities to
Graph2DView
. Automatic scrolling will be activated
when dragging the mouse outside of the visible part of the view.
Note that this view mode can be safely added
registered with the view in parallel to other view modes that are
provided by the yFiles view package.
// get the view instance Graph2DView view = getView(); // create the view mode AutoDragViewMode adm = new AutoDragViewMode(); // register it with the view view.addViewMode(adm);
Field Summary |
---|
Fields inherited from class y.view.ViewMode |
---|
ACTIVE_PROPERTY, ACTIVE_VIEW_PROPERTY, CHILD_MODE_PROPERTY, EDITING_PROPERTY, GRAB_FOCUS_ENABLED_PROPERTY, lastClickEvent, lastDragEvent, lastMoveEvent, lastPressEvent, lastReleaseEvent, MODIFIER_MASK_PROPERTY, NAME_PROPERTY, originalX, originalY, PARENT_MODE_PROPERTY, view |
Constructor Summary | |
---|---|
AutoDragViewMode()
Creates a new AutoDragViewMode that can be added as a view mode to a GRaph2DView. |
Method Summary | |
---|---|
void |
dispose()
Stops automatic scrolling and disposes internal data structures. |
void |
mouseClicked(java.awt.event.MouseEvent mouseEvent)
Initiates auto-drag. |
void |
mouseDragged(java.awt.event.MouseEvent mouseEvent)
Updates auto-drag information. |
void |
mouseExited(java.awt.event.MouseEvent mouseEvent)
Initiates auto-drag. |
void |
mousePressed(java.awt.event.MouseEvent mouseEvent)
Initiates auto-drag. |
void |
mouseReleased(java.awt.event.MouseEvent mouseEvent)
Initiates auto-drag. |
void |
setAutoDrag(int dx,
int dy,
java.awt.event.MouseEvent me)
Initiates auto scrolling using the given direction vector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AutoDragViewMode()
Method Detail |
---|
public void dispose()
public void setAutoDrag(int dx, int dy, java.awt.event.MouseEvent me)
MouseEvent.MOUSE_DRAGGED
events, that will be dispatched to the
view component during auto-scrolling.
Calling this method with (dx,dy) = (0,0) will effectively
stop the auto-scrolling.
dx
- the delta x direction vector for the scrollingdy
- the delta y direction vector for the scrollingme
- the event that will be used for the artificial mouse eventspublic void mouseExited(java.awt.event.MouseEvent mouseEvent)
mouseExited
in interface java.awt.event.MouseListener
mouseExited
in class ViewMode
public void mouseClicked(java.awt.event.MouseEvent mouseEvent)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class ViewMode
public void mousePressed(java.awt.event.MouseEvent mouseEvent)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class ViewMode
public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class ViewMode
public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class ViewMode
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |