diff options
author | kitfox | 2009-02-22 21:03:40 +0100 |
---|---|---|
committer | kitfox | 2009-02-22 21:03:40 +0100 |
commit | f77e201a12813f266b7ba2a1b7d765a239062854 (patch) | |
tree | 0e02cf6c433e90464dfbcbc834ef1859545fcb78 | |
parent | Removing a lot of junk from svgSalamander.jar (diff) | |
download | svg-salamander-core-f77e201a12813f266b7ba2a1b7d765a239062854.tar.gz svg-salamander-core-f77e201a12813f266b7ba2a1b7d765a239062854.tar.xz svg-salamander-core-f77e201a12813f266b7ba2a1b7d765a239062854.zip |
Should now be possible to set id attribute even if element has not yet been associated with a diagram.
git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@59 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b
-rw-r--r-- | src/main/java/com/kitfox/svg/SVGElement.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/com/kitfox/svg/SVGElement.java b/src/main/java/com/kitfox/svg/SVGElement.java index fe50dd5..7b73870 100644 --- a/src/main/java/com/kitfox/svg/SVGElement.java +++ b/src/main/java/com/kitfox/svg/SVGElement.java @@ -273,7 +273,7 @@ abstract public class SVGElement implements Serializable if (hasAttribute(name, attribType)) throw new SVGElementException(this, "Attribute " + name + "(" + AnimationElement.animationElementToString(attribType) + ") already exists");
//Alter layout for id attribute
- if ("id".equals(name))
+ if ("id".equals(name) && diagram != null)
{
diagram.removeElement(this.id);
this.id = name;
@@ -344,6 +344,7 @@ abstract public class SVGElement implements Serializable private void setDiagram(SVGDiagram diagram)
{
this.diagram = diagram;
+ diagram.setElement(id, this);
for (Iterator it = children.iterator(); it.hasNext();)
{
SVGElement ele = (SVGElement)it.next();
|