本文整理汇总了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);
}