]> gerrit.simantics Code Review - simantics/sysdyn.git/blob
f1dbf8e4272881924aef42605f151cc46c153eb1
[simantics/sysdyn.git] /
1 package org.simantics.sysdyn.modelImport.model.element;\r
2 \r
3 import org.simantics.db.Resource;\r
4 import org.simantics.db.WriteGraph;\r
5 import org.simantics.db.exception.DatabaseException;\r
6 import org.simantics.sysdyn.SysdynResource;\r
7 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
8 import org.simantics.sysdyn.modelImport.model.expression.IExpression;\r
9 import org.simantics.sysdyn.modelImport.model.support.Range;\r
10 import org.simantics.sysdyn.modelImport.model.support.Variable2;\r
11 \r
12 public class Auxiliary2 extends ModelVariable {\r
13         \r
14         public Auxiliary2(double x, double y, double w, double h,\r
15                         String name, IExpression expression, Range range, String unit, String description) {\r
16                 super(x, y, w, h, name, expression, range, unit, description);\r
17         }\r
18         \r
19         public Auxiliary2(double x, double y, double w, double h, Variable2 variable) {\r
20                 super(x, y, w, h, variable);\r
21         }\r
22 \r
23         @Override\r
24         public void write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
25                 SysdynResource sr = SysdynResource.getInstance(graph);\r
26 \r
27                 Resource variable = createVariable(graph, sr.Auxiliary, parent, context);\r
28                 createSymbol(graph, sr.AuxiliarySymbol, variable, parent, context);\r
29                 \r
30                 setResource(variable);\r
31         }\r
32 \r
33         @Override\r
34         public boolean supportsDependencies() {\r
35                 return true;\r
36         }\r
37 \r
38         @Override\r
39         public boolean supportsFlows() {\r
40                 return false;\r
41         }\r
42 \r
43 }\r