X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fscenegraph%2Fstructural%2FStructuralParentNode.java;h=032ba98169981d6673c9ac6b50c1ae5e394ced85;hb=9f84331c9967c88e0e5550ce91f2b7e364a5cb6d;hp=d5e41a5cf482c5d7ec55544bccde135882d2b4eb;hpb=87b3241ec277ba3d8e414b26186a032c9cdcaeed;p=simantics%2F3d.git diff --git a/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/StructuralParentNode.java b/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/StructuralParentNode.java index d5e41a5c..032ba981 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/StructuralParentNode.java +++ b/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/StructuralParentNode.java @@ -1,3 +1,14 @@ +/******************************************************************************* + * Copyright (c) 2012, 2013 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ package org.simantics.g3d.scenegraph.structural; import java.util.ArrayList; @@ -27,7 +38,7 @@ public abstract class StructuralParentNode extends Pa @RelatedSetValue(Layer0.URIs.HasName) @SetPropertyValue(Layer0.URIs.HasName) public void setName(String name) { - if (name == null) + if (name == null || name.equals(this.name)) return; this.name = name; firePropertyChanged(Layer0.URIs.HasName); @@ -69,12 +80,12 @@ public abstract class StructuralParentNode extends Pa ctx = object; } - private List publisher = new ArrayList(1); + private List publisher = new ArrayList(1); @Override public void addPublishedBy(IStructuralNode node) { - publisher.add(node); - firePropertyChanged(G3D.URIs.publishes); + if (publisher.add(node)) + firePropertyChanged(G3D.URIs.publishes); } @Override