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 managingKeyHandlers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidenableKeyHandler(KeyHandler keyHandler)Enables the givenKeyHandler.KeyHandlergetCurrentKeyHandler()Returns the currentKeyHandlerornullif no handler is set.KeyHandler[]getFallbackKeyHandlers()Returns an array of additionalKeyHandlers to call for a givenKeyEvent, if the current event handler doesn't handle it.voidpushKeyHandler(KeyHandler keyHandler)Enables the givenKeyHandler, and pushes it on the stack so that if anotherKeyHandlergets enabled, this one will be reenabled when thatKeyHandleris removed.voidremoveKeyHandler(KeyHandler keyHandler)Removes the givenKeyHandlerand reinstates theKeyHandlerat the top of the stack, if any.booleanreplaceKeyHandler(KeyHandler existingHandler, KeyHandler replacementHandler)Replaces aKeyHandlerin the stack with anotherKeyHandler.
-
-
-
Method Detail
-
enableKeyHandler
void enableKeyHandler(KeyHandler keyHandler)
Enables the givenKeyHandler. ThisKeyManagerthen passes events only to the givenKeyHandleruntil it is either removed or anotherKeyHandleris enabled.- Parameters:
keyHandler- the newKeyHandlerto enable.
-
pushKeyHandler
void pushKeyHandler(KeyHandler keyHandler)
Enables the givenKeyHandler, and pushes it on the stack so that if anotherKeyHandlergets enabled, this one will be reenabled when thatKeyHandleris removed.- Parameters:
keyHandler- TheKeyHandlerto enable and push.- See Also:
enableKeyHandler(org.opengis.go.display.event.KeyHandler)
-
removeKeyHandler
void removeKeyHandler(KeyHandler keyHandler)
Removes the givenKeyHandlerand reinstates theKeyHandlerat the top of the stack, if any.- Parameters:
keyHandler- theKeyHandlerto disable and remove.
-
replaceKeyHandler
boolean replaceKeyHandler(KeyHandler existingHandler, KeyHandler replacementHandler)
Replaces aKeyHandlerin the stack with anotherKeyHandler.- Parameters:
existingHandler- theKeyHandlerto be replaced.replacementHandler- theKeyHandlerthat is replacing theexistingHandler.- Returns:
trueifexistingHandlerwas found and replaced byreplacementHandler.
-
getCurrentKeyHandler
KeyHandler getCurrentKeyHandler()
Returns the currentKeyHandlerornullif no handler is set.- Returns:
- the current
KeyHandlerornull.
-
getFallbackKeyHandlers
KeyHandler[] getFallbackKeyHandlers()
Returns an array of additionalKeyHandlers to call for a givenKeyEvent, if the current event handler doesn't handle it. These handlers will be called in ascending index order until theKeyEventis consumed.- Returns:
- The additional
KeyHandlers.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG