Package org.apache.batik.dom.util

Examples of org.apache.batik.dom.util.HashTable


    /**
     * Returns the implementation listneers.
     */
    public EventListenerList getImplementationEventListeners
            (String type, boolean useCapture) {
        HashTable listeners = useCapture ? capturingImplementationListeners
                                         : bubblingImplementationListeners;
        if (listeners == null) {
            return null;
        }
        return (EventListenerList) listeners.get(type);
    }
View Full Code Here


    public void addEventListenerNS(String namespaceURI,
                                   String type,
                                   EventListener listener,
                                   boolean useCapture,
                                   Object group) {
        HashTable listeners;
        if (useCapture) {
            if (capturingListeners == null) {
                capturingListeners = new HashTable();
            }
            listeners = capturingListeners;
        } else {
            if (bubblingListeners == null) {
                bubblingListeners = new HashTable();
            }
            listeners = bubblingListeners;
        }
        EventListenerList list = (EventListenerList) listeners.get(type);
        if (list == null) {
            list = new EventListenerList();
            listeners.put(type, list);
        }
        list.addListener(namespaceURI, group, listener);
    }
View Full Code Here

     */
    public void removeEventListenerNS(String namespaceURI,
                                      String type,
                                      EventListener listener,
                                      boolean useCapture) {
        HashTable listeners;
        if (useCapture) {
            listeners = capturingListeners;
        } else {
            listeners = bubblingListeners;
        }
        if (listeners == null) {
            return;
        }
        EventListenerList list = (EventListenerList) listeners.get(type);
        if (list != null) {
            list.removeListener(namespaceURI, listener);
            if (list.size() == 0) {
                listeners.remove(type);
            }
        }
    }
View Full Code Here

     * @param type the event type
     * @param useCapture
     */
    public EventListenerList getEventListeners(String type,
                                               boolean useCapture) {
        HashTable listeners
            = useCapture ? capturingListeners : bubblingListeners;
        if (listeners == null) {
            return null;
        }
        return (EventListenerList) listeners.get(type);
    }
View Full Code Here

    /**
     * Returns the associated style-sheet.
     */
    public StyleSheet getCSSStyleSheet() {
        if (styleSheet == null) {
            HashTable attrs = getPseudoAttributes();
            String type = (String)attrs.get("type");

            if ("text/css".equals(type)) {
                String title     = (String)attrs.get("title");
                String media     = (String)attrs.get("media");
                String href      = (String)attrs.get("href");
                String alternate = (String)attrs.get("alternate");
                SVGOMDocument doc = (SVGOMDocument)getOwnerDocument();
                ParsedURL durl = doc.getParsedURL();
                ParsedURL burl = new ParsedURL(durl, href);
                CSSEngine e = doc.getCSSEngine();
               
View Full Code Here

                     n != null && n.getNodeType() != Node.ELEMENT_NODE;
                     n = n.getNextSibling()) {
                    if (n instanceof StyleSheetProcessingInstruction) {
                        StyleSheetProcessingInstruction sspi;
                        sspi = (StyleSheetProcessingInstruction)n;
                        HashTable attrs = sspi.getPseudoAttributes();
                        final String title = (String)attrs.get("title");
                        String alt = (String)attrs.get("alternate");
                        if (title != null && "yes".equals(alt)) {
                            JRadioButtonMenuItem button;
                            button = new JRadioButtonMenuItem(title);

                            button.addActionListener
View Full Code Here

                    result.addAll(getStyleSheets(n.getFirstChild(), uri));
                }
                break;
            case Node.PROCESSING_INSTRUCTION_NODE:
                if (n.getNodeName().equals("xml-stylesheet")) {
                    HashTable attrs = new HashTable();
                    attrs.put("alternate", "no");
                    attrs.put("media", "all");
                    DOMUtilities.parseStyleSheetPIData(n.getNodeValue(), attrs);
                   

                    String type = (String)attrs.get("type");
                   
                    if ("text/xsl".equals(type)) {
                        DocumentFactory df =
                            new DocumentFactory(GenericDOMImplementation.
                                                getDOMImplementation(),
                                   "org.apache.crimson.parser.XMLReaderImpl");
                        String href = (String)attrs.get("href");
                        URL url = new URL(new URL(uri), href);
                        InputSource is = new InputSource(url.toString());
                        Document doc = df.createDocument(XSL_NAMESPACE_URI,
                                                         "stylesheet",
                                                         url.toString(),
View Full Code Here

     */
    public static void registerCustomElementFactory(String namespaceURI,
                                                    String localName,
                                                    CustomElementFactory factory) {
        if (customFactories == null) {
            customFactories = new HashTable();
        }
        HashTable ht = (HashTable)customFactories.get(namespaceURI);
        if (ht == null) {
            customFactories.put(namespaceURI, ht = new HashTable());
        }
        ht.put(localName, factory);
    }
View Full Code Here

            }
            return ef.create(DOMUtilities.getPrefix(qualifiedName));
        }
        if (namespaceURI != null) {
            if (customFactories != null) {
                HashTable ht = (HashTable)customFactories.get(namespaceURI);
                if (ht != null) {
                    String name = DOMUtilities.getLocalName(qualifiedName);
                    CustomElementFactory cef = (CustomElementFactory)ht.get(name);
                    if (cef != null) {
                        return cef.create(DOMUtilities.getPrefix(qualifiedName), this);
                    }
                }
            }
View Full Code Here

      ((AbstractAttr)attr).setSpecified(false);
      if (nsURI == null) {
    setNamedItem(name, attr);
      } else {
    if (tableNS == null) {
        tableNS = new HashTable();
    }
    NamedNodeHashMap attrs = (NamedNodeHashMap)tableNS.get(nsURI);
    if (attrs == null) {
        tableNS.put(nsURI, attrs = new NamedNodeHashMap());
        attrs.namespaceURI = nsURI;
View Full Code Here

TOP

Related Classes of org.apache.batik.dom.util.HashTable

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.