X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fscenegraph%2Fstructural%2FComponentNode.java;h=332d3cdf1e346ec02ec52511186a2b6803bd0c9f;hb=9f84331c9967c88e0e5550ce91f2b7e364a5cb6d;hp=13ac2f523129356f9a12d659c6564ee7b2a33b08;hpb=da945733caf267fed4cf28206cc99f4f57fbd1e9;p=simantics%2F3d.git diff --git a/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/ComponentNode.java b/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/ComponentNode.java index 13ac2f52..332d3cdf 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/ComponentNode.java +++ b/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/ComponentNode.java @@ -15,6 +15,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.Objects; import org.simantics.g3d.ontology.G3D; import org.simantics.g3d.property.annotations.GetPropertyValue; @@ -41,7 +42,7 @@ public abstract class ComponentNode, T2 extends IComp @RelatedSetValue(Layer0.URIs.HasName) @SetPropertyValue(Layer0.URIs.HasName) public void setName(String name) { - if (name == null) + if (name == null || Objects.equals(this.name, name)) return; this.name = name; firePropertyChanged(Layer0.URIs.HasName); @@ -96,8 +97,8 @@ public abstract class ComponentNode, T2 extends IComp @Override public void addPublishedBy(IStructuralNode node) { - publisher.add(node); - firePropertyChanged(G3D.URIs.publishes); + if (publisher.add(node)) + firePropertyChanged(G3D.URIs.publishes); } @Override