From 30ebe1cbfe286e7a26f0968338c6c007816eb337 Mon Sep 17 00:00:00 2001 From: kitfox Date: Fri, 7 Oct 2011 13:22:31 +0000 Subject: Added SVGElement.removeElement() method. ShapeElement can now handle invalid paint references without crashing. git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@101 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b --- src/main/java/com/kitfox/svg/SVGElement.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/kitfox/svg/SVGElement.java') diff --git a/src/main/java/com/kitfox/svg/SVGElement.java b/src/main/java/com/kitfox/svg/SVGElement.java index 47ce1c3..08cb36c 100644 --- a/src/main/java/com/kitfox/svg/SVGElement.java +++ b/src/main/java/com/kitfox/svg/SVGElement.java @@ -267,7 +267,20 @@ abstract public class SVGElement implements Serializable presAttribs.put(name, new StyleAttribute(name, value)); } } - + + public void removeAttribute(String name, int attribType) + { + switch (attribType) + { + case AnimationElement.AT_CSS: + inlineStyles.remove(name); + return; + case AnimationElement.AT_XML: + presAttribs.remove(name); + return; + } + } + public void addAttribute(String name, int attribType, String value) throws SVGElementException { if (hasAttribute(name, attribType)) throw new SVGElementException(this, "Attribute " + name + "(" + AnimationElement.animationElementToString(attribType) + ") already exists"); -- cgit v1.2.3-55-g7522