--- /dev/null
+package org.simantics.objmap.rules.adapters;\r
+\r
+public enum IdentityAdapter implements ValueAdapter {\r
+ INSTANCE;\r
+\r
+ @Override\r
+ public Object domainToRange(Object domainValue) {\r
+ return domainValue;\r
+ }\r
+\r
+ @Override\r
+ public Object rangeToDomain(Object rangeValue) {\r
+ return rangeValue;\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.objmap.rules.adapters;\r
+\r
+public interface ValueAdapter {\r
+ Object domainToRange(Object domainValue);\r
+ Object rangeToDomain(Object rangeValue);\r
+}\r
--- /dev/null
+package org.simantics.objmap.rules.range;\r
+\r
+import org.simantics.objmap.MappingException;\r
+import org.simantics.objmap.rules.adapters.ValueAdapter;\r
+\r
+public class AdaptedRangeAccessor implements IRangeAccessor<Object> {\r
+ IRangeAccessor<Object> baseAccessor;\r
+ ValueAdapter adapter;\r
+ \r
+ public AdaptedRangeAccessor(IRangeAccessor<Object> baseAccessror,\r
+ ValueAdapter adapter) {\r
+ this.baseAccessor = baseAccessror;\r
+ this.adapter = adapter;\r
+ }\r
+\r
+ @Override\r
+ public Object get(Object element) throws MappingException {\r
+ return adapter.rangeToDomain(baseAccessor.get(element)); \r
+ }\r
+ \r
+ @Override\r
+ public boolean set(Object element, Object value) throws MappingException {\r
+ return baseAccessor.set(element, adapter.domainToRange(value));\r
+ }\r
+}\r
import org.simantics.db.request.Read;\r
import org.simantics.graph.representation.TransferableGraph1;\r
import org.simantics.layer0.Layer0;\r
+import org.simantics.sysdyn.ui.Activator;\r
import org.simantics.ui.SimanticsUI;\r
import org.simantics.ui.utils.ResourceAdaptionUtils;\r
import org.simantics.utils.datastructures.Pair;\r
\r
Shell shell = HandlerUtil.getActiveShellChecked(event);\r
FileDialog fd = new FileDialog(shell, SWT.SAVE);\r
- fd.setText("Export..");\r
+ fd.setText("Export Function Library");\r
fd.setFileName(name);\r
- fd.setFilterPath(Platform.getLocation().toOSString());\r
+ String path = Activator.getDefault().getPreferenceStore().getString(ImportFunctionLibrary.IMPORTFUNCTIONLIBRARYPATH);\r
+ if(path.isEmpty() || !(new File(path).exists()))\r
+ path = Platform.getLocation().toOSString();\r
+ fd.setFilterPath(path);\r
String[] filterExt = {"*.tg"};\r
fd.setFilterExtensions(filterExt);\r
final String selected = fd.open();\r
if(selected == null) return null;\r
\r
- \r
+ Activator.getDefault().getPreferenceStore().setValue(ImportFunctionLibrary.IMPORTFUNCTIONLIBRARYPATH, (new File(selected)).getParent());\r
+\r
SimanticsUI.getSession().asyncRequest(new ReadRequest() {\r
\r
@Override\r
import org.simantics.db.request.Read;\r
import org.simantics.graph.representation.TransferableGraph1;\r
import org.simantics.layer0.Layer0;\r
+import org.simantics.sysdyn.ui.Activator;\r
import org.simantics.ui.SimanticsUI;\r
import org.simantics.ui.utils.ResourceAdaptionUtils;\r
import org.simantics.utils.datastructures.Pair;\r
\r
Shell shell = HandlerUtil.getActiveShellChecked(event);\r
FileDialog fd = new FileDialog(shell, SWT.SAVE);\r
- fd.setText("Export..");\r
+ fd.setText("Export Model");\r
fd.setFileName(name);\r
- fd.setFilterPath(Platform.getLocation().toOSString());\r
+ String path = Activator.getDefault().getPreferenceStore().getString(ImportModelHandler.IMPORTMODELTPATH);\r
+ if(path.isEmpty() || !(new File(path).exists()))\r
+ path = Platform.getLocation().toOSString();\r
+ fd.setFilterPath(path);\r
String[] filterExt = {"*.tg"};\r
fd.setFilterExtensions(filterExt);\r
final String selected = fd.open();\r
if(selected == null) return null;\r
\r
+ Activator.getDefault().getPreferenceStore().setValue(ImportModelHandler.IMPORTMODELTPATH, (new File(selected)).getParent());\r
\r
SimanticsUI.getSession().asyncRequest(new ReadRequest() {\r
\r
import org.simantics.modeling.ModelingResources;\r
import org.simantics.structural.stubs.StructuralResource2;\r
import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.ui.Activator;\r
import org.simantics.ui.SimanticsUI;\r
import org.simantics.ui.utils.ResourceAdaptionUtils;\r
import org.simantics.utils.datastructures.Pair;\r
\r
Shell shell = HandlerUtil.getActiveShellChecked(event);\r
FileDialog fd = new FileDialog(shell, SWT.SAVE);\r
- fd.setText("Export..");\r
+ fd.setText("Export Module");\r
fd.setFileName(name);\r
- fd.setFilterPath(Platform.getLocation().toOSString());\r
+ String path = Activator.getDefault().getPreferenceStore().getString(ImportModuleHandler.IMPORTMODULETPATH);\r
+ if(path.isEmpty() || !(new File(path).exists()))\r
+ path = Platform.getLocation().toOSString();\r
+ fd.setFilterPath(path);\r
String[] filterExt = {"*.tg"};\r
fd.setFilterExtensions(filterExt);\r
final String selected = fd.open();\r
if(selected == null) return null;\r
\r
+ Activator.getDefault().getPreferenceStore().setValue(ImportModuleHandler.IMPORTMODULETPATH, (new File(selected)).getParent());\r
\r
SimanticsUI.getSession().asyncRequest(new ReadRequest() {\r
\r
import org.eclipse.jface.viewers.ISelection;\r
import org.eclipse.swt.SWT;\r
import org.eclipse.swt.widgets.FileDialog;\r
+import org.eclipse.swt.widgets.MessageBox;\r
import org.eclipse.swt.widgets.Shell;\r
import org.eclipse.ui.handlers.HandlerUtil;\r
import org.simantics.databoard.Bindings;\r
import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
import org.simantics.db.WriteOnlyGraph;\r
-import org.simantics.db.common.request.ReadRequest;\r
import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.exception.ResourceNotFoundException;\r
import org.simantics.db.layer0.adapter.impl.DefaultPasteHandler;\r
import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.sysdyn.manager.FunctionUtils;\r
+import org.simantics.sysdyn.ui.Activator;\r
import org.simantics.sysdyn.ui.browser.nodes.FunctionsFolder;\r
import org.simantics.ui.SimanticsUI;\r
import org.simantics.ui.utils.AdaptionUtils;\r
import org.simantics.ui.utils.ResourceAdaptionUtils;\r
\r
public class ImportFunctionLibrary extends AbstractHandler {\r
+ \r
+ public static String IMPORTFUNCTIONLIBRARYPATH = "IMPORT_FUNCTION_LIBRARY_PATH";\r
\r
@Override\r
public Object execute(ExecutionEvent event) throws ExecutionException {\r
\r
final Resource functionLibrary = r;\r
\r
- Shell shell = HandlerUtil.getActiveShellChecked(event);\r
+ final Shell shell = HandlerUtil.getActiveShellChecked(event);\r
FileDialog fd = new FileDialog(shell, SWT.OPEN);\r
fd.setText("Import Function Library");\r
- fd.setFilterPath(Platform.getLocation().toOSString());\r
+ \r
+ String path = Activator.getDefault().getPreferenceStore().getString(IMPORTFUNCTIONLIBRARYPATH);\r
+ if(path.isEmpty() || !(new File(path).exists()))\r
+ path = Platform.getLocation().toOSString();\r
+ fd.setFilterPath(path);\r
String[] filterExt = {"*.tg"};\r
fd.setFilterExtensions(filterExt);\r
String selected = fd.open();\r
if(selected == null) return null;\r
\r
+ Activator.getDefault().getPreferenceStore().setValue(IMPORTFUNCTIONLIBRARYPATH, (new File(selected)).getParent());\r
+ \r
TransferableGraph1 tg = null;\r
try {\r
tg = (TransferableGraph1)Files.readFile(new File(selected), Bindings.getBindingUnchecked(TransferableGraph1.class));\r
} catch (RuntimeBindingConstructionException e) {\r
e.printStackTrace();\r
+ return null;\r
} catch (IOException e) {\r
- e.printStackTrace();\r
- }\r
+ MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ERROR);\r
+ mb.setText("Error");\r
+ mb.setMessage("The imported file is not of type: Function Library");\r
+ mb.open();\r
+ return null;\r
+ } \r
if(tg == null) return null;\r
\r
\r
e.printStackTrace();\r
}\r
\r
- SimanticsUI.getSession().asyncRequest(new ReadRequest() {\r
+ final Resource root = ia.getRoot();\r
+ \r
+ SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
\r
@Override\r
- public void run(ReadGraph graph) throws DatabaseException {\r
- FunctionUtils.updateFunctionFileForLibrary(graph, functionLibrary);\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ if(!graph.isInstanceOf(root, SysdynResource.getInstance(graph).SysdynModelicaFunctionLibrary)) {\r
+ Resource instanceOf = graph.getPossibleObject(root, Layer0.getInstance(graph).InstanceOf);\r
+ String type = "...";\r
+ if(instanceOf != null)\r
+ type = NameUtils.getSafeName(graph, instanceOf);\r
+ else {\r
+ Resource inheritedFrom = graph.getPossibleObject(root, Layer0.getInstance(graph).Inherits);\r
+ if(inheritedFrom != null)\r
+ type = NameUtils.getSafeName(graph, inheritedFrom);\r
+ }\r
+ final String ft = type; \r
+ graph.deny(root, Layer0.getInstance(graph).PartOf);\r
+ \r
+ shell.getDisplay().asyncExec(new Runnable() {\r
+ \r
+ @Override\r
+ public void run() {\r
+ MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ERROR);\r
+ mb.setText("Error");\r
+ mb.setMessage("The imported file is not of type: Function Library (" + ft +")");\r
+ mb.open(); \r
+ }\r
+ });\r
+ } else {\r
+ FunctionUtils.updateFunctionFileForLibrary(graph, functionLibrary);\r
+ }\r
+\r
}\r
});\r
return null;\r
import org.eclipse.core.commands.AbstractHandler;\r
import org.eclipse.core.commands.ExecutionEvent;\r
import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.core.runtime.Platform;\r
import org.eclipse.swt.SWT;\r
import org.eclipse.swt.widgets.FileDialog;\r
import org.eclipse.swt.widgets.Shell;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.sysdyn.mdlImport.MdlParser;\r
import org.simantics.sysdyn.mdlImport.mdlElements.Model;\r
+import org.simantics.sysdyn.ui.Activator;\r
import org.simantics.ui.SimanticsUI;\r
\r
public class ImportMdlHandler extends AbstractHandler {\r
\r
+ public static String IMPORTMDLTPATH = "IMPORT_MDL_PATH";\r
+\r
@Override\r
public Object execute(ExecutionEvent event) throws ExecutionException {\r
\r
Shell shell = HandlerUtil.getActiveShellChecked(event);\r
FileDialog fd = new FileDialog(shell, SWT.OPEN);\r
fd.setText("Import .mdl");\r
- fd.setFilterPath("D:\\DATA\\Openprod\\vensim-malleja");\r
+ String path = Activator.getDefault().getPreferenceStore().getString(IMPORTMDLTPATH);\r
+ if(path.isEmpty() || !(new File(path).exists()))\r
+ path = Platform.getLocation().toOSString();\r
+ fd.setFilterPath(path);\r
String[] filterExt = {"*.mdl"};\r
fd.setFilterExtensions(filterExt);\r
String selected = fd.open();\r
File file = new File(selected);\r
if(!file.isFile()) return null;\r
\r
+ Activator.getDefault().getPreferenceStore().setValue(IMPORTMDLTPATH, (new File(selected)).getParent());\r
+ \r
final Model model = MdlParser.parse(file);\r
\r
SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
import org.eclipse.core.runtime.Platform;\r
import org.eclipse.swt.SWT;\r
import org.eclipse.swt.widgets.FileDialog;\r
+import org.eclipse.swt.widgets.MessageBox;\r
import org.eclipse.swt.widgets.Shell;\r
import org.eclipse.ui.handlers.HandlerUtil;\r
import org.simantics.databoard.Bindings;\r
import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.adapter.impl.DefaultPasteHandler;\r
import org.simantics.db.layer0.adapter.impl.DefaultPasteImportAdvisor;\r
import org.simantics.simulation.ontology.SimulationResource;\r
import org.simantics.structural.stubs.StructuralResource2;\r
import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.ui.Activator;\r
import org.simantics.sysdyn.ui.utils.OldTransferableGraph1;\r
import org.simantics.ui.SimanticsUI;\r
\r
public class ImportModelHandler extends AbstractHandler {\r
+ \r
+ public static String IMPORTMODELTPATH = "IMPORT_MODEL_PATH";\r
\r
@Override\r
public Object execute(ExecutionEvent event) throws ExecutionException {\r
Resource project = SimanticsUI.getProject().get();\r
if(project == null) return null;\r
\r
- Shell shell = HandlerUtil.getActiveShellChecked(event);\r
+ final Shell shell = HandlerUtil.getActiveShellChecked(event);\r
FileDialog fd = new FileDialog(shell, SWT.OPEN);\r
- fd.setText("Import...");\r
- fd.setFilterPath(Platform.getLocation().toOSString());\r
+ fd.setText("Import Model");\r
+ \r
+ String path = Activator.getDefault().getPreferenceStore().getString(IMPORTMODELTPATH);\r
+ if(path.isEmpty() || !(new File(path).exists()))\r
+ path = Platform.getLocation().toOSString();\r
+ fd.setFilterPath(path);\r
String[] filterExt = {"*.tg"};\r
fd.setFilterExtensions(filterExt);\r
String selected = fd.open();\r
if(selected == null) return null;\r
+ \r
+ Activator.getDefault().getPreferenceStore().setValue(IMPORTMODELTPATH, (new File(selected)).getParent());\r
+ \r
\r
TransferableGraph1 tg = null;\r
try {\r
} catch (RuntimeBindingConstructionException e1) {\r
e1.printStackTrace();\r
} catch (IOException e1) {\r
- e1.printStackTrace();\r
+ MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ERROR);\r
+ mb.setText("Error");\r
+ mb.setMessage("The imported file is not of type: Model");\r
+ mb.open();\r
+ return null;\r
}\r
}\r
if(tg == null) return null;\r
DefaultPasteHandler.defaultExecute(tg, SimanticsUI.getProject().get(), ia);\r
\r
\r
- // Fix changes made to old ontology versions\r
+ // Check that imported resource was actually a model \r
+ //and fix changes made to old ontology versions\r
final Resource root = ia.getRoot();\r
SimanticsUI.getSession().syncRequest(new WriteRequest() {\r
\r
@Override\r
public void perform(WriteGraph graph) throws DatabaseException {\r
- updateOldConfigurationToBaseRealization(graph, root);\r
- addDefaultOntologyLinks(graph, root);\r
- addURIsToDiagrams(graph, root);\r
+ \r
+ if(!graph.isInstanceOf(root, SysdynResource.getInstance(graph).SysdynModel)) {\r
+ Resource instanceOf = graph.getPossibleObject(root, Layer0.getInstance(graph).InstanceOf);\r
+ String type = "...";\r
+ if(instanceOf != null)\r
+ type = NameUtils.getSafeName(graph, instanceOf);\r
+ else {\r
+ Resource inheritedFrom = graph.getPossibleObject(root, Layer0.getInstance(graph).Inherits);\r
+ if(inheritedFrom != null)\r
+ type = NameUtils.getSafeName(graph, inheritedFrom);\r
+ }\r
+ final String ft = type; \r
+ graph.deny(root, Layer0.getInstance(graph).PartOf);\r
+ \r
+ shell.getDisplay().asyncExec(new Runnable() {\r
+ \r
+ @Override\r
+ public void run() {\r
+ MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ERROR);\r
+ mb.setText("Error");\r
+ mb.setMessage("The imported file is not of type: System Dynamics Model (" + ft +")");\r
+ mb.open(); \r
+ }\r
+ });\r
+\r
+ } else {\r
+ updateOldConfigurationToBaseRealization(graph, root);\r
+ addDefaultOntologyLinks(graph, root);\r
+ addURIsToDiagrams(graph, root);\r
+ }\r
}\r
});\r
} catch (DatabaseException e) {\r
import org.eclipse.jface.viewers.ISelection;\r
import org.eclipse.swt.SWT;\r
import org.eclipse.swt.widgets.FileDialog;\r
+import org.eclipse.swt.widgets.MessageBox;\r
import org.eclipse.swt.widgets.Shell;\r
import org.eclipse.ui.handlers.HandlerUtil;\r
import org.simantics.browsing.ui.common.node.AbstractNode;\r
import org.simantics.databoard.Files;\r
import org.simantics.databoard.binding.error.RuntimeBindingConstructionException;\r
import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.adapter.impl.DefaultPasteHandler;\r
import org.simantics.db.layer0.adapter.impl.DefaultPasteImportAdvisor;\r
import org.simantics.graph.db.MissingDependencyException;\r
import org.simantics.graph.representation.TransferableGraph1;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.ui.Activator;\r
+import org.simantics.ui.SimanticsUI;\r
import org.simantics.ui.utils.AdaptionUtils;\r
\r
public class ImportModuleHandler extends AbstractHandler {\r
\r
+ public static String IMPORTMODULETPATH = "IMPORT_MODULE_PATH";\r
+ \r
@Override\r
public Object execute(ExecutionEvent event) throws ExecutionException {\r
ISelection sel = HandlerUtil.getCurrentSelection(event);\r
\r
final Resource model = node.data;\r
\r
- Shell shell = HandlerUtil.getActiveShellChecked(event);\r
+ final Shell shell = HandlerUtil.getActiveShellChecked(event);\r
FileDialog fd = new FileDialog(shell, SWT.OPEN);\r
fd.setText("Import Module");\r
- fd.setFilterPath(Platform.getLocation().toOSString());\r
+ \r
+ String path = Activator.getDefault().getPreferenceStore().getString(IMPORTMODULETPATH);\r
+ if(path.isEmpty() || !(new File(path).exists()))\r
+ path = Platform.getLocation().toOSString();\r
+ fd.setFilterPath(path);\r
String[] filterExt = {"*.tg"};\r
fd.setFilterExtensions(filterExt);\r
String selected = fd.open();\r
if(selected == null) return null;\r
\r
+ Activator.getDefault().getPreferenceStore().setValue(IMPORTMODULETPATH, (new File(selected)).getParent());\r
+ \r
TransferableGraph1 tg = null;\r
try {\r
tg = (TransferableGraph1)Files.readFile(new File(selected), Bindings.getBindingUnchecked(TransferableGraph1.class));\r
} catch (RuntimeBindingConstructionException e) {\r
e.printStackTrace();\r
} catch (IOException e) {\r
- e.printStackTrace();\r
+ MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ERROR);\r
+ mb.setText("Error");\r
+ mb.setMessage("The imported file is not of type: Module Type");\r
+ mb.open();\r
+ return null;\r
}\r
if(tg == null) return null;\r
\r
e.printStackTrace();\r
}\r
\r
+ final Resource root = ia.getRoot();\r
+ \r
+ SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
+ \r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ if(!graph.isInheritedFrom(root, SysdynResource.getInstance(graph).Module)) {\r
+ Resource instanceOf = graph.getPossibleObject(root, Layer0.getInstance(graph).InstanceOf);\r
+ String type = "...";\r
+ if(instanceOf != null)\r
+ type = NameUtils.getSafeName(graph, instanceOf);\r
+ else {\r
+ Resource inheritedFrom = graph.getPossibleObject(root, Layer0.getInstance(graph).Inherits);\r
+ if(inheritedFrom != null)\r
+ type = NameUtils.getSafeName(graph, inheritedFrom);\r
+ }\r
+ final String ft = type; \r
+ graph.deny(root, Layer0.getInstance(graph).PartOf);\r
+ \r
+ shell.getDisplay().asyncExec(new Runnable() {\r
+ \r
+ @Override\r
+ public void run() {\r
+ MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ERROR);\r
+ mb.setText("Error");\r
+ mb.setMessage("The imported file is not of type: System Dynamics Module (" + ft +")");\r
+ mb.open(); \r
+ }\r
+ });\r
+ } \r
+ }\r
+ });\r
return null;\r
}\r
\r
import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
import org.simantics.db.common.utils.OrderedSetUtils;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.layer0.Layer0;\r
}\r
}\r
\r
- Resource enumerationIndexes = OrderedSetUtils.create(g, sr.EnumerationIndexes);\r
- \r
- Resource enumeration = GraphUtils.create2(g, \r
- sr.Enumeration,\r
- l0.HasName, "Enumeration",\r
- sr.HasEnumerationIndexes, enumerationIndexes);\r
+ Resource enumerationIndexes = OrderedSetUtils.create(g, sr.EnumerationIndexes);\r
\r
- g.claim(configuration, l0.ConsistsOf, enumeration);\r
+ String name = NameUtils.findFreshName(g, "Enumeration", configuration, l0.ConsistsOf, "%s%d");\r
+ if("Enumeration".equals(name)) name = "Enumeration1";\r
\r
+ GraphUtils.create2(g, \r
+ sr.Enumeration,\r
+ l0.HasName, name,\r
+ sr.HasEnumerationIndexes, enumerationIndexes,\r
+ l0.PartOf, configuration);\r
}\r
});\r
return null;\r
import java.util.Collection;\r
import java.util.HashMap;\r
import java.util.HashSet;\r
+import java.util.LinkedHashMap;\r
import java.util.List;\r
import java.util.Set;\r
\r
if(activeDataSets != null && !activeDataSets.isEmpty())\r
datasets.addAll(activeDataSets);\r
}\r
+ \r
+ for(SysdynDataSet dataset : datasets)\r
+ System.out.println(dataset.name);\r
selectionChanged(datasets);\r
\r
}\r
\r
protected Collection<SysdynDataSet> loadAllActive(ReadGraph g, Variable variable) throws DatabaseException {\r
ArrayList<SysdynDataSet> dataSets = new ArrayList<SysdynDataSet>();\r
- HashMap<String, String> rvis = new HashMap<String, String>();\r
+ HashMap<String, String> rvis = new LinkedHashMap<String, String>();\r
\r
String rvi = Variables.getRVI(g, variable).replace("/", "."); \r
if(rvi.length() > 1)\r