]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ontology/graph/ModelingViewpoint.pgraph
Possibility to define label color decorator rules in SCL
[simantics/platform.git] / bundles / org.simantics.modeling.ontology / graph / ModelingViewpoint.pgraph
index 0255339ac7bda279053ca6e30b98d744f2362ac2..47931cc4f1172e7eb0bc631471114d8fd648209b 100644 (file)
@@ -23,6 +23,15 @@ MOD.SCLChildRule <T VP.ChildRule
 MOD.SCLLabelRule <T VP.VisualsRule
   >-- MOD.SCLLabelRule.getLabels ==> "Resource -> <ReadGraph> [String]" <R L0.HasProperty : L0.FunctionalRelation
 
+MOD.SCLImageRule <T VP.VisualsRule
+  >-- MOD.SCLImageRule.getImages ==> "Resource -> <ReadGraph> [(String,ImageDescriptor)]" <R L0.HasProperty : L0.FunctionalRelation
+
+MOD.SCLLabelForegroundColorRule <T VP.VisualsRule
+  >-- MOD.SCLLabelForegroundColorRule.getColor ==> "Resource -> Maybe (Double, Double, Double) -> String -> Integer -> <ReadGraph> Maybe (Double, Double, Double)]" <R L0.HasProperty : L0.FunctionalRelation
+
+MOD.SCLLabelBackgroundColorRule <T VP.VisualsRule
+  >-- MOD.SCLLabelBackgroundColorRule.getColor ==> "Resource -> Maybe (Double, Double, Double) -> String -> Integer -> <ReadGraph> Maybe (Double, Double, Double)]" <R L0.HasProperty : L0.FunctionalRelation
+
 MOD.SCLAction <T ACT.Action
   --> MOD.SCLAction.action ==> "Resource -> <Proc> ()" <R L0.HasProperty : L0.FunctionalRelation 
 
@@ -182,6 +191,8 @@ MBC
 
     @VP.namedRelationChildRule           MOD.Contributions.SCLModules L0.Entity   L0.ConsistsOf L0.SCLModule
     
+    @VP.namedRelationChildRule           MOD.Contributions.SCLScripts L0.Entity   L0.ConsistsOf L0.SCLScript
+    
     @VP.namedRelationChildRule           MOD.Contributions.SCLQueries L0.Library   L0.ConsistsOf MOD.SCLQuery
     
     @VP.namedRelationChildRule           MOD.Contributions.PGraphs L0.Ontology   L0.ConsistsOf L0.PGraph
@@ -342,6 +353,7 @@ MBC
         VP.VisualsContribution.HasCondition MBC.IsUserDefinedComponentTest
     @VP.namedConstantImageRule           MOD.Contributions.ImageImage            IMAGE.Image                          SILK.image
     @VP.namedConstantImageRule           MOD.Contributions.ModuleImage           L0.SCLModule                         SILK.box
+    @VP.namedConstantImageRule           MOD.Contributions.ScriptImage           L0.SCLScript                         SILK.script_go
     @VP.namedConstantImageRule           MOD.Contributions.PGraphImage           L0.PGraph                            SILK.box
     @VP.namedConstantImageRule           MOD.Contributions.QueryImage            MOD.SCLQuery                         SILK.script
     @VP.namedConstantImageRule           MOD.Contributions.CodeImage             STR.ProceduralComponentTypeCode      SILK.book_open
@@ -379,6 +391,27 @@ MOD.sclLabelRule : L0.Template
             L0.SCLValue.expression %expression
             L0.HasValueType "Resource -> <ReadGraph> [String]"
 
+MOD.sclImageRule : L0.Template
+    @template %action %expression
+        %action : MOD.SCLImageRule
+          MOD.SCLImageRule.getImages _ : MOD.SCLValue
+            L0.SCLValue.expression %expression
+            L0.HasValueType "Resource -> <ReadGraph> [(String,ImageDescriptor)]"
+
+MOD.sclLabelForegroundColorRule : L0.Template
+    @template %action %expression
+        %action : MOD.SCLLabelForegroundColorRule
+          MOD.SCLLabelForegroundColorRule.getColor _ : MOD.SCLValue
+            L0.SCLValue.expression %expression
+            L0.HasValueType "Resource -> Maybe (Double, Double, Double) -> String -> Integer -> <ReadGraph> Maybe (Double, Double, Double)"
+
+MOD.sclLabelBackgroundColorRule : L0.Template
+    @template %action %expression
+        %action : MOD.SCLLabelBackgroundColorRule
+          MOD.SCLLabelBackgroundColorRule.getColor _ : MOD.SCLValue
+            L0.SCLValue.expression %expression
+            L0.HasValueType "Resource -> Maybe (Double, Double, Double) -> String -> Integer -> <ReadGraph> Maybe (Double, Double, Double)"
+
 MOD.sclAction : L0.Template
     @template %action %expression
         %action : MOD.SCLAction
@@ -420,10 +453,23 @@ MOD.Contributions.Help : VP.ActionContribution
     VP.ActionContribution.HasCategory VP.EditActionCategory
     VP.ActionContribution.HasNodeType L0.Entity
     VP.ActionContribution.HasAction ACTIONS.Help
-              
+
+MOD.Contributions.CopyURI : VP.ActionContribution
+    L0.HasLabel "Copy URI"
+    VP.ActionContribution.HasImage SILK.clipboard
+    VP.ActionContribution.HasCategory VP.EditActionCategory
+    VP.ActionContribution.HasNodeType L0.Entity
+    VP.ActionContribution.HasNodeType MBC.Variable
+    VP.ActionContribution.HasAction ACTIONS.CopyURI
+    VP.ActionContribution.IsVisibleIf _ : VP.AndTest
+        VP.AndTest.HasTest
+            _ : VP.InDevelopmentModeTest
+            _ : VP.HasURITest
+
 // Actions
 MAC    
     VP.BrowseContext.HasActionContribution MOD.Contributions.Help
+    VP.BrowseContext.HasActionContribution MOD.Contributions.CopyURI
     VP.BrowseContext.HasActionContribution _ : VP.ActionContribution
         L0.HasLabel "Migrate"
         VP.ActionContribution.HasImage SILK.star
@@ -484,6 +530,20 @@ MAC
             STR.ComponentType
         VP.ActionContribution.HasAction ACTIONS.NewSCLModule
         VP.ActionContribution.IsVisibleIf TESTS.IsContainerNotPublished
+    VP.BrowseContext.HasActionContribution MOD.Contributions.NewSCLScript : VP.ActionContribution
+        L0.HasLabel "SCL Script"
+        VP.ActionContribution.HasImage SILK.script_go
+        VP.ActionContribution.HasCategory VP.NewActionCategory
+        VP.ActionContribution.HasNodeType
+            L0.Library
+        VP.ActionContribution.HasAction ACTIONS.NewSCLScript
+        VP.ActionContribution.IsVisibleIf TESTS.IsContainerNotPublished
+    VP.BrowseContext.HasActionContribution _ : VP.ActionContribution
+        L0.HasLabel "Run SCL Script"
+        VP.ActionContribution.HasImage SILK.script_start
+        VP.ActionContribution.HasCategory VP.EditActionCategory
+        VP.ActionContribution.HasNodeType L0.SCLScript
+        VP.ActionContribution.HasAction ACTIONS.RunSCLScript
     VP.BrowseContext.HasActionContribution MOD.Contributions.NewPGraph : VP.ActionContribution
         L0.HasLabel "Ontology Definition File"
         VP.ActionContribution.HasImage SILK.page_white_text
@@ -645,6 +705,9 @@ ACTIONS.CreateNewVersion
   @MOD.sclAction "newVersionAction"
 ACTIONS.NewSCLModule
   @MOD.sclAction "createSCLModuleAction"
+ACTIONS.NewSCLScript
+  @MOD.sclAction "createSCLScriptAction"
+ACTIONS.RunSCLScript : ACT.Action
 ACTIONS.NewPGraph
   @MOD.sclAction "createPGraphAction"
 ACTIONS.NewSCLQuery : ACT.Action
@@ -659,6 +722,7 @@ ACTIONS.CompilePGraphs : ACT.Action
 //ACTIONS.MigrateMasterTypical : ACT.Action
 ACTIONS.RenameDiagramComponents : ACT.Action
 ACTIONS.Help : ACT.Action
+ACTIONS.CopyURI : ACT.Action
 
 ACTIONS.NavigateToSubstructure
   @MOD.sclAction "navigateToSubstructureAction"