Xj3D 2.0 VRML/X3D Code API

org.xj3d.ui.awt.device.ogl.mouse
Class MouseDevice

java.lang.Object
  extended by org.xj3d.ui.awt.device.ogl.mouse.MouseDevice
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener, ControllerDevice, InputDevice, TrackerDevice

public class MouseDevice
extends java.lang.Object
implements TrackerDevice, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener

A mouse device implementation. This mouse is a typical picking and navigation style mouse.

Version:
$Revision: 1.4 $
Author:
Alan Hudson

Field Summary
 
Fields inherited from interface org.xj3d.device.InputDevice
FUNC_BUTTON_1, FUNC_BUTTON_2, FUNC_BUTTON_3, FUNC_BUTTON_4, FUNC_L1_BUTTON, FUNC_LEFT_HAT, FUNC_LEFT_STICK_X, FUNC_LEFT_STICK_Y, FUNC_LEFT_STICK_Z, FUNC_NAV_X, FUNC_NAV_Y, FUNC_NAV_Y_CENTERED, FUNC_NONE, FUNC_ORIENT_X, FUNC_ORIENT_Y, FUNC_R1_BUTTON, FUNC_RIGHT_STICK_X, FUNC_RIGHT_STICK_Y, FUNC_START_BUTTON, FUNC_THROTTLE, FUNC_VIEWPOINT_NEXT, FUNC_WHEEL_X
 
Constructor Summary
MouseDevice(org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDevice surface, java.lang.String name)
          Construct a new mouse device that interacts with the given surface, and is named.
 
Method Summary
 java.lang.String getName()
          Get the name of this device.
 int getTrackerCount()
          Get a count of the number of trackers this device has.
 Tracker[] getTrackers()
          Fetch the list of trackers generated by this output device
 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.
 void mouseWheelMoved(java.awt.event.MouseWheelEvent mwe)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseDevice

public MouseDevice(org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDevice surface,
                   java.lang.String name)
Construct a new mouse device that interacts with the given surface, and is named.

Parameters:
surface - The surface to track
name - The device name string
Method Detail

getName

public java.lang.String getName()
Get the name of this device. Names are of the form class-#. Valid classes are Gamepad, Joystick, Wheel, Midi, GenericHID.

Specified by:
getName in interface InputDevice
Returns:
The name

getTrackers

public Tracker[] getTrackers()
Fetch the list of trackers generated by this output device

Specified by:
getTrackers in interface TrackerDevice
Returns:
The trackers. This cannot changed after startup.

getTrackerCount

public int getTrackerCount()
Get a count of the number of trackers this device has. This cannot change during the life of a device.

Specified by:
getTrackerCount in interface TrackerDevice
Returns:
The number of trackers. This cannot change after startup.

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

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent mwe)
Specified by:
mouseWheelMoved in interface java.awt.event.MouseWheelListener

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium