当前位置: 首页>>代码示例>>Java>>正文


Java EventTarget.dispatchEvent方法代码示例

本文整理汇总了Java中org.w3c.dom.events.EventTarget.dispatchEvent方法的典型用法代码示例。如果您正苦于以下问题:Java EventTarget.dispatchEvent方法的具体用法?Java EventTarget.dispatchEvent怎么用?Java EventTarget.dispatchEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.w3c.dom.events.EventTarget的用法示例。


在下文中一共展示了EventTarget.dispatchEvent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fireDOMFocusInEvent

import org.w3c.dom.events.EventTarget; //导入方法依赖的package包/类
/**
 * Fires a 'DOMFocusIn' event to the specified target.
 *
 * @param target the newly focussed event target
 * @param relatedTarget the previously focussed event target
 */
protected void fireDOMFocusInEvent(EventTarget target,
                                   EventTarget relatedTarget) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMFocusIn",
                        true,
                        false,  // canBubbleArg
                        null,   // cancelableArg
                        0);     // detailArg
    int limit = DefaultXBLManager.computeBubbleLimit((Node) relatedTarget,
                                                     (Node) target);
    ((AbstractEvent) uiEvt).setBubbleLimit(limit);
    target.dispatchEvent(uiEvt);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:23,代码来源:SVG12FocusManager.java

示例2: fireDOMFocusOutEvent

import org.w3c.dom.events.EventTarget; //导入方法依赖的package包/类
/**
 * Fires a 'DOMFocusOut' event to the specified target.
 *
 * @param target the previously focussed event target
 * @param relatedTarget the newly focussed event target
 */
protected void fireDOMFocusOutEvent(EventTarget target,
                                    EventTarget relatedTarget) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMFocusOut",
                        true,
                        false,  // canBubbleArg
                        null,   // cancelableArg
                        0);     // detailArg
    int limit = DefaultXBLManager.computeBubbleLimit((Node) target,
                                                     (Node) relatedTarget);
    ((AbstractEvent) uiEvt).setBubbleLimit(limit);
    target.dispatchEvent(uiEvt);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:23,代码来源:SVG12FocusManager.java

示例3: fireDOMFocusInEvent

import org.w3c.dom.events.EventTarget; //导入方法依赖的package包/类
/**
 * Fires a 'DOMFocusIn' event to the specified target.
 *
 * @param target the newly focussed event target
 * @param relatedTarget the previously focussed event target
 */
protected void fireDOMFocusInEvent(EventTarget target,
                                   EventTarget relatedTarget) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMFocusIn",
                        true,    // canBubbleArg
                        false,   // cancelableArg
                        null,    // viewArg
                        0);      // detailArg
    target.dispatchEvent(uiEvt);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:20,代码来源:FocusManager.java

示例4: fireDOMFocusOutEvent

import org.w3c.dom.events.EventTarget; //导入方法依赖的package包/类
/**
 * Fires a 'DOMFocusOut' event to the specified target.
 *
 * @param target the previously focussed event target
 * @param relatedTarget the newly focussed event target
 */
protected void fireDOMFocusOutEvent(EventTarget target,
                                    EventTarget relatedTarget) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMFocusOut",
                        true,    // canBubbleArg
                        false,   // cancelableArg
                        null,    // viewArg
                        0);      // detailArg
    target.dispatchEvent(uiEvt);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:20,代码来源:FocusManager.java

示例5: fireDOMActivateEvent

import org.w3c.dom.events.EventTarget; //导入方法依赖的package包/类
/**
 * Fires a 'DOMActivate' event to the specified target.
 *
 * @param target the event target
 * @param detailArg the detailArg parameter of the event
 */
protected void fireDOMActivateEvent(EventTarget target, int detailArg) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMActivate",
                        true,    // canBubbleArg
                        true,    // cancelableArg
                        null,    // viewArg
                        0);      // detailArg
    target.dispatchEvent(uiEvt);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:19,代码来源:FocusManager.java

示例6: dispatchSVGDocEvent

import org.w3c.dom.events.EventTarget; //导入方法依赖的package包/类
protected void dispatchSVGDocEvent(String eventType) {
    SVGSVGElement root =
        (SVGSVGElement)document.getDocumentElement();
    // Event is dispatched on outermost SVG element.
    EventTarget t = root;

    DocumentEvent de = (DocumentEvent)document;
    AbstractEvent ev = (AbstractEvent) de.createEvent("SVGEvents");
    ev.initEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                   eventType,
                   false,
                   false);
    t.dispatchEvent(ev);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:15,代码来源:BaseScriptingEnvironment.java

示例7: fireTimeEvent

import org.w3c.dom.events.EventTarget; //导入方法依赖的package包/类
/**
 * Fires a {@link TimeEvent} on the given {@link EventTarget}.
 */
public static void fireTimeEvent(EventTarget target, String eventType,
                                 Calendar time, int detail) {
    DocumentEvent de = (DocumentEvent) ((Node) target).getOwnerDocument();
    DOMTimeEvent evt = (DOMTimeEvent) de.createEvent("TimeEvent");
    evt.initTimeEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI, eventType,
                        null,
                        detail);
    evt.setTimestamp(time.getTime().getTime());
    target.dispatchEvent(evt);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:14,代码来源:AnimationSupport.java


注:本文中的org.w3c.dom.events.EventTarget.dispatchEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。