/** * Returns the object that gives access to the underlying * {@link org.apache.batik.css.engine.StyleDeclaration} for the override * style of this element. */ public StyleDeclarationProvider getOverrideStyleDeclarationProvider() { return (StyleDeclarationProvider) getOverrideStyle(); }
/** * Initializes the live attribute values of this element. */ private void initializeLiveAttributes() { className = createLiveAnimatedString(null, SVG_CLASS_ATTRIBUTE); }
/** * Returns the ID of this element. */ public String getXMLId() { return getAttributeNS(null, "id"); }
/** * Returns the CSS base URL of this element. * @throws IllegalArgumentException when the result of getBaseURI() * cannot be used as an URL. */ public ParsedURL getCSSBase() { if (getXblBoundElement() != null) { return null; } String bu = getBaseURI(); return bu == null ? null : new ParsedURL(bu); }
CSSValue result = (CSSValue)getLiveAttributeValue(null, name); if (result != null) return result; CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine(); int idx = eng.getPropertyIndex(name); if (idx == -1) putLiveAttributeValue(null, name, (LiveAttributeValue)result); if (getAttributeNS(null, name).length() == 0) { return null;
/** * Initializes all live attributes for this element. */ protected void initializeAllLiveAttributes() { super.initializeAllLiveAttributes(); initializeLiveAttributes(); }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGStylable#getStyle()}. */ public CSSStyleDeclaration getStyle() { if (style == null) { CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine(); style = new StyleDeclaration(eng); putLiveAttributeValue(null, SVG_STYLE_ATTRIBUTE, style); } return style; }
/** * Creates a new PresentationAttributeValue. */ public PresentationAttributeValue(CSSEngine eng, String prop) { super(null); valueProvider = this; setModificationHandler(new AbstractModificationHandler() { protected Value getValue() { return PresentationAttributeValue.this.getValue(); } public void textChanged(String text) throws DOMException { value = cssEngine.parsePropertyValue (SVGStylableElement.this, property, text); mutate = true; setAttributeNS(null, property, text); mutate = false; } }); cssEngine = eng; property = prop; Attr attr = getAttributeNodeNS(null, prop); if (attr != null) { value = cssEngine.parsePropertyValue (SVGStylableElement.this, prop, attr.getValue()); } }
/** * Returns the override style declaration for this element. */ public CSSStyleDeclaration getOverrideStyle() { if (overrideStyleDeclaration == null) { CSSEngine eng = ((SVGOMDocument) getOwnerDocument()).getCSSEngine(); overrideStyleDeclaration = new OverrideStyleDeclaration(eng); } return overrideStyleDeclaration; }
/** * Tells whether this element is an instance of the given pseudo * class. */ public boolean isPseudoInstanceOf(String pseudoClass) { if (pseudoClass.equals("first-child")) { Node n = getPreviousSibling(); while (n != null && n.getNodeType() != ELEMENT_NODE) { n = n.getPreviousSibling(); } return n == null; } return false; }
CSSValue result = (CSSValue)getLiveAttributeValue(null, name); if (result != null) return result; CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine(); int idx = eng.getPropertyIndex(name); if (idx == -1) putLiveAttributeValue(null, name, (LiveAttributeValue)result); if (getAttributeNS(null, name).length() == 0) { return null;
/** * Initializes all live attributes for this element. */ protected void initializeAllLiveAttributes() { super.initializeAllLiveAttributes(); initializeLiveAttributes(); }
/** * Returns the CSS base URL of this element. * @throws IllegalArgumentException when the result of getBaseURI() * cannot be used as an URL. */ public ParsedURL getCSSBase() { if (getXblBoundElement() != null) { return null; } String bu = getBaseURI(); return bu == null ? null : new ParsedURL(bu); }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGStylable#getStyle()}. */ public CSSStyleDeclaration getStyle() { if (style == null) { CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine(); style = new StyleDeclaration(eng); putLiveAttributeValue(null, SVG_STYLE_ATTRIBUTE, style); } return style; }
/** * Creates a new PresentationAttributeColorValue. */ public PresentationAttributeColorValue(CSSEngine eng, String prop) { super(null); valueProvider = this; setModificationHandler(new AbstractModificationHandler() { protected Value getValue() { return PresentationAttributeColorValue.this.getValue(); } public void textChanged(String text) throws DOMException { value = cssEngine.parsePropertyValue (SVGStylableElement.this, property, text); mutate = true; setAttributeNS(null, property, text); mutate = false; } }); cssEngine = eng; property = prop; Attr attr = getAttributeNodeNS(null, prop); if (attr != null) { value = cssEngine.parsePropertyValue (SVGStylableElement.this, prop, attr.getValue()); } }
/** * Returns the override style declaration for this element. */ public CSSStyleDeclaration getOverrideStyle() { if (overrideStyleDeclaration == null) { CSSEngine eng = ((SVGOMDocument) getOwnerDocument()).getCSSEngine(); overrideStyleDeclaration = new OverrideStyleDeclaration(eng); } return overrideStyleDeclaration; }
/** * Tells whether this element is an instance of the given pseudo * class. */ public boolean isPseudoInstanceOf(String pseudoClass) { if (pseudoClass.equals("first-child")) { Node n = getPreviousSibling(); while (n != null && n.getNodeType() != ELEMENT_NODE) { n = n.getPreviousSibling(); } return n == null; } return false; }
CSSValue result = (CSSValue)getLiveAttributeValue(null, name); if (result != null) return result; CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine(); int idx = eng.getPropertyIndex(name); if (idx == -1) putLiveAttributeValue(null, name, (LiveAttributeValue)result); if (getAttributeNS(null, name).length() == 0) { return null;
/** * Initializes all live attributes for this element. */ protected void initializeAllLiveAttributes() { super.initializeAllLiveAttributes(); initializeLiveAttributes(); }
/** * <b>DOM</b>: Implements * {@link DocumentCSS#getOverrideStyle(Element,String)}. */ public CSSStyleDeclaration getOverrideStyle(Element elt, String pseudoElt) { if (elt instanceof SVGStylableElement && pseudoElt == null) { return ((SVGStylableElement) elt).getOverrideStyle(); } return null; }