y.view
Class NavigationMode

java.lang.Object
  |
  +--y.view.ViewMode
        |
        +--y.view.NavigationMode
All Implemented Interfaces:
EventListener, MouseInputListener, MouseListener, MouseMotionListener

public class NavigationMode
extends ViewMode

A view mode that allows to navigate in a view


Field Summary
 
Fields inherited from class y.view.ViewMode
lastClickEvent, lastDragEvent, lastPressEvent, lastReleaseEvent, originalX, originalY, view
 
Constructor Summary
NavigationMode()
          Initializes a new NavigationMode.
NavigationMode(ViewContainer vc)
          Initializes a new NavigationMode for the given ViewContainer.
 
Method Summary
 void activate(boolean b)
          When activated disables scrollbars in Graph2DView
 PopupMode getPopupMode()
          Returns the popup mode associated with this mode.
 void mouseDraggedLeft(double x, double y)
          Moves the viewport of this view.
 void mouseDraggedRight(double x, double y)
          Moves the viewport of this view in an animated fashion.
 void mousePressedLeft(double x, double y)
          Initiates a navigation action.
 void mousePressedRight(double x, double y)
          Either activates a popup mode or an animated scroller for the view.
 void mouseReleasedLeft(double x, double y)
          Terminates a navigation action.
 void mouseReleasedRight(double x, double y)
          Terminates a navigation action.
 void setPopupMode(PopupMode pl)
          Sets the popup mode for this mode.
 
Methods inherited from class y.view.ViewMode
getGraph2D, getGridX, getGridY, getHitInfo, getHitInfo, getLastHitInfo, getName, init, isGrabFocusEnabled, isGridMode, mouseClicked, mouseClicked, mouseDragged, mouseDraggedMiddle, mouseEntered, mouseExited, mouseMoved, mouseMoved, mousePressed, mousePressedMiddle, mouseReleased, mouseReleased, mouseReleasedMiddle, mouseShiftPressedLeft, mouseShiftPressedMiddle, mouseShiftPressedRight, mouseShiftReleasedLeft, mouseShiftReleasedMiddle, mouseShiftReleasedRight, reactivateParent, setActiveView, setChild, setChild, setGrabFocusEnabled, setGridMode, setLastHitInfo, setName, setParent, translateX, translateY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NavigationMode

public NavigationMode(ViewContainer vc)
Initializes a new NavigationMode for the given ViewContainer.


NavigationMode

public NavigationMode()
Initializes a new NavigationMode.

Method Detail

activate

public void activate(boolean b)
When activated disables scrollbars in Graph2DView

Overrides:
activate in class ViewMode
Parameters:
b - set true when mode should be activated false otherwise

getPopupMode

public PopupMode getPopupMode()
Returns the popup mode associated with this mode.


setPopupMode

public void setPopupMode(PopupMode pl)
Sets the popup mode for this mode. If a popup mode is set for this mode then the right mouse button will be used to activate that mode.


mousePressedLeft

public void mousePressedLeft(double x,
                             double y)
Initiates a navigation action.

Overrides:
mousePressedLeft in class ViewMode
Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mousePressedRight

public void mousePressedRight(double x,
                              double y)
Either activates a popup mode or an animated scroller for the view.

Overrides:
mousePressedRight in class ViewMode
Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseReleasedRight

public void mouseReleasedRight(double x,
                               double y)
Terminates a navigation action.

Overrides:
mouseReleasedRight in class ViewMode
Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseReleasedLeft

public void mouseReleasedLeft(double x,
                              double y)
Terminates a navigation action.

Overrides:
mouseReleasedLeft in class ViewMode
Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseDraggedLeft

public void mouseDraggedLeft(double x,
                             double y)
Moves the viewport of this view.

Overrides:
mouseDraggedLeft in class ViewMode
Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseDraggedRight

public void mouseDraggedRight(double x,
                              double y)
Moves the viewport of this view in an animated fashion.

Overrides:
mouseDraggedRight in class ViewMode
Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003