public void dispose() { ((SVGOMElement) e).setSVGContext(null); }
/** * <b>DOM</b>: Implements {@link SVGElement#getXMLbase()}. */ public String getXMLbase() { return getAttributeNS(XML_NAMESPACE_URI, XML_BASE_ATTRIBUTE); }
/** * <b>DOM</b>: Implements {@link SVGElement#setXMLbase(String)}. */ public void setXMLbase(String xmlbase) throws DOMException { setAttributeNS(XML_NAMESPACE_URI, XML_BASE_QNAME, xmlbase); }
/** * <b>DOM</b>: Implements {@link SVGElement#getId()}. */ public String getId() { if (((SVGOMDocument) ownerDocument).isSVG12) { Attr a = getAttributeNodeNS(XML_NAMESPACE_URI, SVG_ID_ATTRIBUTE); if (a != null) { return a.getNodeValue(); } } return getAttributeNS(null, SVG_ID_ATTRIBUTE); }
Node t; if (uri.length() == 0) { t = element.getParentNode(); } else { t = ctx.getReferencedElement(element, uri); if (t.getOwnerDocument() != element.getOwnerDocument()) { throw new BridgeException (ctx, element, ErrorConstants.ERR_URI_BAD_TARGET, String an = element.getAttributeNS(null, SVG_ATTRIBUTE_NAME_ATTRIBUTE); int ci = an.indexOf(':'); if (ci == -1) { if (element.hasProperty(an)) { animationType = AnimationEngine.ANIM_TYPE_CSS; attributeLocalName = an; animationType = AnimationEngine.ANIM_TYPE_XML; String prefix = an.substring(0, ci); attributeNamespaceURI = element.lookupNamespaceURI(prefix); attributeLocalName = an.substring(ci + 1); && !targetElement.isPropertyAnimatable(attributeLocalName) || animationType == AnimationEngine.ANIM_TYPE_XML && !targetElement.isAttributeAnimatable(attributeNamespaceURI, attributeLocalName)) { throw new BridgeException (ctx, element, "attribute.not.animatable", new Object[] { targetElement.getNodeName(), an });
/** * <b>DOM</b>: Implements {@link Node#setPrefix(String)}. */ public void setPrefix(String prefix) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] {(int) getNodeType(), getNodeName() }); } if (prefix != null && !prefix.equals("") && !DOMUtilities.isValidName(prefix)) { throw createDOMException(DOMException.INVALID_CHARACTER_ERR, "prefix", new Object[] {(int) getNodeType(), getNodeName(), prefix }); } this.prefix = prefix; }
/** * To implement {@link * org.w3c.dom.svg.SVGTextContentElement#getCharNumAtPosition(SVGPoint point)}. */ public static int getCharNumAtPosition(Element elt, final float x, final float y) throws DOMException { final SVGOMElement svgelt = (SVGOMElement)elt; final SVGTextContent context = (SVGTextContent)svgelt.getSVGContext(); return context.getCharNumAtPosition(x,y); }
e.setSVGContext(dc); e.setAttributeNS(XMLSupport.XMLNS_NAMESPACE_URI, "xmlns", SVGDOMImplementation.SVG_NAMESPACE_URI); e.setSVGContext(null);
/** * <b>DOM</b>: Implements {@link SVGElement#setId(String)}. */ public void setId(String id) { if (((SVGOMDocument) ownerDocument).isSVG12) { setAttributeNS(XML_NAMESPACE_URI, XML_ID_QNAME, id); Attr a = getAttributeNodeNS(null, SVG_ID_ATTRIBUTE); if (a != null) { a.setNodeValue(id); } } else { setAttributeNS(null, SVG_ID_ATTRIBUTE, id); } }
public void setX(float x) throws DOMException { throw svgelt.createDOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.rect", null); }
/** * Create a SVGException. */ protected SVGException createSVGException(short type, String key, Object[] args) { return ((SVGOMElement)element).createSVGException(type, key, args); }
/** * Creates a new {@link SVGOMAnimatedNumber} and stores it in * this element's LiveAttributeValue table. */ protected SVGOMAnimatedNumber createLiveAnimatedNumber (String ns, String ln, float def) { return createLiveAnimatedNumber(ns, ln, def, false); }
/** * Copy the fields of the current node into the given node. * @param n a node of the type of this. */ protected Node copyInto(Node n) { super.copyInto(n); XBLOMElement e = (XBLOMElement)n; e.prefix = prefix; return n; }
/** * Adds a listener for changes to the given attribute value. */ public void addTargetListener(String ns, String an, boolean isCSS, AnimationTargetListener l) { if (isCSS) { if (svgContext != null) { SVGAnimationTargetContext actx = (SVGAnimationTargetContext) svgContext; actx.addTargetListener(an, l); } } else { super.addTargetListener(ns, an, isCSS, l); } }
Node t; if (uri.length() == 0) { t = element.getParentNode(); } else { t = ctx.getReferencedElement(element, uri); if (t.getOwnerDocument() != element.getOwnerDocument()) { throw new BridgeException (ctx, element, ErrorConstants.ERR_URI_BAD_TARGET, String an = element.getAttributeNS(null, SVG_ATTRIBUTE_NAME_ATTRIBUTE); int ci = an.indexOf(':'); if (ci == -1) { if (element.hasProperty(an)) { animationType = AnimationEngine.ANIM_TYPE_CSS; attributeLocalName = an; animationType = AnimationEngine.ANIM_TYPE_XML; String prefix = an.substring(0, ci); attributeNamespaceURI = element.lookupNamespaceURI(prefix); attributeLocalName = an.substring(ci + 1); && !targetElement.isPropertyAnimatable(attributeLocalName) || animationType == AnimationEngine.ANIM_TYPE_XML && !targetElement.isAttributeAnimatable(attributeNamespaceURI, attributeLocalName)) { throw new BridgeException (ctx, element, "attribute.not.animatable", new Object[] { targetElement.getNodeName(), an });
/** * <b>DOM</b>: Implements {@link Node#setPrefix(String)}. */ public void setPrefix(String prefix) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] {(int) getNodeType(), getNodeName() }); } if (prefix != null && !prefix.equals("") && !DOMUtilities.isValidName(prefix)) { throw createDOMException(DOMException.INVALID_CHARACTER_ERR, "prefix", new Object[] {(int) getNodeType(), getNodeName(), prefix }); } this.prefix = prefix; }
/** * Returns the font-size value. */ public float getFontSize() { return getSVGContext().getFontSize(); }
/** * <b>DOM</b>: Implements {@link SVGElement#getId()}. */ public String getId() { if (((SVGOMDocument) ownerDocument).isSVG12) { Attr a = getAttributeNodeNS(XML_NAMESPACE_URI, SVG_ID_ATTRIBUTE); if (a != null) { return a.getNodeValue(); } } return getAttributeNS(null, SVG_ID_ATTRIBUTE); }
/** * <b>DOM</b>: Implements {@link SVGElement#setId(String)}. */ public void setId(String id) { if (((SVGOMDocument) ownerDocument).isSVG12) { setAttributeNS(XML_NAMESPACE_URI, XML_ID_QNAME, id); Attr a = getAttributeNodeNS(null, SVG_ID_ATTRIBUTE); if (a != null) { a.setNodeValue(id); } } else { setAttributeNS(null, SVG_ID_ATTRIBUTE, id); } }
public void setWidth(float width) throws DOMException { throw svgelt.createDOMException (DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.rect", null); }