Package org.xj3d.ui.awt.widgets
Class CursorManager
java.lang.Object
org.xj3d.ui.awt.widgets.CursorManager
- All Implemented Interfaces:
KeyListener,EventListener,NavigationStateListener,SensorStatusListener,CursorManager
public class CursorManager
extends Object
implements CursorManager, SensorStatusListener, NavigationStateListener, KeyListener
Manages cursor icon changes based on state listeners.
Cursor definitions are loaded from a Properties object. The properties object is located in the following sequence:
- Supplied Properties object if not null
- Properties loaded from a properties file if it exists
- A default empty Properties object
- Version:
- $Revision: 1.10 $
- Author:
- Alan Hudson
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanAlt key modifierbooleanCtrl key modifierbooleanShift key modifierFields inherited from interface org.web3d.browser.NavigationStateListener
EXAMINE_STATE, FLY_STATE, NO_STATE, PAN_STATE, TILT_STATE, WALK_STATEFields inherited from interface org.web3d.browser.SensorStatusListener
TYPE_ANCHOR, TYPE_DRAG_SENSOR, TYPE_TOUCH_SENSOR -
Constructor Summary
ConstructorsConstructorDescriptionCursorManager(Component canvas, Properties skinProperties, org.j3d.util.ErrorReporter reporter) Create a new instance of the cursor manager with a customized set of images.CursorManager(Component canvas, org.j3d.util.ErrorReporter reporter) Create a new instance of the cursor manager using the default set of images. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeviceActivated(int type) Invoked when a tracker activates the sensor.voiddeviceNotOver(int type) Invoked when a tracker leaves contact with a sensor.voiddeviceOver(int type, String desc) Invoked when a sensor/anchor is in contact with a tracker capable of picking.Get the cursor cursor filter.voidkeyPressed(KeyEvent evt) Process a key press event.voidkeyReleased(KeyEvent evt) Process a key release event.voidProcess a key click event.voidlinkActivated(String[] urls, String[] params, String desc) Invoked when a tracker follows a link.voidnavigationListChanged(String[] modes, int numModes) Notification that the list of valid navigation modes has changed.voidnavigationStateChanged(int idx) Notification that the navigation state has changed to the new state.voidSet the cursor to the currently specified image.voidSet the cursor cursor filter.
-
Field Details
-
shiftModifier
public boolean shiftModifierShift key modifier -
altModifier
public boolean altModifierAlt key modifier -
ctrlModifier
public boolean ctrlModifierCtrl key modifier
-
-
Constructor Details
-
CursorManager
public CursorManager(Component canvas, org.j3d.util.ErrorReporter reporter) throws IllegalArgumentException Create a new instance of the cursor manager using the default set of images.- Parameters:
canvas- The canvas to manage cursors forreporter- The reporter instance to use or null- Throws:
IllegalArgumentException- The canvas reference is null
-
CursorManager
public CursorManager(Component canvas, Properties skinProperties, org.j3d.util.ErrorReporter reporter) throws IllegalArgumentException Create a new instance of the cursor manager with a customized set of images.- Parameters:
canvas- The canvas to manage cursors forskinProperties- Properties object specifying cursor image namesreporter- The reporter instance to use or null- Throws:
IllegalArgumentException- The canvas reference is null
-
-
Method Details
-
setCursorFilter
Set the cursor cursor filter. NULL will disable filtering- Specified by:
setCursorFilterin interfaceCursorManager- Parameters:
cf- The filter
-
getCursorFilter
Get the cursor cursor filter. NULL means no filtering.- Specified by:
getCursorFilterin interfaceCursorManager- Returns:
- The filter
-
setCursor
Set the cursor to the currently specified image. Normal changes can still occur. Monitor the cursorFilter for changes.- Specified by:
setCursorin interfaceCursorManager- Parameters:
url- The image to use. Null returns the cursor to its current statex- The center x coordinatey- The center y coordinate
-
deviceOver
Invoked when a sensor/anchor is in contact with a tracker capable of picking.- Specified by:
deviceOverin interfaceSensorStatusListener- Parameters:
type- The sensor typedesc- The sensor's description string
-
deviceNotOver
public void deviceNotOver(int type) Invoked when a tracker leaves contact with a sensor.- Specified by:
deviceNotOverin interfaceSensorStatusListener- Parameters:
type- The sensor type
-
deviceActivated
public void deviceActivated(int type) Invoked when a tracker activates the sensor. Anchors will not receive this event, they get a linkActivated call.- Specified by:
deviceActivatedin interfaceSensorStatusListener- Parameters:
type- The sensor type
-
linkActivated
Invoked when a tracker follows a link.- Specified by:
linkActivatedin interfaceSensorStatusListener- Parameters:
urls- The url to load.params- The list of paramters for the urlsdesc- The description string that accompanied the link
-
keyPressed
Process a key press event.- Specified by:
keyPressedin interfaceKeyListener- Parameters:
evt- The event that caused this method to be called
-
keyReleased
Process a key release event.- Specified by:
keyReleasedin interfaceKeyListener- Parameters:
evt- The event that caused this method to be called
-
keyTyped
Process a key click event.- Specified by:
keyTypedin interfaceKeyListener- Parameters:
evt- The event that caused this method to be called
-