本文整理匯總了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}