NCSA Portfolio

ncsa.devices.mouse
Class MouseDevice

java.lang.Object
  |
  +--ncsa.devices.mouse.MouseDevice

public class MouseDevice
extends java.lang.Object
implements PortfolioEventReceiver, ncsa.devices.Fake2DInputDevice

This object samples MouseEvents and translates them into a series buttons presses (3types) and vector representation of the mouse(x&y only) This is considered an intermediate step to building a Java3D InputDevice as it seems appropriate to lump all types of 2d input devices together. This gives us the added benefit of writing Generic drivers that take a well defined 2d input (with buttons) and morph it into a 3d transform (complete with rotations and translations). The output consists of the following : an array of button values (3), which are ints. a vector, whose current value is the last mouse screen coordinate location when any button was down.


Field Summary
static int MAX_BUTTONS
           
 
Constructor Summary
MouseDevice()
          The constructor.
 
Method Summary
 int[] getButtons()
          This method returns the current state of the buttons.
 javax.vecmath.Vector3f getVector3f()
          This method returns the last mouse position during the last time any button was down.
 boolean notify(java.util.EventObject e)
          This method handles the mouse events
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_BUTTONS

public static final int MAX_BUTTONS
Constructor Detail

MouseDevice

public MouseDevice()
The constructor.
Method Detail

getVector3f

public javax.vecmath.Vector3f getVector3f()
This method returns the last mouse position during the last time any button was down. This is in screen coordinate positions.
Specified by:
getVector3f in interface ncsa.devices.Fake2DInputDevice

getButtons

public int[] getButtons()
This method returns the current state of the buttons.
Specified by:
getButtons in interface ncsa.devices.Fake2DInputDevice

notify

public boolean notify(java.util.EventObject e)
This method handles the mouse events
Specified by:
notify in interface PortfolioEventReceiver
Tags copied from interface: PortfolioEventReceiver
Parameters:
EventObject - The event to be processed.

NCSA Portfolio

NCSA Portfolio, Copyright 1997-1999, National Center for Supercomputing Applications, University of Illinois Urbana-Champaign, All Rights Reserved