From 0174d7aa6ccf9097d82eb0fb73e25b0ef4ed3436 Mon Sep 17 00:00:00 2001 From: villberg Date: Tue, 20 Sep 2011 19:31:42 +0000 Subject: [PATCH] Updated variables. git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@22352 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.sysdyn/adapters.xml | 11 +++++--- .../sysdyn/adapter/ConfigurationVariable.java | 4 +-- .../adapter/ConfigurationVariableAdapter.java | 26 ++++++++++++++++++ .../simantics/sysdyn/adapter/RunVariable.java | 4 +-- .../sysdyn/adapter/RunVariableAdapter.java | 27 +++++++++++++++++++ 5 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/ConfigurationVariableAdapter.java create mode 100644 org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/RunVariableAdapter.java diff --git a/org.simantics.sysdyn/adapters.xml b/org.simantics.sysdyn/adapters.xml index 8a9ea9e9..ed510299 100644 --- a/org.simantics.sysdyn/adapters.xml +++ b/org.simantics.sysdyn/adapters.xml @@ -21,7 +21,7 @@ - + + + - \ No newline at end of file diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/ConfigurationVariable.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/ConfigurationVariable.java index 859e5d7f..a1013322 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/ConfigurationVariable.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/ConfigurationVariable.java @@ -25,8 +25,8 @@ import org.simantics.db.layer0.variable.Variable; public class ConfigurationVariable extends StandardGraphChildVariable { - public ConfigurationVariable(Resource resource) { - super(resource); + public ConfigurationVariable(Variable parent, Resource resource) { + super(parent, resource); } // @Override diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/ConfigurationVariableAdapter.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/ConfigurationVariableAdapter.java new file mode 100644 index 00000000..53a54470 --- /dev/null +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/ConfigurationVariableAdapter.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.adapter; + +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.adaption.SimpleContextualAdapter; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.variable.Variable; + +public class ConfigurationVariableAdapter extends SimpleContextualAdapter{ + + @Override + public Variable adapt(ReadGraph g, Resource source, Variable context) throws DatabaseException { + return new ConfigurationVariable(context, source); + } +} diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/RunVariable.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/RunVariable.java index 867e9dfe..d3b817a8 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/RunVariable.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/RunVariable.java @@ -26,8 +26,8 @@ import org.simantics.operation.Layer0X; public class RunVariable extends StandardGraphChildVariable { - public RunVariable(Resource resource) { - super(resource); + public RunVariable(Variable parent, Resource resource) { + super(parent, resource); } @Override diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/RunVariableAdapter.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/RunVariableAdapter.java new file mode 100644 index 00000000..64529ca9 --- /dev/null +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/RunVariableAdapter.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.adapter; + +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.adaption.SimpleContextualAdapter; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.variable.Variable; +import org.simantics.sysdyn.SysdynResource; + +public class RunVariableAdapter extends SimpleContextualAdapter{ + + @Override + public Variable adapt(ReadGraph g, Resource source, Variable context) throws DatabaseException { + return new RunVariable(context, source); + } +} -- 2.47.1