]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
SVG properties to property view (refs #3511)
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 3 Aug 2012 14:15:58 +0000 (14:15 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 3 Aug 2012 14:15:58 +0000 (14:15 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25388 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ontology/graph.tg
org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph
org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ResourceSelectionProcessor.java

index 6ca829ae483675f373a4bf0b5fdcaa90ed27efc0..a35fda800471f4c77ac875dfd58d83a7a1aa027a 100644 (file)
Binary files a/org.simantics.sysdyn.ontology/graph.tg and b/org.simantics.sysdyn.ontology/graph.tg differ
index b7582078672d27d5df800d1aa74c321869cf2248..e3f629d7b1a0a573c0e2af09b1251f527ec9133f 100644 (file)
@@ -23,10 +23,10 @@ SYSDYN.ImportedOntologies : PROJ.NamespaceRequirement
         "http://www.simantics.org/Sysdyn-1.1" : L0.URI
         "http://www.simantics.org/Layer0-1.0" : L0.URI
         "http://www.simantics.org/Documentation-1.0" : L0.URI // Experimental documentation tool
-        "http://www.simantics.org/SelectionView-1.1" : L0.URI        
-        
+        "http://www.simantics.org/SelectionView-1.1" : L0.URI
+                
 SYSDYN.SharedFunctionOntology <T L0.Ontology
-SYSDYN.SharedModuleOntolofgy <T L0.Ontology      
+SYSDYN.SharedModuleOntology <T L0.Ontology      
 
 FUNCTIONS = SYSDYN.Functions : L0.Library
     @L0.new  
index 747663daaa0c4068cf96959959df091f5bc1f442..66c5801086baccea59d7e5e1583d3ea148dc3e3a 100644 (file)
@@ -273,7 +273,7 @@ public class SysdynResource {
     public final Resource Right;\r
     public final Resource SelectedSharedFunctionLibraries;\r
     public final Resource SharedFunctionOntology;\r
-    public final Resource SharedModuleOntolofgy;\r
+    public final Resource SharedModuleOntology;\r
     public final Resource SimulateOnChangeExperiment;\r
     public final Resource SimulationPlaybackProfile;\r
     public final Resource SimulationPlaybackStyle;\r
@@ -645,7 +645,7 @@ public class SysdynResource {
         public static final String Right = "http://www.simantics.org/Sysdyn-1.1/Right";\r
         public static final String SelectedSharedFunctionLibraries = "http://www.simantics.org/Sysdyn-1.1/SelectedSharedFunctionLibraries";\r
         public static final String SharedFunctionOntology = "http://www.simantics.org/Sysdyn-1.1/SharedFunctionOntology";\r
-        public static final String SharedModuleOntolofgy = "http://www.simantics.org/Sysdyn-1.1/SharedModuleOntolofgy";\r
+        public static final String SharedModuleOntology = "http://www.simantics.org/Sysdyn-1.1/SharedModuleOntology";\r
         public static final String SimulateOnChangeExperiment = "http://www.simantics.org/Sysdyn-1.1/SimulateOnChangeExperiment";\r
         public static final String SimulationPlaybackProfile = "http://www.simantics.org/Sysdyn-1.1/SimulationPlaybackProfile";\r
         public static final String SimulationPlaybackStyle = "http://www.simantics.org/Sysdyn-1.1/SimulationPlaybackStyle";\r
@@ -1027,7 +1027,7 @@ public class SysdynResource {
         Right = getResourceOrNull(graph, URIs.Right);\r
         SelectedSharedFunctionLibraries = getResourceOrNull(graph, URIs.SelectedSharedFunctionLibraries);\r
         SharedFunctionOntology = getResourceOrNull(graph, URIs.SharedFunctionOntology);\r
-        SharedModuleOntolofgy = getResourceOrNull(graph, URIs.SharedModuleOntolofgy);\r
+        SharedModuleOntology = getResourceOrNull(graph, URIs.SharedModuleOntology);\r
         SimulateOnChangeExperiment = getResourceOrNull(graph, URIs.SimulateOnChangeExperiment);\r
         SimulationPlaybackProfile = getResourceOrNull(graph, URIs.SimulationPlaybackProfile);\r
         SimulationPlaybackStyle = getResourceOrNull(graph, URIs.SimulationPlaybackStyle);\r
index e17e65db969dfebdd8e3c76f0e4281675d44fb82..c866309cb45858561e0fd18de69fc03b93c754cf 100644 (file)
@@ -29,10 +29,10 @@ import org.simantics.db.exception.ManyObjectsForFunctionalRelationException;
 import org.simantics.db.exception.ServiceException;\r
 import org.simantics.db.layer0.request.PossibleActiveVariableFromVariable;\r
 import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.db.layer0.variable.Variables;\r
 import org.simantics.diagram.stubs.DiagramResource;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.modeling.ModelingResources;\r
+import org.simantics.modeling.ui.property.svg.SVGElementComposite;\r
 import org.simantics.selectionview.ComparableTabContributor;\r
 import org.simantics.selectionview.SelectionProcessor;\r
 import org.simantics.simulation.ontology.SimulationResource;\r
@@ -118,7 +118,7 @@ public class ResourceSelectionProcessor implements SelectionProcessor<Object, Re
                        if(r == null) {\r
                                // Selection is not directly a resource, try if it is a variable \r
                                var = AdaptionUtils.adaptToSingle(selection, Variable.class);\r
-                                               r = (Resource)var.getPropertyValue(backend, Variables.REPRESENTS);\r
+                                               r = var.getRepresents(backend);\r
                        }\r
 \r
                        if(r == null) {\r
@@ -146,6 +146,10 @@ public class ResourceSelectionProcessor implements SelectionProcessor<Object, Re
                                                        "Shared Functions"));\r
                                }\r
                        }\r
+                       \r
+                       // SVG elements in symbol editor\r
+            if (backend.isInstanceOf(r, dr.SVGElement))\r
+                return Collections.singleton(SVGElementComposite.make(r, 1, "SVG"));\r
 \r
                        // if r == diagram element, change it to component\r
                                        if (backend.isInstanceOf(r, dr.Element)) {\r