]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.charts.ontology/graph/ChartViewpoint.pgraph
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.charts.ontology / graph / ChartViewpoint.pgraph
diff --git a/bundles/org.simantics.charts.ontology/graph/ChartViewpoint.pgraph b/bundles/org.simantics.charts.ontology/graph/ChartViewpoint.pgraph
new file mode 100644 (file)
index 0000000..8d668cc
--- /dev/null
@@ -0,0 +1,81 @@
+L0 = <http://www.simantics.org/Layer0-1.1>\r
+MOD = <http://www.simantics.org/Modeling-1.2>\r
+IMAGE = <http://www.simantics.org/Image2-1.2>\r
+VP = <http://www.simantics.org/Viewpoint-1.2>\r
+ACT = <http://www.simantics.org/Action-1.1>\r
+CHART = <http://www.simantics.org/Charts-1.2>\r
+SIMU = <http://www.simantics.org/Simulation-1.1>\r
+\r
+CBC = CHART.ChartBrowseContext : VP.BrowseContext\r
+    VP.BrowseContext.IsIncludedIn MOD.ModelingBrowseContext\r
+CAC = CHART.ChartActionContext : VP.BrowseContext\r
+    VP.BrowseContext.IsIncludedIn MOD.ModelingActionContext\r
+\r
+CBC.ChartsFolder : VP.ResourceNodeType\r
+\r
+// Library containing all viewpoint contributions\r
+CHART.Contributions : L0.Library\r
+\r
+CHART.Contributions.Charts\r
+    @VP.defineRelationChildRule SIMU.Model L0.ConsistsOf CHART.Chart\r
+\r
+CBC\r
+    //@VP.relationChildRuleWithFolder MOD.StructuralModel L0.ConsistsOf   CHART.Chart\r
+    //    CBC.ChartsFolder : VP.ResourceNodeType\r
+\r
+    VP.BrowseContext.HasVisualsContribution _ : VP.VisualsContribution\r
+        VP.VisualsContribution.HasNodeType CHART.TimeSeriesChart\r
+        VP.VisualsContribution.HasRule CBC.ChartSorterRule\r
+\r
+    @VP.relationChildRule           CHART.Chart        L0.ConsistsOf   CHART.Chart.Item\r
+    @VP.relationChildRule           CHART.ChartGroup   L0.ConsistsOf   CHART.Chart\r
+\r
+    @VP.constantLabelRule           CBC.ChartsFolder                    "Charts"\r
+    @VP.customLabelRule             CHART.Chart.Item                    CBC.ChartItemLabelRule\r
+    @VP.customLabelRule             CHART.Chart.Item                    CBC.ChartItemNameModifierRule\r
+    @VP.customLabelDecorationRule   CHART.Chart.Item                    CBC.ChartItemLabelDecorationRule\r
+\r
+    @VP.constantImageRule           CBC.ChartsFolder                    IMAGES.ChartsFolder\r
+    @VP.constantImageRule           CHART.ChartGroup                    IMAGES.ChartGroup\r
+    @VP.constantImageRule           CHART.Chart                         IMAGES.Chart\r
+    @VP.customImageRule             CHART.Chart.Item                    IMAGES.ChartItemImage\r
+\r
+    @VP.dropActionContribution      CBC.ChartsFolder   ACTIONS.ChartGroupDropAction   1.0\r
+    @VP.dropActionContribution      CHART.ChartGroup   ACTIONS.ChartGroupDropAction   1.0\r
+    @VP.dropActionContribution      CHART.TimeSeriesChart ACTIONS.ChartDropAction        1.0\r
+    @VP.dropActionContribution      CHART.Chart.Item   ACTIONS.ChartItemDropAction    1.0\r
+\r
+CAC\r
+    @VP.actionContribution "Chart Group" CHART.ChartGroup IMAGES.ChartGroup VP.NewActionCategory ACTIONS.NewChartGroup\r
+    @VP.actionContribution "Chart Group" CBC.ChartsFolder IMAGES.ChartGroup VP.NewActionCategory ACTIONS.NewChartGroup\r
+    @VP.actionContribution "Chart" CBC.ChartsFolder IMAGES.Chart VP.NewActionCategory ACTIONS.NewChart\r
+    @VP.actionContribution "Chart" CHART.ChartGroup IMAGES.Chart VP.NewActionCategory ACTIONS.NewChart\r
+\r
+CHART.Contributions.NewChart\r
+    @VP.defineActionContribution "Chart" SIMU.Model IMAGES.Chart VP.NewActionCategory ACTIONS.NewChart\r
+\r
+\r
+IMAGES = CBC.Images : L0.Library\r
+IMAGES.ChartsFolder : IMAGE.PngImage\r
+    @L0.loadBytes "images/Charts.png"\r
+IMAGES.Chart : IMAGE.PngImage\r
+    @L0.loadBytes "images/chart_line.png"\r
+IMAGES.ChartGroup : IMAGE.PngImage\r
+    @L0.loadBytes "images/chart_group2.png"\r
+IMAGES.Plot : IMAGE.PngImage\r
+    @L0.loadBytes "images/tag_orange.png"\r
+IMAGES.ChartItemImage : VP.ImageRule\r
+\r
+CBC.ChartItemLabelRule : VP.LabelRule\r
+CBC.ChartSorterRule : VP.SorterRule\r
+CBC.ChartItemLabelDecorationRule : VP.LabelDecorationRule\r
+\r
+CBC.ChartItemNameModifierRule : VP.ModifierRule \r
+    L0.HasDescription """Modifier rule based on resource names."""\r
+\r
+ACTIONS = CAC.Actions : L0.Library\r
+ACTIONS.ChartDropAction : ACT.DropAction\r
+ACTIONS.ChartGroupDropAction : ACT.DropAction\r
+ACTIONS.ChartItemDropAction : ACT.DropAction\r
+ACTIONS.NewChart : ACT.Action\r
+ACTIONS.NewChartGroup : ACT.Action\r