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


Java Event类代码示例

本文整理汇总了Java中org.w3c.dom.events.Event的典型用法代码示例。如果您正苦于以下问题:Java Event类的具体用法?Java Event怎么用?Java Event使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Event类属于org.w3c.dom.events包,在下文中一共展示了Event类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleEvent

import org.w3c.dom.events.Event; //导入依赖的package包/类
public void handleEvent(final Event evt) {
    try {
        getLock().write(new Runnable() {
            public void run() {
                Document d = (Document)evt.getCurrentTarget();
                Document old = (Document)getValueNonBlocking();
                assert old == null || old == d;
                logger.log(Level.FINEST, "DomSupport got DOM event {0} on {1}, inIsolatingChange={2}", new Object[] {evt, ph, inIsolatingChange ? Boolean.TRUE : Boolean.FALSE});
                if (!inIsolatingChange) {
                    try {
                        setDocument(d);
                    } catch (IOException e) {
                        assert false : e;
                    }
                } else {
                    madeIsolatedChanges = true;
                }
            }
        });
    } catch (RuntimeException e) {
        // Xerces ignores them.
        e.printStackTrace();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:DomSupport.java

示例2: dispatchingEventToSubtree

import org.w3c.dom.events.Event; //导入依赖的package包/类
/**
 * Dispatches event to the target node's descendents recursively
 *
 * @param n node to dispatch to
 * @param e event to be sent to that node and its subtree
 */
protected void dispatchingEventToSubtree(Node n, Event e) {
    if (n==null)
            return;

    // ***** Recursive implementation. This is excessively expensive,
    // and should be replaced in conjunction with optimization
    // mentioned above.
    ((NodeImpl) n).dispatchEvent(e);
    if (n.getNodeType() == Node.ELEMENT_NODE) {
        NamedNodeMap a = n.getAttributes();
        for (int i = a.getLength() - 1; i >= 0; --i)
            dispatchingEventToSubtree(a.item(i), e);
    }
    dispatchingEventToSubtree(n.getFirstChild(), e);
    dispatchingEventToSubtree(n.getNextSibling(), e);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:DocumentImpl.java

示例3: handleEvent

import org.w3c.dom.events.Event; //导入依赖的package包/类
public void handleEvent(final Event evt) {
    Runnable runnable = new Runnable() {
        public void run() {
            MutationEvent mevt = (MutationEvent) evt;
            Element targetElement = (Element) mevt.getTarget();
            // Repaint the target node
            DefaultTreeModel model = (DefaultTreeModel) tree
                    .getModel();

            model.nodeChanged(findNode(tree, targetElement));
            attributePanel.updateOnDocumentChange(mevt.getType(),
                    targetElement);
        }
    };
    refreshGUI(runnable);
    registerDocumentChange((MutationEvent) evt);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:18,代码来源:DOMViewer.java

示例4: 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

示例5: handleEvent

import org.w3c.dom.events.Event; //导入依赖的package包/类
/**
 * Handles the event.
 */
public void handleEvent(Event evt) {
    Node n = (Node) evt.getTarget();
    while (n != null && !(n instanceof XBLOMDefinitionElement)) {
        n = n.getParentNode();
    }

    DefinitionRecord defRec
        = (DefinitionRecord) definitions.get(n, importElement);
    if (defRec == null) {
        return;
    }

    rebind(defRec.namespaceURI, defRec.localName,
           document.getDocumentElement());
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:19,代码来源:DefaultXBLManager.java

示例6: handleEvent

import org.w3c.dom.events.Event; //导入依赖的package包/类
public void handleEvent(Event e)
{
  MutationEvent     mutation = (MutationEvent) e;
  Node              related = mutation.getRelatedNode();

  // XXX if it's got children ... check all kids too, they
  // will invalidate our saved index

  if (related.getNodeType() != Node.ELEMENT_NODE ||
      related.getNodeName() != elementName ||
      related.getNamespaceURI() != elementURI)
    {
      return;
    }

  if (current != null)
    current.detach();
  current = null;
}
 
开发者ID:vilie,项目名称:javify,代码行数:20,代码来源:DomNode.java

示例7: handleEvent

import org.w3c.dom.events.Event; //导入依赖的package包/类
public void handleEvent(Event evt) {
    if (!(evt instanceof AbstractEvent)) return;
    final AbstractEvent ae = (AbstractEvent)evt;

    List l = ae.getDefaultActions();
    if (l != null) {
        Iterator i = l.iterator();
        while (i.hasNext()) {
            Object o = i.next();
            if (o instanceof AnchorDefaultActionable)
                return; // only one anchor in default list...
        }
    }


    SVGAElement elt = (SVGAElement)evt.getCurrentTarget();
    ae.addDefaultAction(new AnchorDefaultActionable
                        (elt, userAgent, holder));
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:20,代码来源:SVGAElementBridge.java

示例8: createDocumentEventSupport

import org.w3c.dom.events.Event; //导入依赖的package包/类
/**
 * Creates an DocumentEventSupport object suitable for use with
 * this implementation.
 */
public DocumentEventSupport createDocumentEventSupport() {
    DocumentEventSupport result =  super.createDocumentEventSupport();
    result.registerEventFactory("WheelEvent",
                                new DocumentEventSupport.EventFactory() {
                                    public Event createEvent() {
                                        return new SVGOMWheelEvent();
                                    }
                                });
    result.registerEventFactory("ShadowTreeEvent",
                                new DocumentEventSupport.EventFactory() {
                                    public Event createEvent() {
                                        return new XBLOMShadowTreeEvent();
                                    }
                                });
    return result;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:21,代码来源:SVG12DOMImplementation.java

示例9: handleEvent

import org.w3c.dom.events.Event; //导入依赖的package包/类
public void handleEvent(Event e) {
    DOMMouseEvent evt = (DOMMouseEvent) e;
    DOMMouseEvent newMouseEvent = (DOMMouseEvent)
        // DOM Level 2 6.5 cast from Document to DocumentEvent is ok
        ((DocumentEvent)imgElement.getOwnerDocument()).createEvent("MouseEvents");

    newMouseEvent.initMouseEventNS
        (XMLConstants.XML_EVENTS_NAMESPACE_URI,
         evt.getType(),
         evt.getBubbles(),
         evt.getCancelable(),
         evt.getView(),
         evt.getDetail(),
         evt.getScreenX(),
         evt.getScreenY(),
         evt.getClientX(),
         evt.getClientY(),
         evt.getButton(),
         (EventTarget)imgElement,
         evt.getModifiersString());
    ((EventTarget)imgElement).dispatchEvent(newMouseEvent);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:23,代码来源:SVGImageElementBridge.java

示例10: createDocumentEventSupport

import org.w3c.dom.events.Event; //导入依赖的package包/类
/**
 * Creates an DocumentEventSupport object suitable for use with
 * this implementation.
 */
public DocumentEventSupport createDocumentEventSupport() {
    DocumentEventSupport result =  new DocumentEventSupport();
    result.registerEventFactory("SVGEvents",
                                new DocumentEventSupport.EventFactory() {
                                        public Event createEvent() {
                                            return new SVGOMEvent();
                                        }
                                    });
    result.registerEventFactory("TimeEvent",
                                new DocumentEventSupport.EventFactory() {
                                        public Event createEvent() {
                                            return new DOMTimeEvent();
                                        }
                                    });
    return result;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:21,代码来源:SVGDOMImplementation.java

示例11: documentLoadingCompleted

import org.w3c.dom.events.Event; //导入依赖的package包/类
public void documentLoadingCompleted(SVGDocumentLoaderEvent e) {
    NodeEventTarget root
        = (NodeEventTarget) e.getSVGDocument().getRootElement();
    root.addEventListenerNS
        (XMLConstants.XML_EVENTS_NAMESPACE_URI,
         SVGConstants.SVG_SVGZOOM_EVENT_TYPE,
         new EventListener() {
             public void handleEvent(Event evt) {
                 if (!(evt.getTarget() instanceof SVGSVGElement))
                     return;
                 // assert(evt.getType() ==
                 //        SVGConstants.SVG_SVGZOOM_EVENT_TYPE);
                 SVGSVGElement svg = (SVGSVGElement) evt.getTarget();
                 scaleChange(svg.getCurrentScale());
             } // handleEvent()
         }, false, null);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:18,代码来源:JSVGScrollPane.java

示例12: handleEvent

import org.w3c.dom.events.Event; //导入依赖的package包/类
public void handleEvent(Event evt) {
    // XXX for some reason, sometimes if refactoring is done while an XML phadhail is
    // expanded, some infinite loop occurs and this method is called repeatedly
    try {
        Element parent = (Element)evt.getCurrentTarget();
        if (logger.isLoggable(Level.FINER)) {
            logger.log(Level.FINER, "ElementLook: event on {0}: {1}; co={2}", new Object[] {parent.getTagName(), evt, getChildObjects(parent, null)});
        }
        fireChange(parent, Look.GET_CHILD_OBJECTS | Look.GET_DISPLAY_NAME);
    } catch (RuntimeException e) {
        e.printStackTrace();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ElementLook.java

示例13: handleEvent

import org.w3c.dom.events.Event; //导入依赖的package包/类
@Override public void handleEvent(Event event) {
    HTMLAnchorElement anchorElement = (HTMLAnchorElement) event.getCurrentTarget();
    String href = anchorElement.getHref();

    if (Desktop.isDesktopSupported()) {
        openLinkInSystemBrowser(href);
    } else {
        LOGGER.warning("OS does not support desktop operations like browsing. Cannot open link '{" + href + "}'.");
    }

    event.preventDefault();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:13,代码来源:HyperlinkRedirectListener.java

示例14: createEvent

import org.w3c.dom.events.Event; //导入依赖的package包/类
public Event createEvent(String eventType) throws DOMException {
    if ("Event".equals(eventType)) {
        return new EventImpl();
    } else {
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
                   "Not supported interface");
    }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:9,代码来源:SmilDocumentImpl.java

示例15: beginElement

import org.w3c.dom.events.Event; //导入依赖的package包/类
public boolean beginElement() {
    DocumentEvent doc = (DocumentEvent) SmilParElementImpl.this.getOwnerDocument();
    Event startEvent = doc.createEvent("Event");
    startEvent.initEvent(SMIL_SLIDE_START_EVENT, false, false);
    dispatchEvent(startEvent);
    return true;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:8,代码来源:SmilParElementImpl.java


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