當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。