]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/P3DNode.java
Update offset values to reflect changes in pipe run parameters
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / P3DNode.java
1 package org.simantics.plant3d.scenegraph;
2
3 import java.util.Objects;
4
5 import org.simantics.g3d.property.annotations.GetPropertyValue;
6 import org.simantics.g3d.property.annotations.SetPropertyValue;
7 import org.simantics.g3d.scenegraph.G3DNode;
8 import org.simantics.layer0.Layer0;
9 import org.simantics.objmap.graph.annotations.RelatedGetValue;
10 import org.simantics.objmap.graph.annotations.RelatedSetValue;
11
12 public abstract class P3DNode extends G3DNode implements IP3DVisualNode {
13         private String name;
14         
15
16         @RelatedGetValue(Layer0.URIs.HasName)
17         @GetPropertyValue(value = Layer0.URIs.HasName, tabId = "Default", name = "Name")
18         public String getName() {
19                 return name;
20         }
21         
22         @RelatedSetValue(Layer0.URIs.HasName)
23         @SetPropertyValue(Layer0.URIs.HasName)
24         public void setName(String name) {
25                 if (name == null || Objects.equals(this.name, name))
26                         return;
27                 
28                 this.name = name;
29                 
30                 firePropertyChanged(Layer0.URIs.HasName);
31         }
32         
33         @Override
34         public String toString() {
35                 return getName();
36         }
37         
38 }