BaseHandler (object)¶
バージョン 2.0.1 で追加.
BaseHandler class allows to handle/process user events. Any custom handlers should specialize this class. How handlers process events from the host application is down to the implementation of the onEvent method.
参考
:kl-ref:``, EventHandler, HandlerDispatcher, Tool
Members¶
Boolean | enabled | Handler is enabled. |
Key | enableKey | Enable key. |
HandlerExclusivity | handlerExclusivity | Handler exclusivity. |
Boolean | isIndependent | HandlerExclusivity local override. |
Boolean | takeAllEvents | It true, the handler takes all the events. |
Boolean | alwaysEnabled | It true, the handler takes all the events. |
Boolean | isOwnedByDispatcher | Checks if the handler is owned by a handlerDispatcher. In most of the cases, the dispatcher owns the handlers. However, it’s not true in DFG graphs where the handlers are owns by the nodes. |
Ref<HandlerDispatcher> | dispatcher | Reference to the dispatcher. |
Methods¶
BaseHandler ( in BaseHandler other ) | |
BaseHandler ( in Key enableKey, in HandlerExclusivity exclusivity, in Boolean isIndependent, in Boolean takeAllEvents, in Boolean isOwnedByDispatcher ) | |
BaseHandler () | |
BaseHandler | clone ? () |
disable ! () | |
enable ! () | |
HandlerDescription | getDescription ? () |
Ref<HandlerDispatcher> | getDispatcher ? () |
Key | getEnableKey ? () |
HandlerExclusivity | getExclusivity ? () |
Boolean | hasKey ? ( in Key key ) |
init ! ( in Key enableKey, in HandlerExclusivity exclusivity, in Boolean isIndependent, in Boolean takeAllEvents, in Boolean isOwnedByDispatcher ) | |
init ! ( in Key enableKey, in HandlerExclusivity exclusivity, in Boolean isOwnedByDispatcher ) | |
Boolean | isAlwaysEnabled ? () |
Boolean | isEnabled ? () |
Boolean | isIndependent ? () |
Boolean | isOwnedByDispatcher ? () |
onEvent ! ( io BaseEvent baseEvent ) | |
onEvent ! ( io Event event ) | |
setAlwaysEnabled ! ( in Boolean alwaysEnabled ) | |
setDispatcher ! ( in Ref<HandlerDispatcher> dispatcher ) | |
setEnableKey ! ( in Key key ) | |
setExclusivity ! ( in HandlerExclusivity handlerExclusivity ) | |
setIndependent ! ( in Boolean independent ) | |
setTakeAllEvents ! ( in Boolean takeAllEvents ) | |
Boolean | takeAllEvents ? () |
~BaseHandler () |
Methods in detail¶
BaseHandler ( in BaseHandler other )
copy constructor
BaseHandler ( in Key enableKey, in HandlerExclusivity exclusivity, in Boolean isIndependent, in Boolean takeAllEvents, in Boolean isOwnedByDispatcher )
Constructs a BaseHandler.
enableKey | The key that enables/disables the handler. |
exclusivity | Handler exclusivity. |
isIndependent | If true, independent handler. |
takeAllEvents | If true, force this handler to get all the events. |
isOwnedByDispatcher | If true, owned by the dispatcher when registered. |
BaseHandler ()
default constructor
BaseHandler BaseHandler.clone? ()
clone method
BaseHandler.disable! ()
Implementation of EventHandler.
BaseHandler.enable! ()
Implementation of EventHandler.
HandlerDescription BaseHandler.getDescription? ()
Implementation of EventHandler. To override.
Ref<HandlerDispatcher> BaseHandler.getDispatcher? ()
Implementation of EventHandler.
Key BaseHandler.getEnableKey? ()
Implementation of EventHandler.
HandlerExclusivity BaseHandler.getExclusivity? ()
Implementation of EventHandler.
Boolean BaseHandler.hasKey? ( in Key key )
Implementation of EventHandler. To override.
BaseHandler.init! ( in Key enableKey, in HandlerExclusivity exclusivity, in Boolean isIndependent, in Boolean takeAllEvents, in Boolean isOwnedByDispatcher )
Initializes a BaseHandler.
enableKey | The key that enables/disables the handler. |
exclusivity | Handler exclusivity. |
isIndependent | If true, independent handler. |
takeAllEvents | If true, force this handler to get all the events. |
isOwnedByDispatcher | If true, owned by the dispatcher when registered. |
BaseHandler.init! ( in Key enableKey, in HandlerExclusivity exclusivity, in Boolean isOwnedByDispatcher )
Initializes a BaseHandler, no-independent and doesn’t take all the events.
enableKey | The key that enables/disables the handler. |
exclusivity | Handler exclusivity. |
isOwnedByDispatcher | If true, owned by the dispatcher when registered. |
Boolean BaseHandler.isAlwaysEnabled? ()
Implementation of EventHandler.
Boolean BaseHandler.isEnabled? ()
Implementation of EventHandler.
Boolean BaseHandler.isIndependent? ()
Implementation of EventHandler.
Boolean BaseHandler.isOwnedByDispatcher? ()
Implementation of EventHandler.
BaseHandler.onEvent! ( io BaseEvent baseEvent )
Helper to call onEvent method from a host application.
BaseHandler.onEvent! ( io Event event )
Implementation of EventHandler. To override.
BaseHandler.setAlwaysEnabled! ( in Boolean alwaysEnabled )
Implementation of EventHandler.
BaseHandler.setDispatcher! ( in Ref<HandlerDispatcher> dispatcher )
Implementation of EventHandler.
BaseHandler.setEnableKey! ( in Key key )
Implementation of EventHandler.
BaseHandler.setExclusivity! ( in HandlerExclusivity handlerExclusivity )
Implementation of EventHandler.
BaseHandler.setIndependent! ( in Boolean independent )
Implementation of EventHandler.
BaseHandler.setTakeAllEvents! ( in Boolean takeAllEvents )
Implementation of EventHandler.
Boolean BaseHandler.takeAllEvents? ()
Implementation of EventHandler.
~ BaseHandler ()
Destructor. When desctructed, tell the dispatcher to unregister the current handle if it isn’t owned by the dispatcher.