y.view
Class InteractiveViewMode

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

public class InteractiveViewMode
extends ViewMode

A ViewMode for interactive input scenarios. This class provides blocking methods such as getClickedNode that allow interactive processing of view based input events. The caller of such a method blocks until a user clicks on a node, etc. The caller of the blocking query methods may not live in the same AWT thread that provides coordinates to this mode.


Field Summary
 
Fields inherited from class y.view.ViewMode
lastClickEvent, lastDragEvent, lastPressEvent, lastReleaseEvent, originalX, originalY, view
 
Constructor Summary
InteractiveViewMode()
          Initializes a new InteractiveViewMode.
 
Method Summary
 Node getClickedNode()
          Blocks until a node in the associated view gets clicked by a user.
 void mousePressedLeft(double x, double y)
          Stores the press location.
 void mouseReleasedLeft(double x, double y)
          Called when the left mouse button was released.
 void waitForClick()
          Blocks until a click occured in the associated view.
 
Methods inherited from class y.view.ViewMode
activate, getGraph2D, getGridX, getGridY, getHitInfo, getHitInfo, getLastHitInfo, getName, init, isGrabFocusEnabled, isGridMode, mouseClicked, mouseClicked, mouseDragged, mouseDraggedLeft, mouseDraggedMiddle, mouseDraggedRight, mouseEntered, mouseExited, mouseMoved, mouseMoved, mousePressed, mousePressedMiddle, mousePressedRight, mouseReleased, mouseReleased, mouseReleasedMiddle, mouseReleasedRight, 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

InteractiveViewMode

public InteractiveViewMode()
Initializes a new InteractiveViewMode.

Method Detail

mousePressedLeft

public void mousePressedLeft(double x,
                             double y)
Stores the press location.

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.

mouseReleasedLeft

public void mouseReleasedLeft(double x,
                              double y)
Description copied from class: ViewMode
Called when the left mouse button was released.

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.

getClickedNode

public Node getClickedNode()
Blocks until a node in the associated view gets clicked by a user. This method must be invoked from outside the AWT Event thread.

Returns:
the node clicked on

waitForClick

public void waitForClick()
Blocks until a click occured in the associated view. This method must be invoked from outside the AWT Event thread.

Returns:
the node clicked on

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

2003