HandlerDispatcher (interface)¶
バージョン 2.0.1 で追加.
HandlerDispatcher interface declares the methods to manages several handlers and to create a manipulation tree. In the manipulation tree, dispatchers are the nodes used to organize the manipulation system and propagate the events througt it.
Functions¶
activateDispatcher ! ( in Key key, io Boolean isAccepted ) | |
activateHandlers ! ( io Key key, io Boolean switchDisableNone, io Boolean switchDisableOthers, io Boolean switchDisableAll, io Boolean isAccepted ) | |
Ref<EventHandler> | getActiveHandler ? () |
String | getHandlerName ? ( in Ref<EventHandler> handler ) |
Boolean | hasHandler ? ( in String name ) |
processKeyEvent ! ( io Event event ) | |
processMouseEvent ! ( io Event event ) | |
registerHandler ! ( in String name, io Ref<EventHandler> handler ) | |
sceneChanged ! () | |
setActiveHandler ! ( in Ref<EventHandler> handler ) | |
setActiveHandler ! ( in String name ) | |
unregisterHandler ! ( in Ref<EventHandler> handler ) | |
unregisterHandler ! ( in String name ) |
Functions in detail¶
HandlerDispatcher.activateDispatcher! ( in Key key, io Boolean isAccepted )
Activates a specific dispatcher within the manipulation tree and its parents and children dispatcher. Must be called from the manipualtion-tree root dispatcher.
注釈
This is applied to the manipulation tree leaves, e.g. the tools.
keyEvent | A key event. |
isAccepted | Is true if an handler has been activated/deactived. |
HandlerDispatcher.activateHandlers! ( io Key key, io Boolean switchDisableNone, io Boolean switchDisableOthers, io Boolean switchDisableAll, io Boolean isAccepted )
Activates one or several handlers within this dispatcher stack. Recursive call that visit the whole manipulation tree. Must be called from the manipualtion-tree root dispatcher.
注釈
This is applied to the manipulation tree leaves, e.g. the tools.
key | A enable key-stroke. |
switchDisableNone | Is true if the activated handler has switchDisableNone exclusivity. |
switchDisableOthers | Is true if the activated handler has switchDisableOthers exclusivity. |
switchDisableAll | Is true if the activated handler has switchDisableAll exclusivity. |
isAccepted | Is true if an handler has been activated/deactived. |
Ref<EventHandler> HandlerDispatcher.getActiveHandler? ()
Gets a reference to the current handler.
String HandlerDispatcher.getHandlerName? ( in Ref<EventHandler> handler )
Gets the handler’s name.
handler | A reference to an handler. |
Boolean HandlerDispatcher.hasHandler? ( in String name )
Gets true if a handler with the given name has been registered.
name | Handler’s name. |
HandlerDispatcher.processKeyEvent! ( io Event event )
Process a key event + manages tool switching.
event | A key event. |
HandlerDispatcher.processMouseEvent! ( io Event event )
Process a mouse event.
event | A mouse or mouseWheel event. |
HandlerDispatcher.registerHandler! ( in String name, io Ref<EventHandler> handler )
Registers a new handler with a given name.
name | The name to register the handler with. |
handler | The handler to register. |
HandlerDispatcher.sceneChanged! ()
Updates the manipulation-tree as the scene might have changed.
HandlerDispatcher.setActiveHandler! ( in Ref<EventHandler> handler )
Activates a specific handler in the stack. It will receive the events.
handler | A reference to an handler. |
HandlerDispatcher.setActiveHandler! ( in String name )
Activates a specific handler in the stack. It will receive the events.
The | name of the handler. |
HandlerDispatcher.unregisterHandler! ( in Ref<EventHandler> handler )
Unregisters an existing handler.
A | reference to the handler. |
HandlerDispatcher.unregisterHandler! ( in String name )
Unregisters an existing handler.
The | name of the handler. |