From: lehtonen Date: Mon, 2 May 2011 07:43:04 +0000 (+0000) Subject: Merged sysdyn trunk changes betwee r20633 and r20694 to simantics-1.4 branch X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=4c632e956e93b8b07c4df942213bb9e32c6bc64f;p=simantics%2Fsysdyn.git Merged sysdyn trunk changes betwee r20633 and r20694 to simantics-1.4 branch git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/branches@20695 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/simantics-1.4/org.simantics.sysdyn.feature/feature.xml b/simantics-1.4/org.simantics.sysdyn.feature/feature.xml index 02b406c4..7b51cef1 100644 --- a/simantics-1.4/org.simantics.sysdyn.feature/feature.xml +++ b/simantics-1.4/org.simantics.sysdyn.feature/feature.xml @@ -93,20 +93,6 @@ version="0.0.0" unpack="false"/> - - - - updateCallback) { - final Resource r = AdaptionUtils.adaptToSingle(forSelection, Resource.class); - if(r == null) { + final Resource resource = AdaptionUtils.adaptToSingle(forSelection, Resource.class); + if(resource == null) { updateCallback.run("Selection properties"); return; } @@ -29,6 +63,11 @@ public abstract class LabelPropertyTabContributor extends PropertyTabContributor @Override public String perform(ReadGraph graph) throws DatabaseException { Layer0 l0 = Layer0.getInstance(graph); + ModelingResources mr = ModelingResources.getInstance(graph); + Resource r = resource; + if(graph.hasStatement(r, mr.ElementToComponent)) { + r = graph.getSingleObject(r, mr.ElementToComponent); + } String label = graph.getPossibleRelatedValue(r, l0.HasLabel); if(label != null) return label; @@ -51,7 +90,7 @@ public abstract class LabelPropertyTabContributor extends PropertyTabContributor @Override public boolean isDisposed() { - return false; + return isDisposed; } }); } catch (DatabaseException e) { @@ -60,4 +99,9 @@ public abstract class LabelPropertyTabContributor extends PropertyTabContributor } } + + @Override + protected void dispose() { + this.isDisposed = true; + } } diff --git a/simantics-1.4/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/ExpressionUtils.java b/simantics-1.4/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/ExpressionUtils.java index 180b2fc5..5297a2f5 100644 --- a/simantics-1.4/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/ExpressionUtils.java +++ b/simantics-1.4/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/ExpressionUtils.java @@ -278,8 +278,9 @@ public class ExpressionUtils { boolean isFound = false; Enumeration e = (Enumeration)v; - // TODO: add .elements and .size - if(enumeration.equals(et.image)) { + if(enumeration.equals(et.image) || + "size".equals(et.image) || + "elements".equals(et.image)){ // The full enumeration isFound = true; } else { diff --git a/simantics-1.4/org.simantics.sysdyn.ui/sysdyn.product b/simantics-1.4/org.simantics.sysdyn.ui/sysdyn.product index 9b282a0c..a9588186 100644 --- a/simantics-1.4/org.simantics.sysdyn.ui/sysdyn.product +++ b/simantics-1.4/org.simantics.sysdyn.ui/sysdyn.product @@ -14,6 +14,8 @@ + diff --git a/simantics-1.4/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/HistoryVariable.java b/simantics-1.4/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/HistoryVariable.java index fdde1806..1b0dfe75 100644 --- a/simantics-1.4/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/HistoryVariable.java +++ b/simantics-1.4/org.simantics.sysdyn/src/org/simantics/sysdyn/adapter/HistoryVariable.java @@ -93,6 +93,14 @@ public class HistoryVariable extends ChildVariable { return super.getInterface(graph, clazz); } + @Override + public Variable getPossibleChild(ReadGraph graph, String name) throws DatabaseException { + try { + return getChild(graph, name); + } catch (DatabaseException e) { + return null; + } + } @Override public Variable getChild(ReadGraph graph, String name) throws DatabaseException { diff --git a/simantics-1.4/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/utils/IndexUtils.java b/simantics-1.4/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/utils/IndexUtils.java index 6c379a42..a1693271 100644 --- a/simantics-1.4/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/utils/IndexUtils.java +++ b/simantics-1.4/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/utils/IndexUtils.java @@ -107,7 +107,7 @@ public class IndexUtils { } range.append("]"); - Variable prevVar = getVariable(variable.getParentConfiguration(), prevToken); + Variable prevVar = getVariable(variable.getParentConfiguration(), prevToken.trim()); result.append(rangeToIndexes(prevVar, range.toString())); } else { result.append(nextToken);