W
wunglee
Unregistered / Unconfirmed
GUEST, unregistred user!
Input events are delivered to listeners before they are handled by their
source component. This allows listeners and component subclasses
to consume the event to keep the event from being processed in the
default manner by the source. For example, consuming a mouse
press event from a Button component will prevent the Button from
being activated. If there are other listeners registered, however, they
will still receive the event even if a listenerdo
wn the chain
consumed it.
翻译:输入事件在被源截获前就被派发到监听器,这允许监听器和组件的子类销毁事件来防止事件被源以默认的方式处理,例如,从一个按扭组件中销毁一个鼠标按键事件将防止按扭被激活,如果有其它的监听器被注册,即使这个链上的一个监听器将该事件销毁,其它的监听器仍然能接收到该事件。
问题:1)、监听器是通过add***()被加入到源中,应该只有源知道需要派发的监听器有哪些,怎么理解事件不通过源就派发到监听器?
2)、“即使这个链上的一个监听器将该事件销毁,其它的监听器仍然能接收到该事件”,这是什么道理?或者翻译错了?
source component. This allows listeners and component subclasses
to consume the event to keep the event from being processed in the
default manner by the source. For example, consuming a mouse
press event from a Button component will prevent the Button from
being activated. If there are other listeners registered, however, they
will still receive the event even if a listenerdo
wn the chain
consumed it.
翻译:输入事件在被源截获前就被派发到监听器,这允许监听器和组件的子类销毁事件来防止事件被源以默认的方式处理,例如,从一个按扭组件中销毁一个鼠标按键事件将防止按扭被激活,如果有其它的监听器被注册,即使这个链上的一个监听器将该事件销毁,其它的监听器仍然能接收到该事件。
问题:1)、监听器是通过add***()被加入到源中,应该只有源知道需要派发的监听器有哪些,怎么理解事件不通过源就派发到监听器?
2)、“即使这个链上的一个监听器将该事件销毁,其它的监听器仍然能接收到该事件”,这是什么道理?或者翻译错了?