]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Clean up vensim import, rename files
authorjkauttio <jkauttio@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 1 Apr 2014 11:27:47 +0000 (11:27 +0000)
committerjkauttio <jkauttio@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 1 Apr 2014 11:27:47 +0000 (11:27 +0000)
refs #2924

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/branches@29234 ac1ea38d-2e2b-0410-8846-a27921b304fc

26 files changed:
dev-jkauttio/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/imports/ImportMdlHandler.java
dev-jkauttio/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/wizards/mdl/WizardMdlImportPage.java
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlParser2.java
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlUtils.java
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/MdlModel.java
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/Sketch.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/Sketch2.java with 88% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchComment.java
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchConnection.java
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchElement.java
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchValve.java
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchVariable.java
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/Subscript2.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Subscript2.java with 85% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/Model2.java
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Auxiliary.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Auxiliary2.java with 78% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Cloud.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Cloud2.java with 87% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Comment.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Comment2.java with 87% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Connection.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Connection2.java with 91% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Dependency.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Dependency2.java with 86% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Element.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Element2.java with 88% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Flow.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Flow2.java with 88% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/ModelVariable.java
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Shadow.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Shadow2.java with 81% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Stock.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Stock2.java with 79% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Valve.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Valve2.java with 83% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Enumeration.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Enumeration2.java with 82% similarity]
dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Variable.java [moved from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Variable2.java with 79% similarity]

index 7bd39e6fb8245d1fbed2699dca21d6646a3bf7b9..c30a9c79b628e5084bc3cf932fb497127f5c2adb 100644 (file)
@@ -25,9 +25,7 @@ import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;\r
 import org.simantics.db.common.request.WriteRequest;\r
 import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.sysdyn.modelImport.MdlParser;\r
 import org.simantics.sysdyn.modelImport.MdlParser2;\r
-import org.simantics.sysdyn.modelImport.model.Model;\r
 import org.simantics.sysdyn.modelImport.model.Model2;\r
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 import org.simantics.sysdyn.ui.Activator;\r
@@ -68,8 +66,7 @@ public class ImportMdlHandler extends AbstractHandler {
                Activator.getDefault().getPreferenceStore().setValue(IMPORTMDLTPATH, (new File(selected)).getParent());\r
                \r
                // Convert Vensim model to Simantics SysDyn format using MdlParser\r
-               MdlParser2 parser = new MdlParser2();\r
-               final Model2 model = parser.parse(file);\r
+               final Model2 model = MdlParser2.parse(file);\r
                \r
                SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
                        \r
index d29e7f9b89ebf53ba0c613cc1ed2c422c661eb7d..475ee2646fd0e0969df2edda872a1fa6eecc64e9 100644 (file)
@@ -23,8 +23,9 @@ import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;\r
 import org.simantics.db.common.request.WriteRequest;\r
 import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.sysdyn.modelImport.MdlParser;\r
-import org.simantics.sysdyn.modelImport.model.Model;\r
+import org.simantics.sysdyn.modelImport.MdlParser2;\r
+import org.simantics.sysdyn.modelImport.model.Model2;\r
+import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 import org.simantics.ui.SimanticsUI;\r
 \r
 public class WizardMdlImportPage extends WizardPage{\r
@@ -178,13 +179,13 @@ public class WizardMdlImportPage extends WizardPage{
                \r
                File file = new File(selected);\r
                \r
-               final Model model = MdlParser.parse(file);\r
+               final Model2 model = MdlParser2.parse(file);\r
                \r
                SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
                        \r
                        @Override\r
                        public void perform(WriteGraph graph) throws DatabaseException {\r
-                               model.write(graph, project);\r
+                               model.write(graph, project, new WriteContext());\r
                        }\r
                });\r
                \r
index 9dd6dbfb817c76fba8ef20b39f86e53bbda823a0..abf8caf3f4b93562c174784d4a8d11ef92b43147 100644 (file)
@@ -21,25 +21,25 @@ import java.util.HashMap;
 \r
 import org.simantics.sysdyn.modelImport.MdlUtils.CommentIcon;\r
 import org.simantics.sysdyn.modelImport.mdl.MdlModel;\r
-import org.simantics.sysdyn.modelImport.mdl.Sketch2;\r
+import org.simantics.sysdyn.modelImport.mdl.Sketch;\r
 import org.simantics.sysdyn.modelImport.mdl.SketchComment;\r
 import org.simantics.sysdyn.modelImport.mdl.SketchConnection;\r
 import org.simantics.sysdyn.modelImport.mdl.SketchElement;\r
 import org.simantics.sysdyn.modelImport.mdl.SketchObject;\r
 import org.simantics.sysdyn.modelImport.mdl.SketchValve;\r
 import org.simantics.sysdyn.modelImport.mdl.SketchVariable;\r
+import org.simantics.sysdyn.modelImport.mdl.Subscript2;\r
 import org.simantics.sysdyn.modelImport.model.Model2;\r
-import org.simantics.sysdyn.modelImport.model.element.Auxiliary2;\r
-import org.simantics.sysdyn.modelImport.model.element.Cloud2;\r
-import org.simantics.sysdyn.modelImport.model.element.Comment2;\r
-import org.simantics.sysdyn.modelImport.model.element.Connection2;\r
-import org.simantics.sysdyn.modelImport.model.element.Element2;\r
-import org.simantics.sysdyn.modelImport.model.element.Shadow2;\r
-import org.simantics.sysdyn.modelImport.model.element.Stock2;\r
-import org.simantics.sysdyn.modelImport.model.element.Valve2;\r
+import org.simantics.sysdyn.modelImport.model.element.Auxiliary;\r
+import org.simantics.sysdyn.modelImport.model.element.Cloud;\r
+import org.simantics.sysdyn.modelImport.model.element.Comment;\r
+import org.simantics.sysdyn.modelImport.model.element.Connection;\r
+import org.simantics.sysdyn.modelImport.model.element.Element;\r
+import org.simantics.sysdyn.modelImport.model.element.Shadow;\r
+import org.simantics.sysdyn.modelImport.model.element.Stock;\r
+import org.simantics.sysdyn.modelImport.model.element.Valve;\r
 import org.simantics.sysdyn.modelImport.model.expression.IntegralExpression;\r
-import org.simantics.sysdyn.modelImport.model.support.Subscript2;\r
-import org.simantics.sysdyn.modelImport.model.support.Variable2;\r
+import org.simantics.sysdyn.modelImport.model.support.Variable;\r
 \r
 public class MdlParser2 {\r
 \r
@@ -74,7 +74,7 @@ public class MdlParser2 {
 \r
                // do this in several passes\r
 \r
-               HashMap<Variable2, Element2> variableToElement = new HashMap<Variable2, Element2>();\r
+               HashMap<Variable, Element> variableToElement = new HashMap<Variable, Element>();\r
                ArrayList<SketchVariable> shadows = new ArrayList<SketchVariable>();\r
                \r
                for (Subscript2 ss : mdl.getSubscripts()) {\r
@@ -82,13 +82,13 @@ public class MdlParser2 {
                }\r
                \r
                // add sketch labels and independent elements\r
-               for (Sketch2 sketch : mdl.getSketches()) {\r
+               for (Sketch sketch : mdl.getSketches()) {\r
                        sketch.setEdges();\r
 \r
                        sketch.hOffset = 0;\r
                        sketch.vOffset = 0 - sketch.topEdge + 10 + offset;\r
 \r
-                       model.addElement(new Comment2(0, offset, -1, -1, sketch.getName()));\r
+                       model.addElement(new Comment(0, offset, -1, -1, sketch.getName()));\r
 \r
                        for (SketchComment comment : sketch.getComments()) {\r
                                if (comment.isInputOutput()) {\r
@@ -97,13 +97,13 @@ public class MdlParser2 {
                                        continue;\r
                                }\r
 \r
-                               Element2 modelElement = comment.getModelElement(sketch.hOffset, sketch.vOffset);\r
+                               Element modelElement = comment.getModelElement(sketch.hOffset, sketch.vOffset);\r
                                model.addElement(modelElement);\r
                                sketch.elements.put(comment.getId(), modelElement);\r
                        }\r
 \r
                        for (SketchValve valve : sketch.getValves()) {\r
-                               Element2 modelElement = valve.getModelElement(sketch.hOffset, sketch.vOffset);\r
+                               Element modelElement = valve.getModelElement(sketch.hOffset, sketch.vOffset);\r
                                model.addElement(modelElement);\r
                                sketch.elements.put(valve.getId(), modelElement);\r
                                sketch.elements.put(valve.getAttachedVariable().getId(), modelElement);\r
@@ -121,7 +121,7 @@ public class MdlParser2 {
                                        continue;\r
                                }\r
 \r
-                               Element2 modelElement = variable.getModelElement(sketch.hOffset, sketch.vOffset);\r
+                               Element modelElement = variable.getModelElement(sketch.hOffset, sketch.vOffset);\r
                                model.addElement(modelElement);\r
                                sketch.elements.put(variable.getId(), modelElement);\r
                                variableToElement.put(variable.getVariable(), modelElement);\r
@@ -131,16 +131,16 @@ public class MdlParser2 {
                }\r
 \r
                // add dependent elements\r
-               for (Sketch2 sketch : mdl.getSketches()) {\r
+               for (Sketch sketch : mdl.getSketches()) {\r
                        for (SketchVariable variable : sketch.getVariables()) {\r
                                if (!variable.allowsIn()) {\r
                                        // the variable is a shadow variable\r
-                                       Element2 original = variableToElement.get(variable.getVariable());\r
+                                       Element original = variableToElement.get(variable.getVariable());\r
                                        if (original == null) {\r
                                                System.err.println("original not found");\r
                                                continue;\r
                                        }\r
-                                       Shadow2 modelElement = new Shadow2(\r
+                                       Shadow modelElement = new Shadow(\r
                                                        variable.getSysdyndX() + sketch.hOffset, \r
                                                        variable.getSysdyndY() + sketch.vOffset, \r
                                                        variable.getSysdynWidth(),\r
@@ -152,9 +152,9 @@ public class MdlParser2 {
                        }\r
 \r
                        for (SketchConnection connection : sketch.getConnections()) {\r
-                               Element2 head = sketch.elements.get(connection.getTo());\r
-                               Element2 tail = sketch.elements.get(connection.getFrom());\r
-                               Connection2 c = connection.getWriteableConnection(head, tail, sketch.vOffset);\r
+                               Element head = sketch.elements.get(connection.getTo());\r
+                               Element tail = sketch.elements.get(connection.getFrom());\r
+                               Connection c = connection.getWriteableConnection(head, tail, sketch.vOffset);\r
                                if (c != null) {\r
                                        model.addConnection(c);\r
                                }\r
@@ -241,15 +241,15 @@ public class MdlParser2 {
                                continue;\r
                        }\r
 \r
-                       Variable2 var = MdlUtils.getPossibleVariable(str, category);\r
+                       Variable var = MdlUtils.getPossibleVariable(str, category);\r
                        if (var != null) {\r
                                mdl.addVariable(var, category);\r
                                continue;\r
                        }\r
                        \r
-                       Variable2 ss = MdlUtils.getPossibleSubscriptVariable(str, category, mdl);\r
+                       Variable ss = MdlUtils.getPossibleSubscriptVariable(str, category, mdl);\r
                        if (ss != null) {\r
-                               Variable2 original = mdl.getVariable(ss.getName());\r
+                               Variable original = mdl.getVariable(ss.getName());\r
                                if (original == null) {\r
                                        mdl.addVariable(ss, category);\r
                                }\r
@@ -259,13 +259,13 @@ public class MdlParser2 {
                                continue;\r
                        }\r
                        \r
-                       Variable2 lu = MdlUtils.getPossibleLookUpVariable(str, category);\r
+                       Variable lu = MdlUtils.getPossibleLookUpVariable(str, category);\r
                        if (lu != null) {\r
                                System.err.println("found lookup variable "+lu.getName());\r
                                continue;\r
                        }\r
                        \r
-                       Variable2 plain = MdlUtils.getPossibleNoExpressionVariable(str);\r
+                       Variable plain = MdlUtils.getPossibleNoExpressionVariable(str);\r
                        if (plain != null) {\r
                                System.err.println("found plain variable "+plain.getName());\r
                                continue;\r
@@ -286,7 +286,7 @@ public class MdlParser2 {
 \r
        private static String parseSketches(BufferedReader reader, String line, MdlModel mdl) \r
                        throws IOException {\r
-               Sketch2 sketch = null;\r
+               Sketch sketch = null;\r
 \r
                do {\r
                        if (line.isEmpty())\r
@@ -295,7 +295,7 @@ public class MdlParser2 {
                        SketchObject so;\r
                        \r
                        if (line.startsWith(SKETCH_START)) {\r
-                               sketch = new Sketch2();\r
+                               sketch = new Sketch();\r
                                mdl.addSketch(sketch);\r
                        }\r
                        else if (line.startsWith(SKETCH_VERSION)) {\r
index 223c4d69d2243c0c9f3db2a12d8f183b7fabff3f..6bce7af0ef5771f9761bbf44020e5e229941050f 100644 (file)
@@ -9,7 +9,8 @@ import org.simantics.sysdyn.modelImport.mdl.SketchConnection;
 import org.simantics.sysdyn.modelImport.mdl.SketchElement;\r
 import org.simantics.sysdyn.modelImport.mdl.SketchValve;\r
 import org.simantics.sysdyn.modelImport.mdl.SketchVariable;\r
-import org.simantics.sysdyn.modelImport.model.element.Valve2.TextPosition;\r
+import org.simantics.sysdyn.modelImport.mdl.Subscript2;\r
+import org.simantics.sysdyn.modelImport.model.element.Valve.TextPosition;\r
 import org.simantics.sysdyn.modelImport.model.expression.DelayExpression;\r
 import org.simantics.sysdyn.modelImport.model.expression.IExpression;\r
 import org.simantics.sysdyn.modelImport.model.expression.IntegralExpression;\r
@@ -17,8 +18,7 @@ import org.simantics.sysdyn.modelImport.model.expression.LookupExpression;
 import org.simantics.sysdyn.modelImport.model.expression.NormalExpression;\r
 import org.simantics.sysdyn.modelImport.model.expression.SubscriptExpression;\r
 import org.simantics.sysdyn.modelImport.model.support.Range;\r
-import org.simantics.sysdyn.modelImport.model.support.Subscript2;\r
-import org.simantics.sysdyn.modelImport.model.support.Variable2;\r
+import org.simantics.sysdyn.modelImport.model.support.Variable;\r
 \r
 public class MdlUtils {\r
        \r
@@ -63,7 +63,7 @@ public class MdlUtils {
        private static final int variableUnit = 3;\r
        private static final int variableDesc = 4;\r
        \r
-       public static Variable2 getPossibleVariable(String line, String category) {\r
+       public static Variable getPossibleVariable(String line, String category) {\r
                Matcher matcher = Pattern.compile(variablePattern).matcher(line);\r
                \r
                if (!matcher.matches()) {\r
@@ -80,7 +80,7 @@ public class MdlUtils {
                }\r
                String description = matcher.group(variableDesc);\r
                \r
-               return new Variable2(name, expression, unit, range, description);\r
+               return new Variable(name, expression, unit, range, description);\r
        }\r
        \r
        // a subscript variable is a variable that has a different equation\r
@@ -100,7 +100,7 @@ public class MdlUtils {
        private static final int subscriptVariableUnit = 4;\r
        private static final int subscriptVariableDesc = 5;\r
        \r
-       public static Variable2 getPossibleSubscriptVariable(String line, String category, MdlModel mdl) {\r
+       public static Variable getPossibleSubscriptVariable(String line, String category, MdlModel mdl) {\r
                Matcher matcher = Pattern.compile(subscriptVariablePattern).matcher(line);\r
                \r
                if (!matcher.matches()) {\r
@@ -121,7 +121,7 @@ public class MdlUtils {
                }\r
                String description = matcher.group(subscriptVariableDesc);\r
                \r
-               return new Variable2(name, e, unit, range, description);\r
+               return new Variable(name, e, unit, range, description);\r
        }\r
        \r
        private static final String LOOKUP_NAME =\r
@@ -146,7 +146,7 @@ public class MdlUtils {
        private static final int lookupVariableUnit = 7;\r
        private static final int lookupVariableDesc = 8;\r
        \r
-       public static Variable2 getPossibleLookUpVariable(String line, String category) {\r
+       public static Variable getPossibleLookUpVariable(String line, String category) {\r
                Matcher matcher = Pattern.compile(lookupVariablePattern).matcher(line);\r
                \r
                if (!matcher.matches()) {\r
@@ -169,7 +169,7 @@ public class MdlUtils {
                }\r
                String description = matcher.group(lookupVariableDesc);\r
                \r
-               return new Variable2(name, e, unit, range, description);\r
+               return new Variable(name, e, unit, range, description);\r
        }\r
        \r
        public static final String NO_EXP_PATTERN = \r
@@ -182,7 +182,7 @@ public class MdlUtils {
        private static final int noExpVariableUnit = 2;\r
        private static final int noExpVariableDesc = 3;\r
        \r
-       public static Variable2 getPossibleNoExpressionVariable(String line) {\r
+       public static Variable getPossibleNoExpressionVariable(String line) {\r
                Matcher matcher = Pattern.compile(noExpressionVariablePattern).matcher(line);\r
                \r
                if (!matcher.matches()) {\r
@@ -198,7 +198,7 @@ public class MdlUtils {
                }\r
                String description = matcher.group(noExpVariableDesc);\r
                \r
-               return new Variable2(name, null, unit, range, description);\r
+               return new Variable(name, null, unit, range, description);\r
        }\r
 \r
        private static final String SUBSCRIPT_PATTERN =\r
@@ -376,7 +376,7 @@ public class MdlUtils {
                }\r
                \r
                int id = Integer.parseInt(matcher.group(elementId));\r
-               Variable2 var = mdl.getVariable((normalize(matcher.group(elementName))));\r
+               Variable var = mdl.getVariable((normalize(matcher.group(elementName))));\r
                \r
                SketchVariable variable = new SketchVariable(id, var);\r
                \r
index 3677ec77f31276f8760c66121a30ca7f6cf59e0b..43fc4ce90cfe40d3ba56e3955400293ca1a32847 100644 (file)
@@ -5,29 +5,28 @@ import java.util.Collections;
 import java.util.HashMap;\r
 import java.util.List;\r
 \r
-import org.simantics.sysdyn.modelImport.model.support.Subscript2;\r
-import org.simantics.sysdyn.modelImport.model.support.Variable2;\r
+import org.simantics.sysdyn.modelImport.model.support.Variable;\r
 \r
 public class MdlModel {\r
        \r
        private String name;\r
        \r
-       private HashMap<String, Variable2> variables;\r
-       private HashMap<String, ArrayList<Variable2>> groups;\r
+       private HashMap<String, Variable> variables;\r
+       private HashMap<String, ArrayList<Variable>> groups;\r
        \r
        private HashMap<String, Subscript2> subscripts;\r
        \r
-       private ArrayList<Sketch2> sketches;\r
+       private ArrayList<Sketch> sketches;\r
        \r
        public MdlModel(String name) {\r
                this.name = name;\r
-               this.variables = new HashMap<String, Variable2>();\r
-               this.groups = new HashMap<String, ArrayList<Variable2>>();\r
+               this.variables = new HashMap<String, Variable>();\r
+               this.groups = new HashMap<String, ArrayList<Variable>>();\r
                this.subscripts = new HashMap<String, Subscript2>();\r
-               this.sketches = new ArrayList<Sketch2>();\r
+               this.sketches = new ArrayList<Sketch>();\r
        }\r
        \r
-       public void addVariable(Variable2 variable, String group) {\r
+       public void addVariable(Variable variable, String group) {\r
                if (variables.get(variable.getName()) != null) {\r
                        System.err.println("warning, duplicate variable "+variable.getName());\r
                }\r
@@ -36,18 +35,18 @@ public class MdlModel {
                \r
                if (group != null) {\r
                        if (groups.get(group) == null) {\r
-                               groups.put(group, new ArrayList<Variable2>());\r
+                               groups.put(group, new ArrayList<Variable>());\r
                        }\r
                        groups.get(group).add(variable);\r
                }\r
        }\r
        \r
-       public Variable2 getVariable(String name) {\r
+       public Variable getVariable(String name) {\r
                return variables.get(name);\r
        }\r
        \r
-       public List<Variable2> getVariables() {\r
-               return new ArrayList<Variable2>(variables.values());\r
+       public List<Variable> getVariables() {\r
+               return new ArrayList<Variable>(variables.values());\r
        }\r
        \r
        public void addSubscript(Subscript2 subscript) {\r
@@ -62,11 +61,11 @@ public class MdlModel {
                return new ArrayList<Subscript2>(subscripts.values());\r
        }\r
        \r
-       public void addSketch(Sketch2 sketch) {\r
+       public void addSketch(Sketch sketch) {\r
                sketches.add(sketch);\r
        }\r
        \r
-       public List<Sketch2> getSketches() {\r
+       public List<Sketch> getSketches() {\r
                return sketches;\r
        }\r
        \r
similarity index 88%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/Sketch2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/Sketch.java
index b75d374154896241fdc127dc5e50d9c50cc96b2e..471f5f843a8fec75a9f448969c0ed511300f4f21 100644 (file)
@@ -4,9 +4,9 @@ import java.util.ArrayList;
 import java.util.HashMap;\r
 import java.util.List;\r
 \r
-import org.simantics.sysdyn.modelImport.model.element.Element2;\r
+import org.simantics.sysdyn.modelImport.model.element.Element;\r
 \r
-public class Sketch2 {\r
+public class Sketch {\r
        \r
        private String name;\r
        \r
@@ -15,7 +15,7 @@ public class Sketch2 {
        private ArrayList<SketchValve> valves;\r
        private ArrayList<SketchVariable> variables;\r
        \r
-       public Sketch2() {\r
+       public Sketch() {\r
                comments = new ArrayList<SketchComment>();\r
                connections = new ArrayList<SketchConnection>();\r
                valves = new ArrayList<SketchValve>();\r
@@ -81,7 +81,7 @@ public class Sketch2 {
        public double leftEdge = 0;\r
        public double rightEdge = 0;\r
        \r
-       public HashMap<Integer, Element2> elements = new HashMap<Integer, Element2>();\r
+       public HashMap<Integer, Element> elements = new HashMap<Integer, Element>();\r
        \r
        public void setEdges() {\r
                boolean first = true;\r
index fe3c411057989726a29da14ef240c2ffafeb4ae0..20c5ff7d6377bd1b6a9964e8512a7495b9d5b016 100644 (file)
@@ -1,9 +1,9 @@
 package org.simantics.sysdyn.modelImport.mdl;\r
 \r
 import org.simantics.sysdyn.modelImport.MdlUtils.CommentIcon;\r
-import org.simantics.sysdyn.modelImport.model.element.Cloud2;\r
-import org.simantics.sysdyn.modelImport.model.element.Comment2;\r
-import org.simantics.sysdyn.modelImport.model.element.Element2;\r
+import org.simantics.sysdyn.modelImport.model.element.Cloud;\r
+import org.simantics.sysdyn.modelImport.model.element.Comment;\r
+import org.simantics.sysdyn.modelImport.model.element.Element;\r
 \r
 public class SketchComment extends SketchElement {\r
        \r
@@ -27,16 +27,16 @@ public class SketchComment extends SketchElement {
                return icon;\r
        }\r
        \r
-       public Element2 getModelElement(double hOffset, double vOffset) {\r
+       public Element getModelElement(double hOffset, double vOffset) {\r
                if (icon.equals(CommentIcon.CLOUD)) {\r
-                       return new Cloud2(\r
+                       return new Cloud(\r
                                        getSysdyndX() + hOffset, \r
                                        getSysdyndY() + vOffset, \r
                                        getSysdynWidth(),\r
                                        getSysdynHeight());\r
                }\r
                else {\r
-                       return new Comment2(\r
+                       return new Comment(\r
                                        getSysdyndX() + hOffset, \r
                                        getSysdyndY() + vOffset, \r
                                        getSysdynWidth(),\r
index c0828b76ea06b51ab3f980b26124669507b5345e..ed5d06915a49d8bd37531af9ba3a4ea31f1836f5 100644 (file)
@@ -1,10 +1,10 @@
 package org.simantics.sysdyn.modelImport.mdl;\r
 \r
 import org.simantics.sysdyn.modelImport.MdlUtils.ConnectionType;\r
-import org.simantics.sysdyn.modelImport.model.element.Connection2;\r
-import org.simantics.sysdyn.modelImport.model.element.Dependency2;\r
-import org.simantics.sysdyn.modelImport.model.element.Element2;\r
-import org.simantics.sysdyn.modelImport.model.element.Flow2;\r
+import org.simantics.sysdyn.modelImport.model.element.Connection;\r
+import org.simantics.sysdyn.modelImport.model.element.Dependency;\r
+import org.simantics.sysdyn.modelImport.model.element.Element;\r
+import org.simantics.sysdyn.modelImport.model.element.Flow;\r
 \r
 public class SketchConnection extends SketchObject {\r
 \r
@@ -33,22 +33,22 @@ public class SketchConnection extends SketchObject {
                return type;\r
        }\r
 \r
-       public Connection2 getWriteableConnection(Element2 head, Element2 tail, double offset) {\r
+       public Connection getWriteableConnection(Element head, Element tail, double offset) {\r
                if (type.equals(ConnectionType.ARROW)) {\r
-                       return new Dependency2(head, tail, false, false, getSysdynAngle(tail, head, offset));\r
+                       return new Dependency(head, tail, false, false, getSysdynAngle(tail, head, offset));\r
                }\r
                else if (type.equals(ConnectionType.LINE_ARROW)) {\r
-                       return new Flow2(head, tail);\r
+                       return new Flow(head, tail);\r
                }\r
                else if (type.equals(ConnectionType.LINE_SEGMENT)) {\r
                        // TODO: what is this I don't even...\r
-                       return new Flow2(tail, head);\r
+                       return new Flow(tail, head);\r
                }\r
                return null;\r
        }\r
 \r
        // TODO: comment this?\r
-       public double getSysdynAngle(Element2 from, Element2 to, double voffset) {\r
+       public double getSysdynAngle(Element from, Element to, double voffset) {\r
                if (points == null || points.length == 0) {\r
                        return 0;\r
                }\r
index 974751e218c575633a6a2d807969285a4f8e392f..1220b61ced98bc40415effa1c9cdbd702aa6d325 100644 (file)
@@ -1,6 +1,6 @@
 package org.simantics.sysdyn.modelImport.mdl;\r
 \r
-import org.simantics.sysdyn.modelImport.model.element.Element2;\r
+import org.simantics.sysdyn.modelImport.model.element.Element;\r
 \r
 public abstract class SketchElement extends SketchObject {\r
 \r
@@ -105,6 +105,6 @@ public abstract class SketchElement extends SketchObject {
                return textLine;\r
        }\r
 \r
-       public abstract Element2 getModelElement(double hOffset, double vOffset);\r
+       public abstract Element getModelElement(double hOffset, double vOffset);\r
        \r
 }\r
index 7116128579f83ce0391cdc6bb56b6ffa5b916ac9..ee5bd15ab3c39bce2bab6414b82935a738da3513 100644 (file)
@@ -1,8 +1,8 @@
 package org.simantics.sysdyn.modelImport.mdl;\r
 \r
-import org.simantics.sysdyn.modelImport.model.element.Element2;\r
-import org.simantics.sysdyn.modelImport.model.element.Valve2;\r
-import org.simantics.sysdyn.modelImport.model.element.Valve2.TextPosition;\r
+import org.simantics.sysdyn.modelImport.model.element.Element;\r
+import org.simantics.sysdyn.modelImport.model.element.Valve;\r
+import org.simantics.sysdyn.modelImport.model.element.Valve.TextPosition;\r
 \r
 public class SketchValve extends SketchElement {\r
        \r
@@ -23,8 +23,8 @@ public class SketchValve extends SketchElement {
        }\r
        \r
        @Override\r
-       public Element2 getModelElement(double hOffset, double vOffset) {\r
-               return new Valve2(\r
+       public Element getModelElement(double hOffset, double vOffset) {\r
+               return new Valve(\r
                                getSysdyndX() + hOffset, \r
                                getSysdyndY() + vOffset, \r
                                getSysdynWidth(),\r
index c24791a04a341ae2e8ae874834e93a04de8494d6..fe1a375fb6f92933afdf030eb387d89366d2b6f8 100644 (file)
@@ -1,28 +1,28 @@
 package org.simantics.sysdyn.modelImport.mdl;\r
 \r
-import org.simantics.sysdyn.modelImport.model.element.Auxiliary2;\r
-import org.simantics.sysdyn.modelImport.model.element.Element2;\r
-import org.simantics.sysdyn.modelImport.model.element.Stock2;\r
+import org.simantics.sysdyn.modelImport.model.element.Auxiliary;\r
+import org.simantics.sysdyn.modelImport.model.element.Element;\r
+import org.simantics.sysdyn.modelImport.model.element.Stock;\r
 import org.simantics.sysdyn.modelImport.model.expression.IntegralExpression;\r
-import org.simantics.sysdyn.modelImport.model.support.Variable2;\r
+import org.simantics.sysdyn.modelImport.model.support.Variable;\r
 \r
 public class SketchVariable extends SketchElement {\r
        \r
-       private Variable2 variable;\r
+       private Variable variable;\r
 \r
-       public SketchVariable(int id, Variable2 variable) {\r
+       public SketchVariable(int id, Variable variable) {\r
                super(id);\r
                this.variable = variable;\r
        }\r
        \r
-       public Variable2 getVariable() {\r
+       public Variable getVariable() {\r
                return variable;\r
        }\r
        \r
        @Override\r
-       public Element2 getModelElement(double hOffset, double vOffset) {\r
+       public Element getModelElement(double hOffset, double vOffset) {\r
                if (variable.getExpression() instanceof IntegralExpression) {\r
-                       return new Stock2(\r
+                       return new Stock(\r
                                        getSysdyndX() + hOffset, \r
                                        getSysdyndY() + vOffset, \r
                                        getSysdynWidth(),\r
@@ -30,7 +30,7 @@ public class SketchVariable extends SketchElement {
                                        variable);\r
                }\r
                else {\r
-                       return new Auxiliary2(\r
+                       return new Auxiliary(\r
                                        getSysdyndX() + hOffset, \r
                                        getSysdyndY() + vOffset,  \r
                                        getSysdynWidth(),\r
index b4121b12a7447806dbdc2c60648d74504a7de121..bdc5a19f5fb921742ce6a27d160e4cb9b1c8e4e1 100644 (file)
@@ -24,11 +24,11 @@ import org.simantics.diagram.stubs.DiagramResource;
 import org.simantics.layer0.Layer0;\r
 import org.simantics.modeling.ModelingResources;\r
 import org.simantics.simulation.ontology.SimulationResource;\r
-import org.simantics.sysdyn.modelImport.model.element.Connection2;\r
-import org.simantics.sysdyn.modelImport.model.element.Element2;\r
+import org.simantics.sysdyn.modelImport.model.element.Connection;\r
+import org.simantics.sysdyn.modelImport.model.element.Element;\r
 import org.simantics.sysdyn.modelImport.model.element.ModelVariable;\r
-import org.simantics.sysdyn.modelImport.model.element.Shadow2;\r
-import org.simantics.sysdyn.modelImport.model.support.Enumeration2;\r
+import org.simantics.sysdyn.modelImport.model.element.Shadow;\r
+import org.simantics.sysdyn.modelImport.model.support.Enumeration;\r
 import org.simantics.sysdyn.utils.ModelUtils;\r
 \r
 public class Model2 implements IWriteableObject {\r
@@ -38,22 +38,22 @@ public class Model2 implements IWriteableObject {
        private double start, stop, step;\r
        \r
        // the structure of the model\r
-       private HashMap<String, Enumeration2> enumerations;\r
+       private HashMap<String, Enumeration> enumerations;\r
        private HashMap<String, ModelVariable> variables;\r
        \r
-       private ArrayList<Element2> elements;\r
-       private ArrayList<Shadow2> shadows;\r
-       private ArrayList<Connection2> connections;\r
+       private ArrayList<Element> elements;\r
+       private ArrayList<Shadow> shadows;\r
+       private ArrayList<Connection> connections;\r
        \r
        public Model2(String name) {\r
                this.name = name;\r
                \r
-               enumerations = new HashMap<String, Enumeration2>();\r
+               enumerations = new HashMap<String, Enumeration>();\r
                variables = new HashMap<String, ModelVariable>();\r
                \r
-               elements = new ArrayList<Element2>();\r
-               shadows = new ArrayList<Shadow2>();\r
-               connections = new ArrayList<Connection2>();\r
+               elements = new ArrayList<Element>();\r
+               shadows = new ArrayList<Shadow>();\r
+               connections = new ArrayList<Connection>();\r
        }\r
 \r
        public double getStart() {\r
@@ -80,18 +80,18 @@ public class Model2 implements IWriteableObject {
                this.step = step;\r
        }\r
        \r
-       public void addEnumeration(Enumeration2 enumeration) {\r
+       public void addEnumeration(Enumeration enumeration) {\r
                if (enumerations.get(enumeration.getName()) != null) {\r
                        System.err.println("enumeration "+enumeration.getName()+" already defined");\r
                }\r
                enumerations.put(enumeration.getName(), enumeration);\r
        }\r
        \r
-       public Enumeration2 getEnumeration(String name) {\r
+       public Enumeration getEnumeration(String name) {\r
                return enumerations.get(name);\r
        }\r
        \r
-       public Collection<Enumeration2> getEnumerations() {\r
+       public Collection<Enumeration> getEnumerations() {\r
                return enumerations.values();\r
        }\r
        \r
@@ -112,15 +112,15 @@ public class Model2 implements IWriteableObject {
                return variables.values();\r
        }\r
                \r
-       public void addElement(Element2 element) {\r
+       public void addElement(Element element) {\r
                elements.add(element);\r
        }\r
        \r
-       public void addShadow(Shadow2 shadow) {\r
+       public void addShadow(Shadow shadow) {\r
                shadows.add(shadow);\r
        }\r
        \r
-       public void addConnection(Connection2 connection) {\r
+       public void addConnection(Connection connection) {\r
                connections.add(connection);\r
        }\r
 \r
@@ -138,19 +138,19 @@ public class Model2 implements IWriteableObject {
                \r
                Resource configuration = graph.getSingleObject(model, sim.HasConfiguration);\r
                \r
-               for (Enumeration2 e : getEnumerations()) {\r
+               for (Enumeration e : getEnumerations()) {\r
                        e.write(graph, configuration, context);\r
                }\r
                \r
-               for (Element2 e : elements) {\r
+               for (Element e : elements) {\r
                        e.write(graph, configuration, context);\r
                }\r
                \r
-               for (Shadow2 s : shadows) {\r
+               for (Shadow s : shadows) {\r
                        s.write(graph, configuration, context);\r
                }\r
                \r
-               for (Connection2 c : connections) {\r
+               for (Connection c : connections) {\r
                        c.write(graph, configuration, context);\r
                }\r
                \r
similarity index 78%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Auxiliary2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Auxiliary.java
index f1dbf8e4272881924aef42605f151cc46c153eb1..3e2654fa58691f2cb51dfc00f86969478ff3aaef 100644 (file)
@@ -7,16 +7,16 @@ import org.simantics.sysdyn.SysdynResource;
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 import org.simantics.sysdyn.modelImport.model.expression.IExpression;\r
 import org.simantics.sysdyn.modelImport.model.support.Range;\r
-import org.simantics.sysdyn.modelImport.model.support.Variable2;\r
+import org.simantics.sysdyn.modelImport.model.support.Variable;\r
 \r
-public class Auxiliary2 extends ModelVariable {\r
+public class Auxiliary extends ModelVariable {\r
        \r
-       public Auxiliary2(double x, double y, double w, double h,\r
+       public Auxiliary(double x, double y, double w, double h,\r
                        String name, IExpression expression, Range range, String unit, String description) {\r
                super(x, y, w, h, name, expression, range, unit, description);\r
        }\r
        \r
-       public Auxiliary2(double x, double y, double w, double h, Variable2 variable) {\r
+       public Auxiliary(double x, double y, double w, double h, Variable variable) {\r
                super(x, y, w, h, variable);\r
        }\r
 \r
similarity index 87%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Cloud2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Cloud.java
index f8813db73a3ba8e9a8aecdbb951d777cdc648677..1aba25843dec6928c529acde25e5c2380efb6b8f 100644 (file)
@@ -8,9 +8,9 @@ import org.simantics.layer0.utils.direct.GraphUtils;
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 \r
-public class Cloud2 extends Element2 {\r
+public class Cloud extends Element {\r
        \r
-       public Cloud2(double x, double y, double w, double h) {\r
+       public Cloud(double x, double y, double w, double h) {\r
                super(x, y, w, h);\r
        }\r
 \r
similarity index 87%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Comment2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Comment.java
index 72b18b2f4e1bc65b543212dde68630c2c048119c..264ec411db337b6fd1afc759cf3500e0cf3302c1 100644 (file)
@@ -10,11 +10,11 @@ import org.simantics.layer0.utils.direct.GraphUtils;
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 \r
-public class Comment2 extends Element2 {\r
+public class Comment extends Element {\r
        \r
        private String text;\r
        \r
-       public Comment2(double x, double y, double w, double h, String text) {\r
+       public Comment(double x, double y, double w, double h, String text) {\r
                super(x, y, w, h);\r
                this.text = text;\r
        }\r
similarity index 91%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Connection2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Connection.java
index e39b8c387d2d99fff421446d37d17042fcfc2637..00119d31315758467109bfe0dab6b99a6a87c205 100644 (file)
@@ -13,12 +13,12 @@ import org.simantics.sysdyn.SysdynResource;
 import org.simantics.sysdyn.modelImport.model.IWriteableObject;\r
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 \r
-public abstract class Connection2 implements IWriteableObject {\r
+public abstract class Connection implements IWriteableObject {\r
 \r
-       protected Element2 head;\r
-       protected Element2 tail;\r
+       protected Element head;\r
+       protected Element tail;\r
 \r
-       public Connection2(Element2 head, Element2 tail) {\r
+       public Connection(Element head, Element tail) {\r
                this.head = head;\r
                this.tail = tail;\r
        }\r
similarity index 86%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Dependency2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Dependency.java
index 576402bf923211664769a4542996acc3ef3e6b66..3fab1e5c12a8e7c70758051620abecfd1abdcdab 100644 (file)
@@ -8,13 +8,13 @@ import org.simantics.layer0.Layer0;
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 \r
-public class Dependency2 extends Connection2 {\r
+public class Dependency extends Connection {\r
        \r
        private boolean showArrow;\r
        private boolean showDelay;\r
        private double angle;\r
        \r
-       public Dependency2(Element2 head, Element2 tail, boolean showArrow, boolean showDelay, double angle) {\r
+       public Dependency(Element head, Element tail, boolean showArrow, boolean showDelay, double angle) {\r
                super(head, tail);\r
                this.showArrow = showArrow;\r
                this.showDelay = showDelay;\r
similarity index 88%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Element2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Element.java
index 7680f9dab5b572f05d3b8da4784bfcbba3576b0f..8baf0a2a368d8594663874e3476e61e156e7b558 100644 (file)
@@ -14,7 +14,7 @@ import org.simantics.sysdyn.modelImport.mdl.SketchElement;
 import org.simantics.sysdyn.modelImport.model.IWriteableObject;\r
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 \r
-public abstract class Element2 implements IWriteableObject {\r
+public abstract class Element implements IWriteableObject {\r
        \r
        private double x;\r
        private double y;\r
@@ -23,14 +23,14 @@ public abstract class Element2 implements IWriteableObject {
 \r
        private Resource resource;\r
 \r
-       public Element2(double x, double y, double width, double height) {\r
+       public Element(double x, double y, double width, double height) {\r
                this.x = x;\r
                this.y = y;\r
                this.width = width;\r
                this.height = height;\r
        }\r
        \r
-       public Element2(SketchElement element, double hOffset, double vOffset) {\r
+       public Element(SketchElement element, double hOffset, double vOffset) {\r
                this.x = element.getSysdyndX() + hOffset;\r
                this.y = element.getSysdyndY() + vOffset;\r
                this.width = element.getSysdynWidth();\r
similarity index 88%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Flow2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Flow.java
index 84fb5d7580ee5098184409e41a98a8516538883b..1b40f2fc4a891433f664b9b1759bbb6f8272ea18 100644 (file)
@@ -8,9 +8,9 @@ import org.simantics.layer0.Layer0;
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 \r
-public class Flow2 extends Connection2 {\r
+public class Flow extends Connection {\r
        \r
-       public Flow2(Element2 head, Element2 tail) {\r
+       public Flow(Element head, Element tail) {\r
                super(head, tail);\r
        }\r
 \r
index 4b0dc58c84541eaa4bf94ac5c7cd5521f5b8f54f..fd669dc6e55c4a7811d8e3f4ba7e066c579dc54f 100644 (file)
@@ -12,11 +12,11 @@ import org.simantics.modeling.ModelingResources;
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 import org.simantics.sysdyn.modelImport.model.expression.IExpression;\r
-import org.simantics.sysdyn.modelImport.model.support.Enumeration2;\r
+import org.simantics.sysdyn.modelImport.model.support.Enumeration;\r
 import org.simantics.sysdyn.modelImport.model.support.Range;\r
-import org.simantics.sysdyn.modelImport.model.support.Variable2;\r
+import org.simantics.sysdyn.modelImport.model.support.Variable;\r
 \r
-public abstract class ModelVariable extends Element2 {\r
+public abstract class ModelVariable extends Element {\r
 \r
        protected String name;\r
        protected IExpression expression;\r
@@ -24,7 +24,7 @@ public abstract class ModelVariable extends Element2 {
        protected String unit;\r
        protected String description;\r
        \r
-       protected List<Enumeration2> enumerations;\r
+       protected List<Enumeration> enumerations;\r
 \r
        public ModelVariable(double x, double y, double w, double h, String name, IExpression expression, Range range, String unit, String description) {\r
                super(x, y, w, h);\r
@@ -35,7 +35,7 @@ public abstract class ModelVariable extends Element2 {
                this.description = description;\r
        }\r
        \r
-       public ModelVariable(double x, double y, double w, double h, Variable2 variable) {\r
+       public ModelVariable(double x, double y, double w, double h, Variable variable) {\r
                super(x, y, w, h);\r
                this.name = variable.getName();\r
                this.expression = variable.getExpression();\r
similarity index 81%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Shadow2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Shadow.java
index 005096347e844ca852338acf0e0856a92492d7ee..b699fa9e64f5b7f72e2fea1fcb49816230bfd13e 100644 (file)
@@ -9,16 +9,16 @@ import org.simantics.sysdyn.SysdynResource;
 import org.simantics.sysdyn.modelImport.mdl.SketchVariable;\r
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 \r
-public class Shadow2 extends Element2 {\r
+public class Shadow extends Element {\r
 \r
-       private Element2 original;\r
+       private Element original;\r
        \r
-       public Shadow2(double x, double y, double w, double h, Element2 original) {\r
+       public Shadow(double x, double y, double w, double h, Element original) {\r
                super(x, y, w, h);\r
                this.original = original;\r
        }\r
        \r
-       public Shadow2(SketchVariable variable, double hOffset, double vOffset, Element2 original) {\r
+       public Shadow(SketchVariable variable, double hOffset, double vOffset, Element original) {\r
                super(variable, hOffset, vOffset);\r
                this.original = original;\r
        }\r
similarity index 79%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Stock2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Stock.java
index 0078f4fcf8c41c049a86a6bd0649aa05b73dae8c..3c958ec1f08dc774b7127e69c30bad6c63bcfcaa 100644 (file)
@@ -7,16 +7,16 @@ import org.simantics.sysdyn.SysdynResource;
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 import org.simantics.sysdyn.modelImport.model.expression.IntegralExpression;\r
 import org.simantics.sysdyn.modelImport.model.support.Range;\r
-import org.simantics.sysdyn.modelImport.model.support.Variable2;\r
+import org.simantics.sysdyn.modelImport.model.support.Variable;\r
 \r
-public class Stock2 extends ModelVariable {\r
+public class Stock extends ModelVariable {\r
        \r
-       public Stock2(double x, double y, double w, double h,\r
+       public Stock(double x, double y, double w, double h,\r
                        String name, IntegralExpression expression, Range range, String unit, String description) {\r
                super(x, y, w, h, name, expression, range, unit, description);\r
        }\r
        \r
-       public Stock2(double x, double y, double w, double h, Variable2 variable) {\r
+       public Stock(double x, double y, double w, double h, Variable variable) {\r
                super(x, y, w, h, variable);\r
        }\r
        \r
similarity index 83%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Valve2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Valve.java
index cc0442c77edab963548db27963e959c6870bbe3f..559eff52f30593d19224a4aa7b7e48ff7d2e7a10 100644 (file)
@@ -7,9 +7,9 @@ import org.simantics.sysdyn.SysdynResource;
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 import org.simantics.sysdyn.modelImport.model.expression.IExpression;\r
 import org.simantics.sysdyn.modelImport.model.support.Range;\r
-import org.simantics.sysdyn.modelImport.model.support.Variable2;\r
+import org.simantics.sysdyn.modelImport.model.support.Variable;\r
 \r
-public class Valve2 extends ModelVariable {\r
+public class Valve extends ModelVariable {\r
        \r
        public enum Orientation {\r
                HORIZONTAL, VERTICAL\r
@@ -21,13 +21,13 @@ public class Valve2 extends ModelVariable {
        \r
        private TextPosition position;\r
        \r
-       public Valve2(double x, double y, double w, double h,\r
+       public Valve(double x, double y, double w, double h,\r
                        String name, IExpression expression, Range range, String unit, String description, TextPosition position) {\r
                super(x, y, w, h, name, expression, range, unit, description);\r
                this.position = position;\r
        }\r
        \r
-       public Valve2(double x, double y, double w, double h, Variable2 variable, TextPosition position) {\r
+       public Valve(double x, double y, double w, double h, Variable variable, TextPosition position) {\r
                super(x, y, w, h, variable);\r
                this.position = position;\r
        }\r
similarity index 82%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Enumeration2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Enumeration.java
index 4f31cb0cbe55de1cfc5207566744622ca9118a38..feb0f80153dbd9c37c31aa37ec9a6a94ee858d58 100644 (file)
@@ -8,14 +8,14 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.sysdyn.modelImport.model.IWriteableObject;\r
 import org.simantics.sysdyn.modelImport.model.WriteContext;\r
 \r
-public class Enumeration2 implements IWriteableObject {\r
+public class Enumeration implements IWriteableObject {\r
        \r
        private String name;\r
        private ArrayList<String> values;\r
        \r
        private Resource resource;\r
        \r
-       public Enumeration2(String name, ArrayList<String> values) {\r
+       public Enumeration(String name, ArrayList<String> values) {\r
                this.name = name;\r
                this.values = values;\r
        }\r
similarity index 79%
rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Variable2.java
rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Variable.java
index fbcc18e3248f0525d01077cda24c79dcafa2eb63..63969c01efa701a605a9ce051b7985dccf4d4e5a 100644 (file)
@@ -3,7 +3,7 @@ package org.simantics.sysdyn.modelImport.model.support;
 import org.simantics.sysdyn.modelImport.model.expression.IExpression;\r
 import org.simantics.sysdyn.modelImport.model.expression.SubscriptExpression;\r
 \r
-public class Variable2 {\r
+public class Variable {\r
        \r
        private String name;\r
        private IExpression expression;\r
@@ -11,7 +11,7 @@ public class Variable2 {
        private Range range;\r
        private String description;\r
        \r
-       public Variable2(String name, IExpression expression, String unit, Range range, String description) {\r
+       public Variable(String name, IExpression expression, String unit, Range range, String description) {\r
                this.name = name;\r
                this.expression = expression;\r
                this.unit = unit;\r
@@ -39,7 +39,7 @@ public class Variable2 {
                return description;\r
        }\r
        \r
-       public void mergeExpression(Variable2 variable) {\r
+       public void mergeExpression(Variable variable) {\r
                if (expression instanceof SubscriptExpression) {\r
                        ((SubscriptExpression)expression).merge((SubscriptExpression)variable.getExpression());\r
                }\r