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


Java Event.getTarget方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:19,代码来源:ContentManager.java

示例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);
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:23,代码来源:DefaultXBLManager.java

示例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);
        }
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:18,代码来源:BridgeContext.java

示例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();
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:9,代码来源:FocusManager.java

示例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());
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:9,代码来源:ScriptingEnvironment.java

示例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));
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:35,代码来源:JSVGCanvas.java

示例7: handleEvent

import org.w3c.dom.events.Event; //导入方法依赖的package包/类
public void handleEvent(Event evt) {
    if (isCapturingClickEnabled) {
        Element targetElement = (Element) evt.getTarget();
        selectNode(targetElement);
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:7,代码来源:DOMViewer.java


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