]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.g3d.csg/src/org/simantics/g3d/csg/scenegraph2/RegularPrismNode.java
Remove listener calls when property values not updated.
[simantics/3d.git] / org.simantics.g3d.csg / src / org / simantics / g3d / csg / scenegraph2 / RegularPrismNode.java
index ebb9345dd70e4a511397e61a8aa797c5748c8206..3d52b602ffb1b936498880618a639ae50ad17c24 100644 (file)
@@ -1,3 +1,14 @@
+/*******************************************************************************\r
+ * Copyright (c) 2012, 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
 package org.simantics.g3d.csg.scenegraph2;\r
 \r
 import org.jcae.opencascade.jni.TopoDS_Shape;\r
@@ -19,6 +30,8 @@ public class RegularPrismNode extends CSGnode {
        @RelatedSetValue(CSG.URIs.HasRadius)\r
        @SetPropertyValue(CSG.URIs.HasRadius)\r
        public void setR(double r) {\r
+               if (this.r == r)\r
+                       return;\r
                this.r = r;\r
                firePropertyChanged(CSG.URIs.HasRadius);\r
        }\r
@@ -27,6 +40,8 @@ public class RegularPrismNode extends CSGnode {
        @RelatedSetValue(CSG.URIs.HasHeight)\r
        @SetPropertyValue(CSG.URIs.HasHeight)\r
        public void setH(double h) {\r
+               if (this.h == h)\r
+                       return;\r
                this.h = h;\r
                firePropertyChanged(CSG.URIs.HasHeight);\r
        }\r
@@ -36,6 +51,8 @@ public class RegularPrismNode extends CSGnode {
        public void setN(int n) {\r
                if (n < 3)\r
                        n = 3;\r
+               if (this.n == n)\r
+                       return;\r
                this.n = n;\r
                firePropertyChanged(CSG.URIs.HasCorners);\r
        }\r