From: jkauttio Date: Tue, 1 Apr 2014 11:27:47 +0000 (+0000) Subject: Clean up vensim import, rename files X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=fc9037790d601da3758d3254fa7162dacf761cff;p=simantics%2Fsysdyn.git Clean up vensim import, rename files refs #2924 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/branches@29234 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/dev-jkauttio/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/imports/ImportMdlHandler.java b/dev-jkauttio/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/imports/ImportMdlHandler.java index 7bd39e6f..c30a9c79 100644 --- a/dev-jkauttio/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/imports/ImportMdlHandler.java +++ b/dev-jkauttio/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/imports/ImportMdlHandler.java @@ -25,9 +25,7 @@ import org.simantics.db.Resource; import org.simantics.db.WriteGraph; import org.simantics.db.common.request.WriteRequest; import org.simantics.db.exception.DatabaseException; -import org.simantics.sysdyn.modelImport.MdlParser; import org.simantics.sysdyn.modelImport.MdlParser2; -import org.simantics.sysdyn.modelImport.model.Model; import org.simantics.sysdyn.modelImport.model.Model2; import org.simantics.sysdyn.modelImport.model.WriteContext; import org.simantics.sysdyn.ui.Activator; @@ -68,8 +66,7 @@ public class ImportMdlHandler extends AbstractHandler { Activator.getDefault().getPreferenceStore().setValue(IMPORTMDLTPATH, (new File(selected)).getParent()); // Convert Vensim model to Simantics SysDyn format using MdlParser - MdlParser2 parser = new MdlParser2(); - final Model2 model = parser.parse(file); + final Model2 model = MdlParser2.parse(file); SimanticsUI.getSession().asyncRequest(new WriteRequest() { diff --git a/dev-jkauttio/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/wizards/mdl/WizardMdlImportPage.java b/dev-jkauttio/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/wizards/mdl/WizardMdlImportPage.java index d29e7f9b..475ee264 100644 --- a/dev-jkauttio/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/wizards/mdl/WizardMdlImportPage.java +++ b/dev-jkauttio/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/wizards/mdl/WizardMdlImportPage.java @@ -23,8 +23,9 @@ import org.simantics.db.Resource; import org.simantics.db.WriteGraph; import org.simantics.db.common.request.WriteRequest; import org.simantics.db.exception.DatabaseException; -import org.simantics.sysdyn.modelImport.MdlParser; -import org.simantics.sysdyn.modelImport.model.Model; +import org.simantics.sysdyn.modelImport.MdlParser2; +import org.simantics.sysdyn.modelImport.model.Model2; +import org.simantics.sysdyn.modelImport.model.WriteContext; import org.simantics.ui.SimanticsUI; public class WizardMdlImportPage extends WizardPage{ @@ -178,13 +179,13 @@ public class WizardMdlImportPage extends WizardPage{ File file = new File(selected); - final Model model = MdlParser.parse(file); + final Model2 model = MdlParser2.parse(file); SimanticsUI.getSession().asyncRequest(new WriteRequest() { @Override public void perform(WriteGraph graph) throws DatabaseException { - model.write(graph, project); + model.write(graph, project, new WriteContext()); } }); diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlParser2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlParser2.java index 9dd6dbfb..abf8caf3 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlParser2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlParser2.java @@ -21,25 +21,25 @@ import java.util.HashMap; import org.simantics.sysdyn.modelImport.MdlUtils.CommentIcon; import org.simantics.sysdyn.modelImport.mdl.MdlModel; -import org.simantics.sysdyn.modelImport.mdl.Sketch2; +import org.simantics.sysdyn.modelImport.mdl.Sketch; import org.simantics.sysdyn.modelImport.mdl.SketchComment; import org.simantics.sysdyn.modelImport.mdl.SketchConnection; import org.simantics.sysdyn.modelImport.mdl.SketchElement; import org.simantics.sysdyn.modelImport.mdl.SketchObject; import org.simantics.sysdyn.modelImport.mdl.SketchValve; import org.simantics.sysdyn.modelImport.mdl.SketchVariable; +import org.simantics.sysdyn.modelImport.mdl.Subscript2; import org.simantics.sysdyn.modelImport.model.Model2; -import org.simantics.sysdyn.modelImport.model.element.Auxiliary2; -import org.simantics.sysdyn.modelImport.model.element.Cloud2; -import org.simantics.sysdyn.modelImport.model.element.Comment2; -import org.simantics.sysdyn.modelImport.model.element.Connection2; -import org.simantics.sysdyn.modelImport.model.element.Element2; -import org.simantics.sysdyn.modelImport.model.element.Shadow2; -import org.simantics.sysdyn.modelImport.model.element.Stock2; -import org.simantics.sysdyn.modelImport.model.element.Valve2; +import org.simantics.sysdyn.modelImport.model.element.Auxiliary; +import org.simantics.sysdyn.modelImport.model.element.Cloud; +import org.simantics.sysdyn.modelImport.model.element.Comment; +import org.simantics.sysdyn.modelImport.model.element.Connection; +import org.simantics.sysdyn.modelImport.model.element.Element; +import org.simantics.sysdyn.modelImport.model.element.Shadow; +import org.simantics.sysdyn.modelImport.model.element.Stock; +import org.simantics.sysdyn.modelImport.model.element.Valve; import org.simantics.sysdyn.modelImport.model.expression.IntegralExpression; -import org.simantics.sysdyn.modelImport.model.support.Subscript2; -import org.simantics.sysdyn.modelImport.model.support.Variable2; +import org.simantics.sysdyn.modelImport.model.support.Variable; public class MdlParser2 { @@ -74,7 +74,7 @@ public class MdlParser2 { // do this in several passes - HashMap variableToElement = new HashMap(); + HashMap variableToElement = new HashMap(); ArrayList shadows = new ArrayList(); for (Subscript2 ss : mdl.getSubscripts()) { @@ -82,13 +82,13 @@ public class MdlParser2 { } // add sketch labels and independent elements - for (Sketch2 sketch : mdl.getSketches()) { + for (Sketch sketch : mdl.getSketches()) { sketch.setEdges(); sketch.hOffset = 0; sketch.vOffset = 0 - sketch.topEdge + 10 + offset; - model.addElement(new Comment2(0, offset, -1, -1, sketch.getName())); + model.addElement(new Comment(0, offset, -1, -1, sketch.getName())); for (SketchComment comment : sketch.getComments()) { if (comment.isInputOutput()) { @@ -97,13 +97,13 @@ public class MdlParser2 { continue; } - Element2 modelElement = comment.getModelElement(sketch.hOffset, sketch.vOffset); + Element modelElement = comment.getModelElement(sketch.hOffset, sketch.vOffset); model.addElement(modelElement); sketch.elements.put(comment.getId(), modelElement); } for (SketchValve valve : sketch.getValves()) { - Element2 modelElement = valve.getModelElement(sketch.hOffset, sketch.vOffset); + Element modelElement = valve.getModelElement(sketch.hOffset, sketch.vOffset); model.addElement(modelElement); sketch.elements.put(valve.getId(), modelElement); sketch.elements.put(valve.getAttachedVariable().getId(), modelElement); @@ -121,7 +121,7 @@ public class MdlParser2 { continue; } - Element2 modelElement = variable.getModelElement(sketch.hOffset, sketch.vOffset); + Element modelElement = variable.getModelElement(sketch.hOffset, sketch.vOffset); model.addElement(modelElement); sketch.elements.put(variable.getId(), modelElement); variableToElement.put(variable.getVariable(), modelElement); @@ -131,16 +131,16 @@ public class MdlParser2 { } // add dependent elements - for (Sketch2 sketch : mdl.getSketches()) { + for (Sketch sketch : mdl.getSketches()) { for (SketchVariable variable : sketch.getVariables()) { if (!variable.allowsIn()) { // the variable is a shadow variable - Element2 original = variableToElement.get(variable.getVariable()); + Element original = variableToElement.get(variable.getVariable()); if (original == null) { System.err.println("original not found"); continue; } - Shadow2 modelElement = new Shadow2( + Shadow modelElement = new Shadow( variable.getSysdyndX() + sketch.hOffset, variable.getSysdyndY() + sketch.vOffset, variable.getSysdynWidth(), @@ -152,9 +152,9 @@ public class MdlParser2 { } for (SketchConnection connection : sketch.getConnections()) { - Element2 head = sketch.elements.get(connection.getTo()); - Element2 tail = sketch.elements.get(connection.getFrom()); - Connection2 c = connection.getWriteableConnection(head, tail, sketch.vOffset); + Element head = sketch.elements.get(connection.getTo()); + Element tail = sketch.elements.get(connection.getFrom()); + Connection c = connection.getWriteableConnection(head, tail, sketch.vOffset); if (c != null) { model.addConnection(c); } @@ -241,15 +241,15 @@ public class MdlParser2 { continue; } - Variable2 var = MdlUtils.getPossibleVariable(str, category); + Variable var = MdlUtils.getPossibleVariable(str, category); if (var != null) { mdl.addVariable(var, category); continue; } - Variable2 ss = MdlUtils.getPossibleSubscriptVariable(str, category, mdl); + Variable ss = MdlUtils.getPossibleSubscriptVariable(str, category, mdl); if (ss != null) { - Variable2 original = mdl.getVariable(ss.getName()); + Variable original = mdl.getVariable(ss.getName()); if (original == null) { mdl.addVariable(ss, category); } @@ -259,13 +259,13 @@ public class MdlParser2 { continue; } - Variable2 lu = MdlUtils.getPossibleLookUpVariable(str, category); + Variable lu = MdlUtils.getPossibleLookUpVariable(str, category); if (lu != null) { System.err.println("found lookup variable "+lu.getName()); continue; } - Variable2 plain = MdlUtils.getPossibleNoExpressionVariable(str); + Variable plain = MdlUtils.getPossibleNoExpressionVariable(str); if (plain != null) { System.err.println("found plain variable "+plain.getName()); continue; @@ -286,7 +286,7 @@ public class MdlParser2 { private static String parseSketches(BufferedReader reader, String line, MdlModel mdl) throws IOException { - Sketch2 sketch = null; + Sketch sketch = null; do { if (line.isEmpty()) @@ -295,7 +295,7 @@ public class MdlParser2 { SketchObject so; if (line.startsWith(SKETCH_START)) { - sketch = new Sketch2(); + sketch = new Sketch(); mdl.addSketch(sketch); } else if (line.startsWith(SKETCH_VERSION)) { diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlUtils.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlUtils.java index 223c4d69..6bce7af0 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlUtils.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/MdlUtils.java @@ -9,7 +9,8 @@ import org.simantics.sysdyn.modelImport.mdl.SketchConnection; import org.simantics.sysdyn.modelImport.mdl.SketchElement; import org.simantics.sysdyn.modelImport.mdl.SketchValve; import org.simantics.sysdyn.modelImport.mdl.SketchVariable; -import org.simantics.sysdyn.modelImport.model.element.Valve2.TextPosition; +import org.simantics.sysdyn.modelImport.mdl.Subscript2; +import org.simantics.sysdyn.modelImport.model.element.Valve.TextPosition; import org.simantics.sysdyn.modelImport.model.expression.DelayExpression; import org.simantics.sysdyn.modelImport.model.expression.IExpression; import org.simantics.sysdyn.modelImport.model.expression.IntegralExpression; @@ -17,8 +18,7 @@ import org.simantics.sysdyn.modelImport.model.expression.LookupExpression; import org.simantics.sysdyn.modelImport.model.expression.NormalExpression; import org.simantics.sysdyn.modelImport.model.expression.SubscriptExpression; import org.simantics.sysdyn.modelImport.model.support.Range; -import org.simantics.sysdyn.modelImport.model.support.Subscript2; -import org.simantics.sysdyn.modelImport.model.support.Variable2; +import org.simantics.sysdyn.modelImport.model.support.Variable; public class MdlUtils { @@ -63,7 +63,7 @@ public class MdlUtils { private static final int variableUnit = 3; private static final int variableDesc = 4; - public static Variable2 getPossibleVariable(String line, String category) { + public static Variable getPossibleVariable(String line, String category) { Matcher matcher = Pattern.compile(variablePattern).matcher(line); if (!matcher.matches()) { @@ -80,7 +80,7 @@ public class MdlUtils { } String description = matcher.group(variableDesc); - return new Variable2(name, expression, unit, range, description); + return new Variable(name, expression, unit, range, description); } // a subscript variable is a variable that has a different equation @@ -100,7 +100,7 @@ public class MdlUtils { private static final int subscriptVariableUnit = 4; private static final int subscriptVariableDesc = 5; - public static Variable2 getPossibleSubscriptVariable(String line, String category, MdlModel mdl) { + public static Variable getPossibleSubscriptVariable(String line, String category, MdlModel mdl) { Matcher matcher = Pattern.compile(subscriptVariablePattern).matcher(line); if (!matcher.matches()) { @@ -121,7 +121,7 @@ public class MdlUtils { } String description = matcher.group(subscriptVariableDesc); - return new Variable2(name, e, unit, range, description); + return new Variable(name, e, unit, range, description); } private static final String LOOKUP_NAME = @@ -146,7 +146,7 @@ public class MdlUtils { private static final int lookupVariableUnit = 7; private static final int lookupVariableDesc = 8; - public static Variable2 getPossibleLookUpVariable(String line, String category) { + public static Variable getPossibleLookUpVariable(String line, String category) { Matcher matcher = Pattern.compile(lookupVariablePattern).matcher(line); if (!matcher.matches()) { @@ -169,7 +169,7 @@ public class MdlUtils { } String description = matcher.group(lookupVariableDesc); - return new Variable2(name, e, unit, range, description); + return new Variable(name, e, unit, range, description); } public static final String NO_EXP_PATTERN = @@ -182,7 +182,7 @@ public class MdlUtils { private static final int noExpVariableUnit = 2; private static final int noExpVariableDesc = 3; - public static Variable2 getPossibleNoExpressionVariable(String line) { + public static Variable getPossibleNoExpressionVariable(String line) { Matcher matcher = Pattern.compile(noExpressionVariablePattern).matcher(line); if (!matcher.matches()) { @@ -198,7 +198,7 @@ public class MdlUtils { } String description = matcher.group(noExpVariableDesc); - return new Variable2(name, null, unit, range, description); + return new Variable(name, null, unit, range, description); } private static final String SUBSCRIPT_PATTERN = @@ -376,7 +376,7 @@ public class MdlUtils { } int id = Integer.parseInt(matcher.group(elementId)); - Variable2 var = mdl.getVariable((normalize(matcher.group(elementName)))); + Variable var = mdl.getVariable((normalize(matcher.group(elementName)))); SketchVariable variable = new SketchVariable(id, var); diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/MdlModel.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/MdlModel.java index 3677ec77..43fc4ce9 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/MdlModel.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/MdlModel.java @@ -5,29 +5,28 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; -import org.simantics.sysdyn.modelImport.model.support.Subscript2; -import org.simantics.sysdyn.modelImport.model.support.Variable2; +import org.simantics.sysdyn.modelImport.model.support.Variable; public class MdlModel { private String name; - private HashMap variables; - private HashMap> groups; + private HashMap variables; + private HashMap> groups; private HashMap subscripts; - private ArrayList sketches; + private ArrayList sketches; public MdlModel(String name) { this.name = name; - this.variables = new HashMap(); - this.groups = new HashMap>(); + this.variables = new HashMap(); + this.groups = new HashMap>(); this.subscripts = new HashMap(); - this.sketches = new ArrayList(); + this.sketches = new ArrayList(); } - public void addVariable(Variable2 variable, String group) { + public void addVariable(Variable variable, String group) { if (variables.get(variable.getName()) != null) { System.err.println("warning, duplicate variable "+variable.getName()); } @@ -36,18 +35,18 @@ public class MdlModel { if (group != null) { if (groups.get(group) == null) { - groups.put(group, new ArrayList()); + groups.put(group, new ArrayList()); } groups.get(group).add(variable); } } - public Variable2 getVariable(String name) { + public Variable getVariable(String name) { return variables.get(name); } - public List getVariables() { - return new ArrayList(variables.values()); + public List getVariables() { + return new ArrayList(variables.values()); } public void addSubscript(Subscript2 subscript) { @@ -62,11 +61,11 @@ public class MdlModel { return new ArrayList(subscripts.values()); } - public void addSketch(Sketch2 sketch) { + public void addSketch(Sketch sketch) { sketches.add(sketch); } - public List getSketches() { + public List getSketches() { return sketches; } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/Sketch2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/Sketch.java 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 b75d3741..471f5f84 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/Sketch2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/Sketch.java @@ -4,9 +4,9 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import org.simantics.sysdyn.modelImport.model.element.Element2; +import org.simantics.sysdyn.modelImport.model.element.Element; -public class Sketch2 { +public class Sketch { private String name; @@ -15,7 +15,7 @@ public class Sketch2 { private ArrayList valves; private ArrayList variables; - public Sketch2() { + public Sketch() { comments = new ArrayList(); connections = new ArrayList(); valves = new ArrayList(); @@ -81,7 +81,7 @@ public class Sketch2 { public double leftEdge = 0; public double rightEdge = 0; - public HashMap elements = new HashMap(); + public HashMap elements = new HashMap(); public void setEdges() { boolean first = true; diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchComment.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchComment.java index fe3c4110..20c5ff7d 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchComment.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchComment.java @@ -1,9 +1,9 @@ package org.simantics.sysdyn.modelImport.mdl; import org.simantics.sysdyn.modelImport.MdlUtils.CommentIcon; -import org.simantics.sysdyn.modelImport.model.element.Cloud2; -import org.simantics.sysdyn.modelImport.model.element.Comment2; -import org.simantics.sysdyn.modelImport.model.element.Element2; +import org.simantics.sysdyn.modelImport.model.element.Cloud; +import org.simantics.sysdyn.modelImport.model.element.Comment; +import org.simantics.sysdyn.modelImport.model.element.Element; public class SketchComment extends SketchElement { @@ -27,16 +27,16 @@ public class SketchComment extends SketchElement { return icon; } - public Element2 getModelElement(double hOffset, double vOffset) { + public Element getModelElement(double hOffset, double vOffset) { if (icon.equals(CommentIcon.CLOUD)) { - return new Cloud2( + return new Cloud( getSysdyndX() + hOffset, getSysdyndY() + vOffset, getSysdynWidth(), getSysdynHeight()); } else { - return new Comment2( + return new Comment( getSysdyndX() + hOffset, getSysdyndY() + vOffset, getSysdynWidth(), diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchConnection.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchConnection.java index c0828b76..ed5d0691 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchConnection.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchConnection.java @@ -1,10 +1,10 @@ package org.simantics.sysdyn.modelImport.mdl; import org.simantics.sysdyn.modelImport.MdlUtils.ConnectionType; -import org.simantics.sysdyn.modelImport.model.element.Connection2; -import org.simantics.sysdyn.modelImport.model.element.Dependency2; -import org.simantics.sysdyn.modelImport.model.element.Element2; -import org.simantics.sysdyn.modelImport.model.element.Flow2; +import org.simantics.sysdyn.modelImport.model.element.Connection; +import org.simantics.sysdyn.modelImport.model.element.Dependency; +import org.simantics.sysdyn.modelImport.model.element.Element; +import org.simantics.sysdyn.modelImport.model.element.Flow; public class SketchConnection extends SketchObject { @@ -33,22 +33,22 @@ public class SketchConnection extends SketchObject { return type; } - public Connection2 getWriteableConnection(Element2 head, Element2 tail, double offset) { + public Connection getWriteableConnection(Element head, Element tail, double offset) { if (type.equals(ConnectionType.ARROW)) { - return new Dependency2(head, tail, false, false, getSysdynAngle(tail, head, offset)); + return new Dependency(head, tail, false, false, getSysdynAngle(tail, head, offset)); } else if (type.equals(ConnectionType.LINE_ARROW)) { - return new Flow2(head, tail); + return new Flow(head, tail); } else if (type.equals(ConnectionType.LINE_SEGMENT)) { // TODO: what is this I don't even... - return new Flow2(tail, head); + return new Flow(tail, head); } return null; } // TODO: comment this? - public double getSysdynAngle(Element2 from, Element2 to, double voffset) { + public double getSysdynAngle(Element from, Element to, double voffset) { if (points == null || points.length == 0) { return 0; } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchElement.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchElement.java index 974751e2..1220b61c 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchElement.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchElement.java @@ -1,6 +1,6 @@ package org.simantics.sysdyn.modelImport.mdl; -import org.simantics.sysdyn.modelImport.model.element.Element2; +import org.simantics.sysdyn.modelImport.model.element.Element; public abstract class SketchElement extends SketchObject { @@ -105,6 +105,6 @@ public abstract class SketchElement extends SketchObject { return textLine; } - public abstract Element2 getModelElement(double hOffset, double vOffset); + public abstract Element getModelElement(double hOffset, double vOffset); } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchValve.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchValve.java index 71161285..ee5bd15a 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchValve.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchValve.java @@ -1,8 +1,8 @@ package org.simantics.sysdyn.modelImport.mdl; -import org.simantics.sysdyn.modelImport.model.element.Element2; -import org.simantics.sysdyn.modelImport.model.element.Valve2; -import org.simantics.sysdyn.modelImport.model.element.Valve2.TextPosition; +import org.simantics.sysdyn.modelImport.model.element.Element; +import org.simantics.sysdyn.modelImport.model.element.Valve; +import org.simantics.sysdyn.modelImport.model.element.Valve.TextPosition; public class SketchValve extends SketchElement { @@ -23,8 +23,8 @@ public class SketchValve extends SketchElement { } @Override - public Element2 getModelElement(double hOffset, double vOffset) { - return new Valve2( + public Element getModelElement(double hOffset, double vOffset) { + return new Valve( getSysdyndX() + hOffset, getSysdyndY() + vOffset, getSysdynWidth(), diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchVariable.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchVariable.java index c24791a0..fe1a375f 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchVariable.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/SketchVariable.java @@ -1,28 +1,28 @@ package org.simantics.sysdyn.modelImport.mdl; -import org.simantics.sysdyn.modelImport.model.element.Auxiliary2; -import org.simantics.sysdyn.modelImport.model.element.Element2; -import org.simantics.sysdyn.modelImport.model.element.Stock2; +import org.simantics.sysdyn.modelImport.model.element.Auxiliary; +import org.simantics.sysdyn.modelImport.model.element.Element; +import org.simantics.sysdyn.modelImport.model.element.Stock; import org.simantics.sysdyn.modelImport.model.expression.IntegralExpression; -import org.simantics.sysdyn.modelImport.model.support.Variable2; +import org.simantics.sysdyn.modelImport.model.support.Variable; public class SketchVariable extends SketchElement { - private Variable2 variable; + private Variable variable; - public SketchVariable(int id, Variable2 variable) { + public SketchVariable(int id, Variable variable) { super(id); this.variable = variable; } - public Variable2 getVariable() { + public Variable getVariable() { return variable; } @Override - public Element2 getModelElement(double hOffset, double vOffset) { + public Element getModelElement(double hOffset, double vOffset) { if (variable.getExpression() instanceof IntegralExpression) { - return new Stock2( + return new Stock( getSysdyndX() + hOffset, getSysdyndY() + vOffset, getSysdynWidth(), @@ -30,7 +30,7 @@ public class SketchVariable extends SketchElement { variable); } else { - return new Auxiliary2( + return new Auxiliary( getSysdyndX() + hOffset, getSysdyndY() + vOffset, getSysdynWidth(), diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Subscript2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/Subscript2.java similarity index 85% rename from dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Subscript2.java rename to dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/Subscript2.java index 4f53a925..dddcc7b4 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Subscript2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/mdl/Subscript2.java @@ -1,4 +1,4 @@ -package org.simantics.sysdyn.modelImport.model.support; +package org.simantics.sysdyn.modelImport.mdl; import java.util.ArrayList; import java.util.Arrays; diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/Model2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/Model2.java index b4121b12..bdc5a19f 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/Model2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/Model2.java @@ -24,11 +24,11 @@ import org.simantics.diagram.stubs.DiagramResource; import org.simantics.layer0.Layer0; import org.simantics.modeling.ModelingResources; import org.simantics.simulation.ontology.SimulationResource; -import org.simantics.sysdyn.modelImport.model.element.Connection2; -import org.simantics.sysdyn.modelImport.model.element.Element2; +import org.simantics.sysdyn.modelImport.model.element.Connection; +import org.simantics.sysdyn.modelImport.model.element.Element; import org.simantics.sysdyn.modelImport.model.element.ModelVariable; -import org.simantics.sysdyn.modelImport.model.element.Shadow2; -import org.simantics.sysdyn.modelImport.model.support.Enumeration2; +import org.simantics.sysdyn.modelImport.model.element.Shadow; +import org.simantics.sysdyn.modelImport.model.support.Enumeration; import org.simantics.sysdyn.utils.ModelUtils; public class Model2 implements IWriteableObject { @@ -38,22 +38,22 @@ public class Model2 implements IWriteableObject { private double start, stop, step; // the structure of the model - private HashMap enumerations; + private HashMap enumerations; private HashMap variables; - private ArrayList elements; - private ArrayList shadows; - private ArrayList connections; + private ArrayList elements; + private ArrayList shadows; + private ArrayList connections; public Model2(String name) { this.name = name; - enumerations = new HashMap(); + enumerations = new HashMap(); variables = new HashMap(); - elements = new ArrayList(); - shadows = new ArrayList(); - connections = new ArrayList(); + elements = new ArrayList(); + shadows = new ArrayList(); + connections = new ArrayList(); } public double getStart() { @@ -80,18 +80,18 @@ public class Model2 implements IWriteableObject { this.step = step; } - public void addEnumeration(Enumeration2 enumeration) { + public void addEnumeration(Enumeration enumeration) { if (enumerations.get(enumeration.getName()) != null) { System.err.println("enumeration "+enumeration.getName()+" already defined"); } enumerations.put(enumeration.getName(), enumeration); } - public Enumeration2 getEnumeration(String name) { + public Enumeration getEnumeration(String name) { return enumerations.get(name); } - public Collection getEnumerations() { + public Collection getEnumerations() { return enumerations.values(); } @@ -112,15 +112,15 @@ public class Model2 implements IWriteableObject { return variables.values(); } - public void addElement(Element2 element) { + public void addElement(Element element) { elements.add(element); } - public void addShadow(Shadow2 shadow) { + public void addShadow(Shadow shadow) { shadows.add(shadow); } - public void addConnection(Connection2 connection) { + public void addConnection(Connection connection) { connections.add(connection); } @@ -138,19 +138,19 @@ public class Model2 implements IWriteableObject { Resource configuration = graph.getSingleObject(model, sim.HasConfiguration); - for (Enumeration2 e : getEnumerations()) { + for (Enumeration e : getEnumerations()) { e.write(graph, configuration, context); } - for (Element2 e : elements) { + for (Element e : elements) { e.write(graph, configuration, context); } - for (Shadow2 s : shadows) { + for (Shadow s : shadows) { s.write(graph, configuration, context); } - for (Connection2 c : connections) { + for (Connection c : connections) { c.write(graph, configuration, context); } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Auxiliary2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Auxiliary.java 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 f1dbf8e4..3e2654fa 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Auxiliary2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Auxiliary.java @@ -7,16 +7,16 @@ import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.modelImport.model.WriteContext; import org.simantics.sysdyn.modelImport.model.expression.IExpression; import org.simantics.sysdyn.modelImport.model.support.Range; -import org.simantics.sysdyn.modelImport.model.support.Variable2; +import org.simantics.sysdyn.modelImport.model.support.Variable; -public class Auxiliary2 extends ModelVariable { +public class Auxiliary extends ModelVariable { - public Auxiliary2(double x, double y, double w, double h, + public Auxiliary(double x, double y, double w, double h, String name, IExpression expression, Range range, String unit, String description) { super(x, y, w, h, name, expression, range, unit, description); } - public Auxiliary2(double x, double y, double w, double h, Variable2 variable) { + public Auxiliary(double x, double y, double w, double h, Variable variable) { super(x, y, w, h, variable); } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Cloud2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Cloud.java 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 f8813db7..1aba2584 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Cloud2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Cloud.java @@ -8,9 +8,9 @@ import org.simantics.layer0.utils.direct.GraphUtils; import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.modelImport.model.WriteContext; -public class Cloud2 extends Element2 { +public class Cloud extends Element { - public Cloud2(double x, double y, double w, double h) { + public Cloud(double x, double y, double w, double h) { super(x, y, w, h); } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Comment2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Comment.java 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 72b18b2f..264ec411 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Comment2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Comment.java @@ -10,11 +10,11 @@ import org.simantics.layer0.utils.direct.GraphUtils; import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.modelImport.model.WriteContext; -public class Comment2 extends Element2 { +public class Comment extends Element { private String text; - public Comment2(double x, double y, double w, double h, String text) { + public Comment(double x, double y, double w, double h, String text) { super(x, y, w, h); this.text = text; } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Connection2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Connection.java 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 e39b8c38..00119d31 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Connection2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Connection.java @@ -13,12 +13,12 @@ import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.modelImport.model.IWriteableObject; import org.simantics.sysdyn.modelImport.model.WriteContext; -public abstract class Connection2 implements IWriteableObject { +public abstract class Connection implements IWriteableObject { - protected Element2 head; - protected Element2 tail; + protected Element head; + protected Element tail; - public Connection2(Element2 head, Element2 tail) { + public Connection(Element head, Element tail) { this.head = head; this.tail = tail; } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Dependency2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Dependency.java 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 576402bf..3fab1e5c 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Dependency2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Dependency.java @@ -8,13 +8,13 @@ import org.simantics.layer0.Layer0; import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.modelImport.model.WriteContext; -public class Dependency2 extends Connection2 { +public class Dependency extends Connection { private boolean showArrow; private boolean showDelay; private double angle; - public Dependency2(Element2 head, Element2 tail, boolean showArrow, boolean showDelay, double angle) { + public Dependency(Element head, Element tail, boolean showArrow, boolean showDelay, double angle) { super(head, tail); this.showArrow = showArrow; this.showDelay = showDelay; diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Element2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Element.java 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 7680f9da..8baf0a2a 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Element2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Element.java @@ -14,7 +14,7 @@ import org.simantics.sysdyn.modelImport.mdl.SketchElement; import org.simantics.sysdyn.modelImport.model.IWriteableObject; import org.simantics.sysdyn.modelImport.model.WriteContext; -public abstract class Element2 implements IWriteableObject { +public abstract class Element implements IWriteableObject { private double x; private double y; @@ -23,14 +23,14 @@ public abstract class Element2 implements IWriteableObject { private Resource resource; - public Element2(double x, double y, double width, double height) { + public Element(double x, double y, double width, double height) { this.x = x; this.y = y; this.width = width; this.height = height; } - public Element2(SketchElement element, double hOffset, double vOffset) { + public Element(SketchElement element, double hOffset, double vOffset) { this.x = element.getSysdyndX() + hOffset; this.y = element.getSysdyndY() + vOffset; this.width = element.getSysdynWidth(); diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Flow2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Flow.java 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 84fb5d75..1b40f2fc 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Flow2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Flow.java @@ -8,9 +8,9 @@ import org.simantics.layer0.Layer0; import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.modelImport.model.WriteContext; -public class Flow2 extends Connection2 { +public class Flow extends Connection { - public Flow2(Element2 head, Element2 tail) { + public Flow(Element head, Element tail) { super(head, tail); } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/ModelVariable.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/ModelVariable.java index 4b0dc58c..fd669dc6 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/ModelVariable.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/ModelVariable.java @@ -12,11 +12,11 @@ import org.simantics.modeling.ModelingResources; import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.modelImport.model.WriteContext; import org.simantics.sysdyn.modelImport.model.expression.IExpression; -import org.simantics.sysdyn.modelImport.model.support.Enumeration2; +import org.simantics.sysdyn.modelImport.model.support.Enumeration; import org.simantics.sysdyn.modelImport.model.support.Range; -import org.simantics.sysdyn.modelImport.model.support.Variable2; +import org.simantics.sysdyn.modelImport.model.support.Variable; -public abstract class ModelVariable extends Element2 { +public abstract class ModelVariable extends Element { protected String name; protected IExpression expression; @@ -24,7 +24,7 @@ public abstract class ModelVariable extends Element2 { protected String unit; protected String description; - protected List enumerations; + protected List enumerations; public ModelVariable(double x, double y, double w, double h, String name, IExpression expression, Range range, String unit, String description) { super(x, y, w, h); @@ -35,7 +35,7 @@ public abstract class ModelVariable extends Element2 { this.description = description; } - public ModelVariable(double x, double y, double w, double h, Variable2 variable) { + public ModelVariable(double x, double y, double w, double h, Variable variable) { super(x, y, w, h); this.name = variable.getName(); this.expression = variable.getExpression(); diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Shadow2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Shadow.java 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 00509634..b699fa9e 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Shadow2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Shadow.java @@ -9,16 +9,16 @@ import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.modelImport.mdl.SketchVariable; import org.simantics.sysdyn.modelImport.model.WriteContext; -public class Shadow2 extends Element2 { +public class Shadow extends Element { - private Element2 original; + private Element original; - public Shadow2(double x, double y, double w, double h, Element2 original) { + public Shadow(double x, double y, double w, double h, Element original) { super(x, y, w, h); this.original = original; } - public Shadow2(SketchVariable variable, double hOffset, double vOffset, Element2 original) { + public Shadow(SketchVariable variable, double hOffset, double vOffset, Element original) { super(variable, hOffset, vOffset); this.original = original; } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Stock2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Stock.java 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 0078f4fc..3c958ec1 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Stock2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Stock.java @@ -7,16 +7,16 @@ import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.modelImport.model.WriteContext; import org.simantics.sysdyn.modelImport.model.expression.IntegralExpression; import org.simantics.sysdyn.modelImport.model.support.Range; -import org.simantics.sysdyn.modelImport.model.support.Variable2; +import org.simantics.sysdyn.modelImport.model.support.Variable; -public class Stock2 extends ModelVariable { +public class Stock extends ModelVariable { - public Stock2(double x, double y, double w, double h, + public Stock(double x, double y, double w, double h, String name, IntegralExpression expression, Range range, String unit, String description) { super(x, y, w, h, name, expression, range, unit, description); } - public Stock2(double x, double y, double w, double h, Variable2 variable) { + public Stock(double x, double y, double w, double h, Variable variable) { super(x, y, w, h, variable); } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Valve2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Valve.java 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 cc0442c7..559eff52 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Valve2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/element/Valve.java @@ -7,9 +7,9 @@ import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.modelImport.model.WriteContext; import org.simantics.sysdyn.modelImport.model.expression.IExpression; import org.simantics.sysdyn.modelImport.model.support.Range; -import org.simantics.sysdyn.modelImport.model.support.Variable2; +import org.simantics.sysdyn.modelImport.model.support.Variable; -public class Valve2 extends ModelVariable { +public class Valve extends ModelVariable { public enum Orientation { HORIZONTAL, VERTICAL @@ -21,13 +21,13 @@ public class Valve2 extends ModelVariable { private TextPosition position; - public Valve2(double x, double y, double w, double h, + public Valve(double x, double y, double w, double h, String name, IExpression expression, Range range, String unit, String description, TextPosition position) { super(x, y, w, h, name, expression, range, unit, description); this.position = position; } - public Valve2(double x, double y, double w, double h, Variable2 variable, TextPosition position) { + public Valve(double x, double y, double w, double h, Variable variable, TextPosition position) { super(x, y, w, h, variable); this.position = position; } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Enumeration2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Enumeration.java 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 4f31cb0c..feb0f801 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Enumeration2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Enumeration.java @@ -8,14 +8,14 @@ import org.simantics.db.exception.DatabaseException; import org.simantics.sysdyn.modelImport.model.IWriteableObject; import org.simantics.sysdyn.modelImport.model.WriteContext; -public class Enumeration2 implements IWriteableObject { +public class Enumeration implements IWriteableObject { private String name; private ArrayList values; private Resource resource; - public Enumeration2(String name, ArrayList values) { + public Enumeration(String name, ArrayList values) { this.name = name; this.values = values; } diff --git a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Variable2.java b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Variable.java 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 fbcc18e3..63969c01 100644 --- a/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Variable2.java +++ b/dev-jkauttio/org.simantics.sysdyn/src/org/simantics/sysdyn/modelImport/model/support/Variable.java @@ -3,7 +3,7 @@ package org.simantics.sysdyn.modelImport.model.support; import org.simantics.sysdyn.modelImport.model.expression.IExpression; import org.simantics.sysdyn.modelImport.model.expression.SubscriptExpression; -public class Variable2 { +public class Variable { private String name; private IExpression expression; @@ -11,7 +11,7 @@ public class Variable2 { private Range range; private String description; - public Variable2(String name, IExpression expression, String unit, Range range, String description) { + public Variable(String name, IExpression expression, String unit, Range range, String description) { this.name = name; this.expression = expression; this.unit = unit; @@ -39,7 +39,7 @@ public class Variable2 { return description; } - public void mergeExpression(Variable2 variable) { + public void mergeExpression(Variable variable) { if (expression instanceof SubscriptExpression) { ((SubscriptExpression)expression).merge((SubscriptExpression)variable.getExpression()); }