/** * 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); }
/** * Returns a list event listeners depending on the specified event * type and phase. * @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); }
/** * Gets an item in the table on the top of the stack. */ public String get(String s) { if (s.length() == 0) return current.defaultStr; for (Link l = current; l != null; l = l.next) { String uri = (String)l.table.get(s); if (uri != null) { return uri; } } return null; }
Object v = features.get(feature.toLowerCase()); if (v == null) { return false;
/** * Returns whether this node target has an event listener for the * given event namespace URI and type. */ public boolean hasEventListenerNS(String namespaceURI, String type) { if (capturingListeners != null) { EventListenerList ell = (EventListenerList) capturingListeners.get(type); if (ell != null) { if (ell.hasEventListener(namespaceURI)) { return true; } } } if (bubblingListeners != null) { EventListenerList ell = (EventListenerList) capturingListeners.get(type); if (ell != null) { return ell.hasEventListener(namespaceURI); } } return false; }
/** * Extracts the first XSL processing instruction from the input * XML document. */ protected String extractXSLProcessingInstruction(Document doc) { Node child = doc.getFirstChild(); while (child != null) { if (child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) { ProcessingInstruction pi = (ProcessingInstruction)child; HashTable table = new HashTable(); DOMUtilities.parseStyleSheetPIData(pi.getData(), table); Object type = table.get(PSEUDO_ATTRIBUTE_TYPE); if (XSL_PROCESSING_INSTRUCTION_TYPE.equals(type)) { Object href = table.get(PSEUDO_ATTRIBUTE_HREF); if (href != null) { return href.toString(); } else { return null; } } } child = child.getNextSibling(); } return null; }
/** * Deregisters an event listener. */ public void removeEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) { super.removeEventListenerNS(namespaceURI, type, listener, useCapture); if (namespaceURI == null || namespaceURI.equals(XMLConstants.XML_EVENTS_NAMESPACE_URI)) { String alias = (String) eventTypeAliases.get(type); if (alias != null) { super.removeEventListenerNS (namespaceURI, alias, listener, useCapture); } } }
/** * 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(); styleSheet = e.parseStyleSheet(burl, media); styleSheet.setAlternate("yes".equals(alternate)); styleSheet.setTitle(title); } } return styleSheet; }
/** * Registers an event listener for the given namespaced event type * in the specified group. */ public void addEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture, Object group) { super.addEventListenerNS (namespaceURI, type, listener, useCapture, group); if (namespaceURI == null || namespaceURI.equals(XMLConstants.XML_EVENTS_NAMESPACE_URI)) { String alias = (String) eventTypeAliases.get(type); if (alias != null) { super.addEventListenerNS (namespaceURI, alias, listener, useCapture, group); } } }
EventFactory ef = (EventFactory)eventFactories.get(eventType.toLowerCase()); if (ef == null) { throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
/** * Returns an array of EventListeners that match the given namespace URI. */ public Entry[] getEventListeners(String namespaceURI) { if (namespaceURI == null) { return getEventListeners(); } Entry[] ls = (Entry[]) listenersNS.get(namespaceURI); if (ls != null) { return ls; } int count = counts.get(namespaceURI); if (count == 0) { return null; } ls = new Entry[count]; listenersNS.put(namespaceURI, ls); int i = 0; for (Entry e = head; i < count; e = e.next) { if (namespaceURI.equals(e.namespaceURI)) { ls[i++] = e; } } return ls; }
/** * Unregisters an implementation event listener. */ public void removeImplementationEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) { HashTable listeners = useCapture ? capturingImplementationListeners : bubblingImplementationListeners; if (listeners == null) { return; } EventListenerList list = (EventListenerList) listeners.get(type); if (list == null) { return; } list.removeListener(namespaceURI, listener); if (list.size() == 0) { listeners.remove(type); } }
String prefix = DOMUtilities.getPrefix(qualifiedName); if (SVG12Constants.SVG_NAMESPACE_URI.equals(namespaceURI)) { ElementFactory ef = (ElementFactory)factories.get(name); if (ef != null) { return ef.create(prefix, document); ElementFactory ef = (ElementFactory)xblFactories.get(name); if (ef != null) { return ef.create(prefix, document);
/** * Deregisters an event listener. */ 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); } } }
/** * Returns the URI of the referenced stylesheet. */ public String getStyleSheetURI() { SVGOMDocument svgDoc = (SVGOMDocument) getOwnerDocument(); ParsedURL url = svgDoc.getParsedURL(); String href = (String)getPseudoAttributes().get("href"); if (url != null) { return new ParsedURL(url, href).toString(); } return href; }
/** * Implements the behavior of Document.createElementNS() for this * DOM implementation. */ public Element createElementNS(AbstractDocument document, String namespaceURI, String qualifiedName) { if (SVGConstants.SVG_NAMESPACE_URI.equals(namespaceURI)) { String name = DOMUtilities.getLocalName(qualifiedName); ElementFactory ef = (ElementFactory)factories.get(name); if (ef != null) return ef.create(DOMUtilities.getPrefix(qualifiedName), document); throw document.createDOMException (DOMException.NOT_FOUND_ERR, "invalid.element", new Object[] { namespaceURI, qualifiedName }); } return super.createElementNS(document, namespaceURI, qualifiedName); }
/** * Registers an event listener that will not be stopped by the usual * XBL stopping. */ public void addImplementationEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) { HashTable listeners; if (useCapture) { if (capturingImplementationListeners == null) { capturingImplementationListeners = new HashTable(); } listeners = capturingImplementationListeners; } else { if (bubblingImplementationListeners == null) { bubblingImplementationListeners = new HashTable(); } listeners = bubblingImplementationListeners; } EventListenerList list = (EventListenerList) listeners.get(type); if (list == null) { list = new EventListenerList(); listeners.put(type, list); } list.addListener(namespaceURI, null, listener); }
/** * Registers an event listener for the given namespaced event type * in the specified group. */ 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); }