Xj3D VRML/X3D Code API

org.web3d.vrml.nodes.runtime
Class AWTListenerEventBuffer

java.lang.Object
  extended byorg.web3d.vrml.nodes.runtime.AWTListenerEventBuffer
All Implemented Interfaces:
java.util.EventListener, InputEventBuffer, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class AWTListenerEventBuffer
extends java.lang.Object
implements InputEventBuffer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.KeyListener

Implementation of the event buffer code that handles input from generic AWT event listener code.

NOTE: This class is no longer in use. See the InputDeviceManager for an alternate.

Version:
$Revision: 1.3 $
Author:
Justin Couch

Constructor Summary
AWTListenerEventBuffer()
          Create a new default listener.
 
Method Summary
 int getKeyEvents(java.awt.event.KeyEvent[] events)
          Get the list of keyboard keycodes that were hit in the last frame.
 int getMouseEvents(java.awt.event.MouseEvent[] events)
          Get the last mouse event that was received.
 void keyPressed(java.awt.event.KeyEvent evt)
          Notification of a key press event.
 void keyReleased(java.awt.event.KeyEvent evt)
          Notification of a key release event.
 void keyTyped(java.awt.event.KeyEvent evt)
          Notification of a key type (press and release) event.
 void mouseClicked(java.awt.event.MouseEvent evt)
          Process a mouse click event.
 void mouseDragged(java.awt.event.MouseEvent evt)
          Process a mouse drag event
 void mouseEntered(java.awt.event.MouseEvent evt)
          Process a mouse enter event.
 void mouseExited(java.awt.event.MouseEvent evt)
          Process a mouse exited event.
 void mouseMoved(java.awt.event.MouseEvent evt)
          Process a mouse movement event.
 void mousePressed(java.awt.event.MouseEvent evt)
          Process a mouse press event.
 void mouseReleased(java.awt.event.MouseEvent evt)
          Process a mouse release event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWTListenerEventBuffer

public AWTListenerEventBuffer()
Create a new default listener. The listener is not registered with any user interface elements.

Method Detail

getKeyEvents

public int getKeyEvents(java.awt.event.KeyEvent[] events)
Get the list of keyboard keycodes that were hit in the last frame. This will be presented in the order that they were pressed. When providing an array, the end user should choose a value that is "big enough" to handle what could possibly be given. There's no hints from this code, but it is unlikely that very long periods of time will exist between calls so there's no need to pass in an array 64k ints long. The return value will include the number of valid items copied into the array. If the user's array is too short then it will be filled, and the return value will indicate the real number of events that were buffered.

Specified by:
getKeyEvents in interface InputEventBuffer
Parameters:
events - The array to copy the key codes into
Returns:
The number of events copied into the array

getMouseEvents

public int getMouseEvents(java.awt.event.MouseEvent[] events)
Get the last mouse event that was received.

Specified by:
getMouseEvents in interface InputEventBuffer
Parameters:
events - The array to copy the key codes into
Returns:
The last mouse event reference

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
Process a mouse press event.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
evt - The event that caused this method to be called

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
Process a mouse release event.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
evt - The event that caused this method to be called

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent evt)
Process a mouse click event.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
evt - The event that caused this method to be called

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent evt)
Process a mouse enter event.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
evt - The event that caused this method to be called

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
Process a mouse exited event.

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
evt - The event that caused this method to be called

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent evt)
Process a mouse drag event

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
evt - The event that caused this method to be called

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent evt)
Process a mouse movement event.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
evt - The event that caused this method to be called

keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
Notification of a key press event. This will any one of the key value fields depending on the value.

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
evt - The key event that caused this method to be called

keyReleased

public void keyReleased(java.awt.event.KeyEvent evt)
Notification of a key release event. This will any one of the key value fields depending on the value.

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
evt - The key event that caused this method to be called

keyTyped

public void keyTyped(java.awt.event.KeyEvent evt)
Notification of a key type (press and release) event. This will any one of the key value fields depending on the value.

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
evt - The key event that caused this method to be called

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium