Java Doc for SensorEvent.java in  » 6.0-JDK-Modules » java-3d » com » sun » j3d » utils » behaviors » sensor » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » com.sun.j3d.utils.behaviors.sensor 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.j3d.utils.behaviors.sensor.SensorEvent

SensorEvent
public class SensorEvent (Code)
This class defines the event object that is created by a SensorEventAgent and passed to registered SensorReadListener and SensorButtonListener implementations.

The events passed to the listeners are ephemeral; they are only valid until the listener has returned. This is done to avoid allocating large numbers of mostly temporary objects, especially for behaviors that wake up every frame. If a listener needs to retain the event it must be copied using the SensorEvent(SensorEvent) constructor.
See Also:   SensorEventAgent
See Also:   SensorButtonListener
See Also:   SensorReadListener
since:
   Java 3D 1.3



Field Summary
final public static  intDRAGGED
     A button dragged event.
final public static  intNOBUTTON
     The value that is returned by getButton when no buttons have changed state.
final public static  intPRESSED
     A button pressed event.
final public static  intREAD
     A sensor read event.
final public static  intRELEASED
     A button released event.

Constructor Summary
public  SensorEvent(Object source, int id, Sensor sensor, Transform3D sensorRead, int[] buttonState, int button, long time, long lastTime)
     Creates a new SensorEvent.
public  SensorEvent()
     Creates a new ephemeral SensorEvent.
public  SensorEvent(SensorEvent e)
     Creates a copy of the given SensorEvent.

Method Summary
public  intgetButton()
     Gets the index of the button that changed state when passed to a pressed or released callback.
public  voidgetButtonState(int[] buttonState)
     Copies the state of the sensor's buttons at the time of the event into the given array.
public  intgetID()
     Gets the event type.
public  longgetLastTime()
     Gets the time in nanoseconds at which the dispatchEvents method of SensorEventAgent was last called to generate events, usually from the processStimulus method of a Behavior; may be used to measure frame time in behaviors that wake up every frame.
public  SensorgetSensor()
     Gets a reference to the provoking sensor.
public  voidgetSensorRead(Transform3D t)
     Copies the sensor's read value at the time of the event into the given Transform3D.
public  ObjectgetSource()
     Gets a reference to the originating object which instantiated the SensorEventAgent, usually a Behavior; may be null.
public  longgetTime()
     Gets the time in nanoseconds at which the dispatchEvents method of SensorEventAgent was called to generate this event, usually from the processStimulus method of a Behavior.
public  booleanisEphemeral()
     Returns true if this event is ephemeral and is valid only until the listener returns.
public  voidset(Object source, int id, Sensor sensor, Transform3D sensorRead, int[] buttonState, int button, long time, long lastTime)
     Sets the fields of an ephemeral event.

Field Detail
DRAGGED
final public static int DRAGGED(Code)
A button dragged event.



NOBUTTON
final public static int NOBUTTON(Code)
The value that is returned by getButton when no buttons have changed state.



PRESSED
final public static int PRESSED(Code)
A button pressed event.



READ
final public static int READ(Code)
A sensor read event.



RELEASED
final public static int RELEASED(Code)
A button released event.




Constructor Detail
SensorEvent
public SensorEvent(Object source, int id, Sensor sensor, Transform3D sensorRead, int[] buttonState, int button, long time, long lastTime)(Code)
Creates a new SensorEvent.
Parameters:
  source - a reference to the originating object whichinstantiated the SensorEventAgent, usually aBehavior; may be null
Parameters:
  id - event type
Parameters:
  sensor - a reference to the provoking sensor
Parameters:
  sensorRead - the sensor's read value at the time of the event
Parameters:
  buttonState - the state of the sensor's buttons at the time ofthe event, where a 1 in the array indicates that the button at thatindex is down, and a 0 indicates that button is up; may be null
Parameters:
  button - index of the button that changed state, from 0 to(buttonCount - 1), or the value NOBUTTON
Parameters:
  time - the time in nanoseconds at which thedispatchEvents method ofSensorEventAgent was called to generate this event,usually from the processStimulus method of a Behavior
Parameters:
  lastTime - the time in nanoseconds at which thedispatchEvents method ofSensorEventAgent was last called to generateevents, usually from the processStimulus method of aBehavior; may be used to measure frame time inbehaviors that wake up every frame



SensorEvent
public SensorEvent()(Code)
Creates a new ephemeral SensorEvent. In order to avoid creating large numbers of sensor event objects, the events passed to the button and read listeners by the dispatchEvents method of SensorEventAgent are valid only until the listener returns. If the event needs to be retained then they must be copied with the SensorEvent(SensorEvent) constructor.



SensorEvent
public SensorEvent(SensorEvent e)(Code)
Creates a copy of the given SensorEvent. Listeners must use this constructor to copy events that need to be retained. NOTE: The Sensor and Object references returned by getSensor and getSource remain references to the original objects.
Parameters:
  e - the event to be copied




Method Detail
getButton
public int getButton()(Code)
Gets the index of the button that changed state when passed to a pressed or released callback. The index may range from 0 to (sensor.getSensorButtonCount() - 1). The value returned is NOBUTTON for events passed to a read or dragged callback. the button index



getButtonState
public void getButtonState(int[] buttonState)(Code)
Copies the state of the sensor's buttons at the time of the event into the given array. A 1 in the array indicates that the button at that index is down, while a 0 indicates that button is up.
Parameters:
  buttonState - the state of the sensor buttons



getID
public int getID()(Code)
Gets the event type. the event id



getLastTime
public long getLastTime()(Code)
Gets the time in nanoseconds at which the dispatchEvents method of SensorEventAgent was last called to generate events, usually from the processStimulus method of a Behavior; may be used to measure frame time in behaviors that wake up every frame. last time in nanoseconds



getSensor
public Sensor getSensor()(Code)
Gets a reference to the provoking sensor. the provoking sensor



getSensorRead
public void getSensorRead(Transform3D t)(Code)
Copies the sensor's read value at the time of the event into the given Transform3D.
Parameters:
  t - the transform to receive the sensor read



getSource
public Object getSource()(Code)
Gets a reference to the originating object which instantiated the SensorEventAgent, usually a Behavior; may be null. the originating object



getTime
public long getTime()(Code)
Gets the time in nanoseconds at which the dispatchEvents method of SensorEventAgent was called to generate this event, usually from the processStimulus method of a Behavior. time in nanoseconds



isEphemeral
public boolean isEphemeral()(Code)
Returns true if this event is ephemeral and is valid only until the listener returns. A copy of the event can be created by passing it to the SensorEvent(SensorEvent) constructor.



set
public void set(Object source, int id, Sensor sensor, Transform3D sensorRead, int[] buttonState, int button, long time, long lastTime)(Code)
Sets the fields of an ephemeral event. No objects are copied. An IllegalStateException will be thrown if this event is not ephemeral.
Parameters:
  source - a reference to the originating object whichinstantiated the SensorEventAgent, usually aBehavior; may be null
Parameters:
  id - event type
Parameters:
  sensor - a reference to the provoking sensor
Parameters:
  sensorRead - the sensor's read value at the time of the event
Parameters:
  buttonState - the state of the sensor's buttons at the time ofthe event; a 1 in the array indicates that the button at thatindex is down, while a 0 indicates that button is up
Parameters:
  button - index of the button that changed state, from 0 to(buttonCount - 1), or the value NOBUTTON
Parameters:
  time - the time in nanoseconds at which thedispatchEvents method ofSensorEventAgent was called to generate this event,usually from the processStimulus method of a Behavior
Parameters:
  lastTime - the time in nanoseconds at which thedispatchEvents method ofSensorEventAgent was last called to generateevents, usually from the processStimulus method of aBehavior; may be used to measure frame time inbehaviors that wake up every frame



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.