Documentation of 'visad.java2d.KeyboardBehaviorJ2D' Java class
KeyboardBehaviorJ2D
visad.java2d

Class KeyboardBehaviorJ2D

  • All Implemented Interfaces:
    KeyboardBehavior


    public class KeyboardBehaviorJ2D
    extends java.lang.Object
    implements KeyboardBehavior
    KeyboardBehaviorJ2D is the VisAD class for keyboard control of translate (pan) and zoom in Java2D.
    • Field Detail

      • ROTATE_Z_POS

        public static final int ROTATE_Z_POS
        Identifier for function to rotate positively around the Z viewing axis (perpendicular to the screen plane)
        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 (perpendicular to the screen plane)
        See Also:
        Constant Field Values
    • Constructor Detail

      • KeyboardBehaviorJ2D

        public KeyboardBehaviorJ2D(DisplayRendererJ2D 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 keys for manipulations are as follows:
        Translation
        • Arrow keys - translate up, down, left, right
        Zoom
        • Shift + Up arrow - zoom in (ZOOM_IN)
        • Shift + Down arrow - zoom out (ZOOM_OUT)
        Rotate
        • Shift + Left arrow - rotate left (ROTATE_Z_POS)
        • Shift + Right arrow - rotate right (ROTATE_Z_NEG)
        Reset
        • Ctrl + R key - reset to original projection (RESET)

        Parameters:
        r - DisplayRenderer to use.
        See Also:
        DisplayRendererJ2D.addKeyboardBehavior(KeyboardBehaviorJ2D behavior)
    • Method Detail

      • 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.