Documentation of 'visad.java3d.KeyboardBehaviorJ3D' Java class
KeyboardBehaviorJ3D
visad.java3d

Class KeyboardBehaviorJ3D

  • All Implemented Interfaces:
    KeyboardBehavior
    Direct Known Subclasses:
    CBMKeyboardBehaviorJ3D


    public class KeyboardBehaviorJ3D
    extends javax.media.j3d.Behavior
    implements KeyboardBehavior
    KeyboardBehaviorJ3D is the VisAD class for keyboard control of rotation, translation, and zoom of display in Java3D.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int ROTATE_X_NEG
      Identifier for function to rotate negatively around the X viewing axis
      static int ROTATE_X_POS
      Identifier for function to rotate positively around the X viewing axis
      static int ROTATE_Y_NEG
      Identifier for function to rotate negatively around the Y viewing axis
      static int ROTATE_Y_POS
      Identifier for function to rotate positively around the Y viewing axis
      static int ROTATE_Z_NEG
      Identifier for function to rotate negatively around the Z viewing axis
      static int ROTATE_Z_POS
      Identifier for function to rotate positively around the Z viewing axis
      • Fields inherited from class javax.media.j3d.Node

        ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void execFunction(int function)
      Executes the given function.
      void initialize()
      Initialize this behavior.
      void mapKeyToFunction(int function, int keycode, int modifiers)
      Maps key represented by keycode & modifiers to the given function.
      void processKeyEvent(java.awt.event.KeyEvent event)
      Process a key event.
      void processStimulus(java.util.Enumeration criteria)
      Process a stimulus meant for this behavior.
      • Methods inherited from class javax.media.j3d.Behavior

        getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences
      • Methods inherited from class javax.media.j3d.Node

        cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
      • Methods inherited from class javax.media.j3d.SceneGraphObject

        clearCapability, clearCapabilityIsFrequent, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • ROTATE_Z_POS

        public static final int ROTATE_Z_POS
        Identifier for function to rotate positively around the Z viewing axis
        See Also:
        Constant Field Values
      • ROTATE_Z_NEG

        public static final int ROTATE_Z_NEG
        Identifier for function to rotate negatively around the Z viewing axis
        See Also:
        Constant Field Values
      • ROTATE_X_POS

        public static final int ROTATE_X_POS
        Identifier for function to rotate positively around the X viewing axis
        See Also:
        Constant Field Values
      • ROTATE_X_NEG

        public static final int ROTATE_X_NEG
        Identifier for function to rotate negatively around the X viewing axis
        See Also:
        Constant Field Values
      • ROTATE_Y_POS

        public static final int ROTATE_Y_POS
        Identifier for function to rotate positively around the Y viewing axis
        See Also:
        Constant Field Values
      • ROTATE_Y_NEG

        public static final int ROTATE_Y_NEG
        Identifier for function to rotate negatively around the Y viewing axis
        See Also:
        Constant Field Values
    • Constructor Detail

      • KeyboardBehaviorJ3D

        public KeyboardBehaviorJ3D(DisplayRendererJ3D r)
        Construct a new keyboard behavior for the DisplayRenderer. You need to add the behavior to the DisplayRenderer if you want to use it. Default key assignments use the arrow keys to simulate the default VisAD mouse behavior.

        Rotation (3D renderer only):

        • Arrow keys - rotate up (X_NEG), down(X_POS), left(Y_NEG), right(Y_POS)
        Zoom:
        • Shift + Up arrow - zoom in (ZOOM_IN)
        • Shift + Down arrow - zoom out (ZOOM_OUT)
        Rotate:
        • Shift + Left arrow - rotate left around axis perpendicular to screen (Z_POS)
        • Shift + Right arrow - rotate right around axis perpendicular to screen (Z_NEG)
        Translate:
        • Ctrl + Arrow keys - translate up, down, left, right
        Reset:
        • Ctrl + R key - reset to original projection (RESET)

        Parameters:
        r - DisplayRenderer to use.
        See Also:
        DisplayRendererJ3D.addKeyboardBehavior(KeyboardBehaviorJ3D behavior), to change default key to function mappings
      • KeyboardBehaviorJ3D

        public KeyboardBehaviorJ3D(DisplayRendererJ3D r,
                                   int num_functions)
    • Method Detail

      • initialize

        public void initialize()
        Initialize this behavior. NOTE: Applications should not call this method. It is called by the Java 3D behavior scheduler.
        Specified by:
        initialize in class javax.media.j3d.Behavior
      • processStimulus

        public void processStimulus(java.util.Enumeration criteria)
        Process a stimulus meant for this behavior. This method is invoked when a key is pressed. NOTE: Applications should not call this method. It is called by the Java 3D behavior scheduler.
        Specified by:
        processStimulus in class javax.media.j3d.Behavior
        Parameters:
        criteria - an enumeration of triggered wakeup criteria
      • mapKeyToFunction

        public void mapKeyToFunction(int function,
                                     int keycode,
                                     int modifiers)
        Maps key represented by keycode & modifiers to the given function. Each function can only have one key/modifier combination assigned to it at a time.
        Specified by:
        mapKeyToFunction in interface KeyboardBehavior
        Parameters:
        function - keyboard function (ROTATE_X_POS, ZOOM_IN, etc)
        keycode - KeyEvent virtual keycodes
        modifiers - InputEvent key mask
        See Also:
        KeyEvent, InputEvent
      • processKeyEvent

        public void processKeyEvent(java.awt.event.KeyEvent event)
        Process a key event. Determines whether a meaningful key was pressed.
        Specified by:
        processKeyEvent in interface KeyboardBehavior
        Parameters:
        event - KeyEvent stimulus
      • execFunction

        public void execFunction(int function)
        Executes the given function.
        Specified by:
        execFunction in interface KeyboardBehavior
        Parameters:
        function - function to perform (TRANSLATE_UP, ZOOM_IN, etc)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.