]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.plant3d/src/org/simantics/plant3d/utils/Item.java
Merge "Ask component rotation angle when adding components"
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / utils / Item.java
1 package org.simantics.plant3d.utils;
2
3 public class Item {
4         
5         public enum Type{EQUIPMENT,INLINE,TURN,END,NOZZLE};
6         
7         private String uri;
8         private String name;
9         
10         private Type type;
11         private boolean code = false;
12         private boolean variable = false;
13         private boolean modifiable = false;
14         private boolean sizeChange = false;
15         private boolean rotated = false;
16
17         
18         public Item(String type, String name) {
19                 this.uri = type;
20                 this.name = name;
21         }
22         
23         
24         
25         public String getUri() {
26                 return uri;
27         }
28         
29         public String getName() {
30                 return name;
31         }
32         
33         public Type getType() {
34                 return type;
35         }
36         
37         public void setType(Type type) {
38                 this.type = type;
39         }
40         
41         public boolean isCode() {
42                 return code;
43         }
44
45         public void setCode(boolean code) {
46                 this.code = code;
47         }
48         
49         public boolean isVariable() {
50                 return variable;
51         }
52         
53         public void setVariable(boolean variable) {
54                 this.variable = variable;
55         }
56         
57         public boolean isModifiable() {
58         return modifiable;
59     }
60     
61     public void setModifiable(boolean modifiable) {
62         this.modifiable = modifiable;
63     }
64         
65         public boolean isSizeChange() {
66                 return sizeChange;
67         }
68         
69         public void setSizeChange(boolean sizeChange) {
70                 this.sizeChange = sizeChange;
71         }
72         
73         public boolean isRotated() {
74         return rotated;
75     }
76         
77         public void setRotated(boolean rotated) {
78         this.rotated = rotated;
79     }
80
81
82         @Override
83         public boolean equals(Object obj) {
84                 if (obj.getClass() != getClass())
85                         return false;
86                 return uri.equals(((Item)obj).uri);
87         }
88         
89         @Override
90         public int hashCode() {
91                 return uri.hashCode();
92         }
93
94 }