edu.umd.cs.piccolo
Class PInputManager

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

public class PInputManager
extends PBasicInputEventHandler
implements PRoot.InputSource

PInputManager is responsible for dispatching PInputEvents to node's event listeners. Events are dispatched from PRoot's processInputs method.

Version:
1.0
Author:
Jesse Grosjean
See Also:
PInputEvent, PRoot

Constructor Summary
PInputManager()
           
 
Method Summary
protected  void checkForMouseEnteredAndExited(PInputEvent event)
           
 java.awt.geom.Point2D getCurrentCanvasPosition()
           
 PInputEventListener getKeyboardFocus()
          Return the node that currently has the keyboard focus.
 java.awt.geom.Point2D getLastCanvasPosition()
           
 PPickPath getMouseFocus()
          Return the node that currently has the mouse focus.
 PPickPath getMouseOver()
          Return the node the the mouse is currently over.
 void keyPressed(PInputEvent event)
           
 void keyReleased(PInputEvent event)
           
 void keyTyped(PInputEvent event)
           
 void mouseClicked(PInputEvent event)
           
 void mouseDragged(PInputEvent event)
           
 void mouseEntered(PInputEvent event)
           
 void mouseExited(PInputEvent event)
           
 void mouseMoved(PInputEvent event)
           
 void mousePressed(PInputEvent event)
           
 void mouseReleased(PInputEvent event)
           
 void mouseWheelRotated(PInputEvent event)
           
 void mouseWheelRotatedByBlock(PInputEvent event)
           
 void processEventFromCamera(java.awt.event.InputEvent event, int type, PCamera camera)
           
 void processInput()
           
 void setKeyboardFocus(PInputEventListener eventHandler)
          Set the node that should recive key events.
 void setMouseFocus(PPickPath path)
           
 void setMouseOver(PPickPath path)
           
 
Methods inherited from class edu.umd.cs.piccolo.event.PBasicInputEventHandler
acceptsEvent, getEventFilter, keyboardFocusGained, keyboardFocusLost, paramString, processEvent, setEventFilter, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PInputManager

public PInputManager()
Method Detail

getKeyboardFocus

public PInputEventListener getKeyboardFocus()
Return the node that currently has the keyboard focus. This node receives the key events.


setKeyboardFocus

public void setKeyboardFocus(PInputEventListener eventHandler)
Set the node that should recive key events.


getMouseFocus

public PPickPath getMouseFocus()
Return the node that currently has the mouse focus. This will return the node that received the current mouse pressed event, or null if the mouse is not pressed. The mouse focus gets mouse dragged events even what the mouse is not over the mouse focus.


setMouseFocus

public void setMouseFocus(PPickPath path)

getMouseOver

public PPickPath getMouseOver()
Return the node the the mouse is currently over.


setMouseOver

public void setMouseOver(PPickPath path)

getLastCanvasPosition

public java.awt.geom.Point2D getLastCanvasPosition()

getCurrentCanvasPosition

public java.awt.geom.Point2D getCurrentCanvasPosition()

keyPressed

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

keyReleased

public void keyReleased(PInputEvent event)
Overrides:
keyReleased in class PBasicInputEventHandler

keyTyped

public void keyTyped(PInputEvent event)
Overrides:
keyTyped in class PBasicInputEventHandler

mouseClicked

public void mouseClicked(PInputEvent event)
Overrides:
mouseClicked in class PBasicInputEventHandler

mouseWheelRotated

public void mouseWheelRotated(PInputEvent event)
Overrides:
mouseWheelRotated in class PBasicInputEventHandler

mouseWheelRotatedByBlock

public void mouseWheelRotatedByBlock(PInputEvent event)
Overrides:
mouseWheelRotatedByBlock in class PBasicInputEventHandler

mouseDragged

public void mouseDragged(PInputEvent event)
Overrides:
mouseDragged in class PBasicInputEventHandler

mouseEntered

public void mouseEntered(PInputEvent event)
Overrides:
mouseEntered in class PBasicInputEventHandler

mouseExited

public void mouseExited(PInputEvent event)
Overrides:
mouseExited in class PBasicInputEventHandler

mouseMoved

public void mouseMoved(PInputEvent event)
Overrides:
mouseMoved in class PBasicInputEventHandler

mousePressed

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

mouseReleased

public void mouseReleased(PInputEvent event)
Overrides:
mouseReleased in class PBasicInputEventHandler

checkForMouseEnteredAndExited

protected void checkForMouseEnteredAndExited(PInputEvent event)

processInput

public void processInput()
Specified by:
processInput in interface PRoot.InputSource

processEventFromCamera

public void processEventFromCamera(java.awt.event.InputEvent event,
                                   int type,
                                   PCamera camera)


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

Web Accessibility