本文整理汇总了Java中org.w3c.dom.events.Event.getTarget方法的典型用法代码示例。如果您正苦于以下问题:Java Event.getTarget方法的具体用法?Java Event.getTarget怎么用?Java Event.getTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.w3c.dom.events.Event
的用法示例。
在下文中一共展示了Event.getTarget方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleEvent
import org.w3c.dom.events.Event; //导入方法依赖的package包/类
public void handleEvent(Event evt) {
MutationEvent me = (MutationEvent) evt;
Attr a = (Attr) me.getRelatedNode();
Element e = (Element) evt.getTarget();
if (e instanceof XBLOMContentElement) {
String ans = a.getNamespaceURI();
String aln = a.getLocalName();
if (aln == null) {
aln = a.getNodeName();
}
if (ans == null && XBLConstants.XBL_INCLUDES_ATTRIBUTE.equals(aln)
|| "http://xml.apache.org/batik/ext".equals(ans)
&& "selectorLanguage".equals(aln)) {
selectors.remove(e);
update(false);
}
}
}
示例2: handleEvent
import org.w3c.dom.events.Event; //导入方法依赖的package包/类
/**
* Handles the event.
*/
public void handleEvent(Event evt) {
EventTarget target = evt.getTarget();
if (target instanceof XBLOMDefinitionElement) {
// only handle definition elements in document-level scope
if (getXblBoundElement((Node) target) == null) {
defsToBeRemoved.add(target);
}
} else if (target instanceof XBLOMImportElement) {
// only handle import elements in document-level scope
if (getXblBoundElement((Node) target) == null) {
importsToBeRemoved.add(target);
}
}
Node parent = getXblParentNode((Node) target);
if (parent != null) {
nodesToBeInvalidated.add(parent);
}
}
示例3: handleEvent
import org.w3c.dom.events.Event; //导入方法依赖的package包/类
/**
* Handles 'DOMCharacterDataModified' event type.
*/
public void handleEvent(Event evt) {
Node node = (Node)evt.getTarget();
while (node != null && !(node instanceof SVGOMElement)) {
node = (Node) ((AbstractNode) node).getParentNodeEventTarget();
}
BridgeUpdateHandler h = getBridgeUpdateHandler(node);
if (h != null) {
try {
h.handleDOMCharacterDataModified((MutationEvent)evt);
} catch (Exception e) {
userAgent.displayError(e);
}
}
}
示例4: handleEvent
import org.w3c.dom.events.Event; //导入方法依赖的package包/类
public void handleEvent(Event evt) {
EventTarget newTarget = evt.getTarget();
if (lastFocusEventTarget != null &&
lastFocusEventTarget != newTarget) {
fireDOMFocusOutEvent(lastFocusEventTarget, newTarget);
}
lastFocusEventTarget = evt.getTarget();
}
示例5: handleEvent
import org.w3c.dom.events.Event; //导入方法依赖的package包/类
public void handleEvent(Event evt) {
Node n = (Node) evt.getTarget();
addScriptingListeners(n);
gatherScriptElements(n);
while (!toExecute.isEmpty()) {
loadScript((AbstractElement) toExecute.removeFirst());
}
}
示例6: handleEvent
import org.w3c.dom.events.Event; //导入方法依赖的package包/类
public void handleEvent(Event evt){
// Don't set the tool tip if another ToolTipModifier
// has already handled this event (as it will have been
// a higher priority tool tip).
if (matchLastToolTipEvent(evt.getTimeStamp(), evt.getTarget())) {
return;
}
setLastToolTipEvent(evt.getTimeStamp(), evt.getTarget());
EventTarget prevLastTarget = lastTarget;
if (SVGConstants.SVG_EVENT_MOUSEOVER.equals(evt.getType())) {
lastTarget = evt.getTarget();
} else if (SVGConstants.SVG_EVENT_MOUSEOUT.equals(evt.getType())) {
// related target is one it is entering or null.
org.w3c.dom.events.MouseEvent mouseEvt;
mouseEvt = ((org.w3c.dom.events.MouseEvent)evt);
lastTarget = mouseEvt.getRelatedTarget();
}
if (toolTipMap != null) {
Element e = (Element)lastTarget;
Object o = null;
while (e != null) {
// Search the parents of the current node for ToolTips.
o = toolTipMap.get(e);
if (o != null) {
break;
}
e = CSSEngine.getParentCSSStylableElement(e);
}
final String theToolTip = (String)o;
if (prevLastTarget != lastTarget)
EventQueue.invokeLater(new ToolTipRunnable(theToolTip));
}
}
示例7: handleEvent
import org.w3c.dom.events.Event; //导入方法依赖的package包/类
public void handleEvent(Event evt) {
if (isCapturingClickEnabled) {
Element targetElement = (Element) evt.getTarget();
selectNode(targetElement);
}
}