Java Reference
In-Depth Information
Figure 29. Code segment for
public void initialize()
//set initial wakeup condition
events[0]=new WakeupOnAWTEvent(MouseEvent.MOUSE_DRAGGED);
events[1]=new WakeupOnAWTEvent(MouseEvent.MOUSE_PRESSED);
events[2]=new WakeupOnAWTEvent(MouseEvent.MOUSE_RELEASED);
events[3]=new WakeupOnAWTEvent(MouseEvent.MOUSE_MOVED);
allEvents=new WakeupOr(events);
10. }
two of which create a WakeupCondition from several WakeupCriterion through a logical
And and Or operation. Similarly, the last two constructors allow for the composition of the
first two classes into more complex WakeupCondition objects.
The code fragment in Figure 29 illustrates the use of WakeupOr to construct a behavior
trigger for capturing any of the event mouse conditions stated.
In this chapter, we have discussed how behavior class can be used to detect user inputs and
changes in the graphical objects for the purpose of allowing the user to interact with a Java
3D created virtual world (Wang, Wong, Shen, & Lang, 2001). Specifically, through the
construction of custom wakeup conditions and criteria, the system will be able to provide
changes to the virtual 3D scene and objects through some appropriate processStimulus
methods when the relevant stimulus or trigger condition is received. Complicated behavior
can be handled by creating specialized wakeup triggers that respond to combinations of
wakeup conditions, by having behaviors that post events, by detecting object collisions as
well as the entry and exit of objects and viewing platforms into certain spatial bounds.
Geroimenko, V., & Geroimenko, L. (2000). Visualizing human consciousness content using
Java 3D/X3D and psychological techniques. Proceedings IEEE Conference on Information
Visualization (pp. 529-532).
Search WWH ::

Custom Search