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 TypeFieldDescriptionboolean
Alt key modifierboolean
Ctrl key modifierboolean
Shift key modifierFields inherited from interface org.web3d.browser.NavigationStateListener
EXAMINE_STATE, FLY_STATE, NO_STATE, PAN_STATE, TILT_STATE, WALK_STATE
Fields 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 TypeMethodDescriptionvoid
deviceActivated
(int type) Invoked when a tracker activates the sensor.void
deviceNotOver
(int type) Invoked when a tracker leaves contact with a sensor.void
deviceOver
(int type, String desc) Invoked when a sensor/anchor is in contact with a tracker capable of picking.Get the cursor cursor filter.void
keyPressed
(KeyEvent evt) Process a key press event.void
keyReleased
(KeyEvent evt) Process a key release event.void
Process a key click event.void
linkActivated
(String[] urls, String[] params, String desc) Invoked when a tracker follows a link.void
navigationListChanged
(String[] modes, int numModes) Notification that the list of valid navigation modes has changed.void
navigationStateChanged
(int idx) Notification that the navigation state has changed to the new state.void
Set the cursor to the currently specified image.void
Set 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:
setCursorFilter
in interfaceCursorManager
- Parameters:
cf
- The filter
-
getCursorFilter
Get the cursor cursor filter. NULL means no filtering.- Specified by:
getCursorFilter
in 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:
setCursor
in 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:
deviceOver
in 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:
deviceNotOver
in 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:
deviceActivated
in interfaceSensorStatusListener
- Parameters:
type
- The sensor type
-
linkActivated
Invoked when a tracker follows a link.- Specified by:
linkActivated
in 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:
keyPressed
in interfaceKeyListener
- Parameters:
evt
- The event that caused this method to be called
-
keyReleased
Process a key release event.- Specified by:
keyReleased
in interfaceKeyListener
- Parameters:
evt
- The event that caused this method to be called
-
keyTyped
Process a key click event.- Specified by:
keyTyped
in interfaceKeyListener
- Parameters:
evt
- The event that caused this method to be called
-