Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.opengis.go.display.event
Interface KeyManager

All Superinterfaces:
  EventManager

    public interface KeyManager

extends EventManager

Defines a common abstraction for classes that handle key events. It prescribes a stack mechanism for managing `KeyHandler`s.

Method Summary
`void` | `enableKeyHandler(KeyHandler keyHandler)` Enables the given `KeyHandler`.
`KeyHandler` | `getCurrentKeyHandler()` Returns the current `KeyHandler` or `null` if no handler is set.
`KeyHandler[]` | `getFallbackKeyHandlers()` Returns an array of additional `KeyHandler`s to call for a given `KeyEvent`, if the current event handler doesn't handle it.
`void` | `pushKeyHandler(KeyHandler keyHandler)` Enables the given `KeyHandler`, and pushes it on the stack so that if another `KeyHandler` gets enabled, this one will be reenabled when that `KeyHandler` is removed.
`void` | `removeKeyHandler(KeyHandler keyHandler)` Removes the given `KeyHandler` and reinstates the `KeyHandler` at the top of the stack, if any.
`boolean` | `replaceKeyHandler(KeyHandler existingHandler, KeyHandler replacementHandler)` Replaces a `KeyHandler` in the stack with another `KeyHandler`.

Method Detail

### enableKeyHandler

    void enableKeyHandler(KeyHandler keyHandler)

  Enables the given `KeyHandler`. This `KeyManager` then passes events only to the given `KeyHandler` until it is either removed or another `KeyHandler` is enabled.

  Parameters:
    `keyHandler` - the new `KeyHandler` to enable.

### pushKeyHandler

    void pushKeyHandler(KeyHandler keyHandler)

  Enables the given `KeyHandler`, and pushes it on the stack so that if another `KeyHandler` gets enabled, this one will be reenabled when that `KeyHandler` is removed.

  Parameters:
    `keyHandler` - The `KeyHandler` to enable and push.
  See Also:
    `enableKeyHandler(org.opengis.go.display.event.KeyHandler)`

### removeKeyHandler

    void removeKeyHandler(KeyHandler keyHandler)

  Removes the given `KeyHandler` and reinstates the `KeyHandler` at the top of the stack, if any.

  Parameters:
    `keyHandler` - the `KeyHandler` to disable and remove.

### replaceKeyHandler

    boolean replaceKeyHandler(KeyHandler existingHandler,
                              KeyHandler replacementHandler)

  Replaces a `KeyHandler` in the stack with another `KeyHandler`.

  Parameters:
    `existingHandler` - the `KeyHandler` to be replaced.
    `replacementHandler` - the `KeyHandler` that is replacing the `existingHandler`.
  Returns:
    `true` if `existingHandler` was found and replaced by `replacementHandler`.

### getCurrentKeyHandler

    KeyHandler getCurrentKeyHandler()

  Returns the current `KeyHandler` or `null` if no handler is set.

  Returns:
    the current `KeyHandler` or `null`.

### getFallbackKeyHandlers

    KeyHandler[] getFallbackKeyHandlers()

  Returns an array of additional `KeyHandler`s to call for a given `KeyEvent`, if the current event handler doesn't handle it. These handlers will be called in ascending index order until the `KeyEvent` is consumed.

  Returns:
    The additional `KeyHandler`s.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1994-2008 Open Geospatial Consortium. All Rights Reserved.