edu.umd.cs.piccolox.event
Class PNavigationEventHandler

java.lang.Object
  extended by edu.umd.cs.piccolo.event.PBasicInputEventHandler
      extended by edu.umd.cs.piccolox.event.PNavigationEventHandler
All Implemented Interfaces:
PInputEventListener, java.util.EventListener

public class PNavigationEventHandler
extends PBasicInputEventHandler

PNavigationEventHandler implements simple focus based navigation. Uses mouse button one or the arrow keys to set a new focus. Animates the canvas view to keep the focus node on the screen and at 100 percent scale with minimal view movement.

Version:
1.0
Author:
Jesse Grosjean

Field Summary
static int EAST
           
static int IN
           
static int NORTH
           
static int OUT
           
static int SOUTH
           
static int WEST
           
 
Constructor Summary
PNavigationEventHandler()
           
 
Method Summary
protected  PActivity animateCameraViewTransformTo(PCamera aCamera, java.awt.geom.AffineTransform aTransform, int duration)
           
 PActivity directCameraViewToFocus(PCamera aCamera, PNode aFocusNode, int duration)
           
protected  void fillViewWhiteSpace(PCamera aCamera)
           
 PNode getNeighborInDirection(int aDirection)
           
 java.util.List getNeighbors()
           
 void keyPressed(PInputEvent e)
           
 void mousePressed(PInputEvent aEvent)
           
 void moveFocusDown(PInputEvent e)
           
 void moveFocusIn(PInputEvent e)
           
 void moveFocusLeft(PInputEvent e)
           
 void moveFocusOut(PInputEvent e)
           
 void moveFocusRight(PInputEvent e)
           
 void moveFocusToMouseOver(PInputEvent e)
           
 void moveFocusUp(PInputEvent e)
           
 boolean nodeIsNeighborInDirection(PNode aNode, int aDirection)
           
 void sortNodesByDistanceFromPoint(java.util.List aNodesList, java.awt.geom.Point2D aPoint)
           
 
Methods inherited from class edu.umd.cs.piccolo.event.PBasicInputEventHandler
acceptsEvent, getEventFilter, keyboardFocusGained, keyboardFocusLost, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseReleased, mouseWheelRotated, mouseWheelRotatedByBlock, paramString, processEvent, setEventFilter, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NORTH

public static final int NORTH
See Also:
Constant Field Values

SOUTH

public static final int SOUTH
See Also:
Constant Field Values

EAST

public static final int EAST
See Also:
Constant Field Values

WEST

public static final int WEST
See Also:
Constant Field Values

IN

public static final int IN
See Also:
Constant Field Values

OUT

public static final int OUT
See Also:
Constant Field Values
Constructor Detail

PNavigationEventHandler

public PNavigationEventHandler()
Method Detail

keyPressed

public void keyPressed(PInputEvent e)
Overrides:
keyPressed in class PBasicInputEventHandler

mousePressed

public void mousePressed(PInputEvent aEvent)
Overrides:
mousePressed in class PBasicInputEventHandler

moveFocusDown

public void moveFocusDown(PInputEvent e)

moveFocusIn

public void moveFocusIn(PInputEvent e)

moveFocusLeft

public void moveFocusLeft(PInputEvent e)

moveFocusOut

public void moveFocusOut(PInputEvent e)

moveFocusRight

public void moveFocusRight(PInputEvent e)

moveFocusUp

public void moveFocusUp(PInputEvent e)

moveFocusToMouseOver

public void moveFocusToMouseOver(PInputEvent e)

getNeighborInDirection

public PNode getNeighborInDirection(int aDirection)

getNeighbors

public java.util.List getNeighbors()

nodeIsNeighborInDirection

public boolean nodeIsNeighborInDirection(PNode aNode,
                                         int aDirection)

sortNodesByDistanceFromPoint

public void sortNodesByDistanceFromPoint(java.util.List aNodesList,
                                         java.awt.geom.Point2D aPoint)

animateCameraViewTransformTo

protected PActivity animateCameraViewTransformTo(PCamera aCamera,
                                                 java.awt.geom.AffineTransform aTransform,
                                                 int duration)

directCameraViewToFocus

public PActivity directCameraViewToFocus(PCamera aCamera,
                                         PNode aFocusNode,
                                         int duration)

fillViewWhiteSpace

protected void fillViewWhiteSpace(PCamera aCamera)


Copyright 2005 by University of Maryland, College Park, MD 20742, USA All rights reserved.

Web Accessibility