j3d.org Code

org.j3d.ui.navigation
Class NavigationStateManager

java.lang.Object
  extended by org.j3d.ui.navigation.NavigationStateManager

public class NavigationStateManager
extends java.lang.Object

A handler for navigation state to make sure that all the right events are passed around the system and everyone agrees on the same state.

This class will change the cursor on the canvas in response to the current mouse and navigation state. There are three cursors used for walk, tilt and pan states. These can be found as:

Version:
$Revision $
Author:
Justin Couch

Constructor Summary
NavigationStateManager(java.awt.Component canvas)
          Create a new state manager that deals with the given canvas.
 
Method Summary
 int getNavigationState()
          Callback to ask the listener what navigation state it thinks it is in.
 void setMouseHandler(NavigationMouseProcessor view)
          Set the navigation handler instance to use.
 void setNavigationState(int state)
          Notification that the panning state has changed to the new state.
 void setNavigationStateListener(NavigationStateListener l)
          Set the listener for navigation state change notifications.
 void setToolbar(NavigationToolbar tbr)
          Set the toolbar instance to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NavigationStateManager

public NavigationStateManager(java.awt.Component canvas)
Create a new state manager that deals with the given canvas. The default state is set to WALK

Parameters:
canvas - The canvas to use
Method Detail

setToolbar

public void setToolbar(NavigationToolbar tbr)
Set the toolbar instance to use. Setting a value of null will clear the currently set instance.

Parameters:
tbr - The new toolbar instance to use

setMouseHandler

public void setMouseHandler(NavigationMouseProcessor view)
Set the navigation handler instance to use. Setting a value of null will clear the currently set instance.

Parameters:
view - The new processor for the mouse navigation

setNavigationStateListener

public void setNavigationStateListener(NavigationStateListener l)
Set the listener for navigation state change notifications. By setting a value of null it will clear the currently set instance

Parameters:
l - The listener to use for change updates

setNavigationState

public void setNavigationState(int state)
Notification that the panning state has changed to the new state.

Parameters:
state - One of the state values declared here

getNavigationState

public int getNavigationState()
Callback to ask the listener what navigation state it thinks it is in.

Returns:
The state that the listener thinks it is in

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org