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