Java Reference
In-Depth Information
Figure 7. Fourth code segment for KeyBoardNavigation.java
97.
public void processStimulus(Enumeration criteria)
98.
{
99.
WakeupCriterion wakeup; AWTEvent[] event ;
100.
while(criteria.hasMoreElements())
101.
{
102.
wakeup = (WakeupCriterion) criteria.nextElement();
103.
if(wakeup instanceof WakeupOnAWTEvent)
104.
{
105.
event = ((WakeupOnAWTEvent)wakeup).getAWTEvent();
106.
keyPressed((KeyEvent)event[0]);
107.
}
108.
}
109.
this.wakeupOn(allEvents);
110.
}
111.
112. } // end of class KeyBoardBehavior
Figure 8. Mouse interaction utility class
MouseRotate()
// constructor for a default mouse rotate behavior.
MouseRotate(int flags)
// create a rotate behavior with flags. Flags may be MouseBehavior.INVERT_INPUT or
// MouseBehavior.MANUAL_WAKEUP for inverting input or manual wakeup, respectively.
MouseRotate(TransformGroup transformGroup)
// create a rotate behavior given the transform group.
MouseTranslate()
MouseTranslate(int flags)
MouseTranslate(TransformGroup transformGroup)
// equivalent constructors for translation instead of rotation
MouseZoom()
MouseZoom(int flags)
MouseZoom(TransformGroup transformGroup)
// equivalent constructors for zooming instead of rotation
MouseBehavior Class
Response to Mouse Action
Mouse Action
Left-button held with mouse
movement
MouseRotate
Rotate object
Translate object in a plane parallel to
image plate
Right-button held with mouse
movement
MouseTranslate
Translate the object in a plane
orthogonal to the image plate
Middle-button held with mouse
movement
MouseZoom
Search WWH ::




Custom Search