Package org.apache.batik.dom

Examples of org.apache.batik.dom.AbstractNode


    /**
     * Adds the event listeners to the document.
     */
    protected void addEventListeners(Document doc) {
        AbstractNode n = (AbstractNode) doc;
        XBLEventSupport es = (XBLEventSupport) n.initializeEventSupport();

        mouseclickListener = new MouseClickTracker();
        es.addImplementationEventListenerNS
            (XMLConstants.XML_EVENTS_NAMESPACE_URI,
             "click",
View Full Code Here


    /**
     * Removes the event listeners from the document.
     */
    protected void removeEventListeners(Document doc) {
        AbstractNode n = (AbstractNode) doc;
        XBLEventSupport es = (XBLEventSupport) n.getEventSupport();

        es.removeImplementationEventListenerNS
            (XMLConstants.XML_EVENTS_NAMESPACE_URI,
             "click",
             mouseclickListener, true);
View Full Code Here

        /**
         * Compares two definition records.
         */
        public int compareTo(Object other) {
            DefinitionRecord rec = (DefinitionRecord) other;
            AbstractNode n1, n2;
            if (importElement == null) {
                n1 = definition;
                if (rec.importElement == null) {
                    n2 = rec.definition;
                } else {
                    n2 = (AbstractNode) rec.importElement;
                }
            } else if (rec.importElement == null) {
                n1 = (AbstractNode) importElement;
                n2 = rec.definition;
            } else if (definition.getOwnerDocument()
                        == rec.definition.getOwnerDocument()) {
                n1 = definition;
                n2 = rec.definition;
            } else {
                n1 = (AbstractNode) importElement;
                n2 = (AbstractNode) rec.importElement;
            }
            short comp = n1.compareDocumentPosition(n2);
            if ((comp & AbstractNode.DOCUMENT_POSITION_PRECEDING) != 0) {
                return -1;
            }
            if ((comp & AbstractNode.DOCUMENT_POSITION_FOLLOWING) != 0) {
                return 1;
View Full Code Here

                        }
                    }
                }

                if (!isStatic) {
                    AbstractNode an = (AbstractNode) n;
                    XBLEventSupport es =
                        (XBLEventSupport) an.initializeEventSupport();
                    es.addImplementationEventListenerNS
                        (SVG_NAMESPACE_URI, "shapechange", regionChangeListener,
                         false);
                }
            }
View Full Code Here

                    continue;
                }
                if (m instanceof ImplementationEventListenerMememto) {
                    String ns = m.getNamespaceURI();
                    Node nde = (Node)et;
                    AbstractNode n = (AbstractNode)nde.getOwnerDocument();
                    if (n != null) {
                        XBLEventSupport es;
                        es = (XBLEventSupport) n.initializeEventSupport();
                        es.removeImplementationEventListenerNS(ns, t, el, uc);
                    }
                } else if (in) {
                    String ns = m.getNamespaceURI();
                    et.removeEventListenerNS(ns, t, el, uc);
View Full Code Here

     * capture phase and the 'custom' behavior (handling of 'auto'
     * on anchors, for example), is handled during the bubbling phase.
     */
    public void addUIEventListeners(Document doc) {
        EventTarget evtTarget = (EventTarget)doc.getDocumentElement();
        AbstractNode n = (AbstractNode) evtTarget;
        XBLEventSupport evtSupport
            = (XBLEventSupport) n.initializeEventSupport();

        EventListener domMouseOverListener
            = new EventListenerWrapper(new DOMMouseOverEventListener());
        evtSupport.addImplementationEventListenerNS
            (XMLConstants.XML_EVENTS_NAMESPACE_URI,
View Full Code Here

             domMouseOutListener, true);
    }

    public void removeUIEventListeners(Document doc) {
        EventTarget evtTarget = (EventTarget)doc.getDocumentElement();
        AbstractNode n = (AbstractNode) evtTarget;
        XBLEventSupport es = (XBLEventSupport) n.initializeEventSupport();

        synchronized (eventListenerSet) {
            Iterator i = eventListenerSet.iterator();
            while (i.hasNext()) {
                EventListenerMememto elm = (EventListenerMememto)i.next();
View Full Code Here

        int bubbleLimit = e.getBubbleLimit();
        int minAncestor = 0;
        if (isSingleScopeEvent(e)) {
            // DOM Mutation events are dispatched only within the
            // one shadow scope
            AbstractNode targetNode = (AbstractNode) target;
            Node boundElement = targetNode.getXblBoundElement();
            if (boundElement != null) {
                minAncestor = ancestors.length;
                while (minAncestor > 0) {
                    AbstractNode ancestorNode =
                        (AbstractNode) ancestors[minAncestor - 1];
                    if (ancestorNode.getXblBoundElement() != boundElement) {
                        break;
                    }
                    minAncestor--;
                }
            }
View Full Code Here

     */
    protected AbstractEvent[] getRetargettedEvents(NodeEventTarget target,
                                                   NodeEventTarget[] ancestors,
                                                   AbstractEvent e) {
        boolean singleScope = isSingleScopeEvent(e);
        AbstractNode targetNode = (AbstractNode) target;
        AbstractEvent[] es = new AbstractEvent[ancestors.length];
        if (ancestors.length > 0) {
            int index = ancestors.length - 1;
            Node boundElement = targetNode.getXblBoundElement();
            AbstractNode ancestorNode = (AbstractNode) ancestors[index];
            if (!singleScope &&
                    ancestorNode.getXblBoundElement() != boundElement) {
                es[index] = retargetEvent(e, ancestors[index]);
            } else {
                es[index] = e;
            }
            while (--index >= 0) {
                ancestorNode = (AbstractNode) ancestors[index + 1];
                boundElement = ancestorNode.getXblBoundElement();
                AbstractNode nextAncestorNode = (AbstractNode) ancestors[index];
                Node nextBoundElement = nextAncestorNode.getXblBoundElement();
                if (!singleScope && nextBoundElement != boundElement) {
                    es[index] = retargetEvent(es[index + 1], ancestors[index]);
                } else {
                    es[index] = es[index + 1];
                }
View Full Code Here

    /**
     * Returns the base URI of the referer element.
     */
    protected String getRefererBaseURI(Element ref) {
        AbstractNode aref = (AbstractNode) ref;
        if (aref.getXblBoundElement() != null) {
            return null;
        }
        return aref.getBaseURI();
    }
View Full Code Here

TOP

Related Classes of org.apache.batik.dom.AbstractNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.