]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.plant3d/src/org/simantics/plant3d/utils/Item.java
Remove dependencies on log4j
[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         private String label;
10         
11         private Type type;
12         private boolean code = false;
13         private boolean variable = false;
14         private boolean modifiable = false;
15         private boolean sizeChange = false;
16         private boolean rotated = false;
17
18         
19         public Item(String type, String name) {
20                 this.uri = type;
21                 this.name = name;
22         }
23         
24         public Item(String type, String name, String label) {
25                 this.uri = type;
26                 this.name = name;
27                 this.label = label;
28         }
29         
30         public String getUri() {
31                 return uri;
32         }
33         
34         public String getName() {
35                 return name;
36         }
37         
38         public Type getType() {
39                 return type;
40         }
41         
42         public void setType(Type type) {
43                 this.type = type;
44         }
45         
46         public boolean isCode() {
47                 return code;
48         }
49
50         public void setCode(boolean code) {
51                 this.code = code;
52         }
53         
54         public boolean isVariable() {
55                 return variable;
56         }
57         
58         public void setVariable(boolean variable) {
59                 this.variable = variable;
60         }
61         
62         public boolean isModifiable() {
63         return modifiable;
64     }
65     
66     public void setModifiable(boolean modifiable) {
67         this.modifiable = modifiable;
68     }
69         
70         public boolean isSizeChange() {
71                 return sizeChange;
72         }
73         
74         public void setSizeChange(boolean sizeChange) {
75                 this.sizeChange = sizeChange;
76         }
77         
78         public boolean isRotated() {
79         return rotated;
80     }
81         
82         public void setRotated(boolean rotated) {
83         this.rotated = rotated;
84     }
85
86
87         @Override
88         public boolean equals(Object obj) {
89                 if (obj.getClass() != getClass())
90                         return false;
91                 return uri.equals(((Item)obj).uri);
92         }
93         
94         @Override
95         public int hashCode() {
96                 return uri.hashCode();
97         }
98
99         public String getLabel() {
100                 return label;
101         }
102 }