]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram.ontology/graph/DiagramStyling.pgraph
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.diagram.ontology / graph / DiagramStyling.pgraph
diff --git a/bundles/org.simantics.diagram.ontology/graph/DiagramStyling.pgraph b/bundles/org.simantics.diagram.ontology/graph/DiagramStyling.pgraph
new file mode 100644 (file)
index 0000000..3f9a2b2
--- /dev/null
@@ -0,0 +1,123 @@
+L0 = <http://www.simantics.org/Layer0-1.1>\r
+L0X = <http://www.simantics.org/Layer0X-1.1>\r
+G2D = <http://www.simantics.org/G2D-1.1>\r
+DIA = <http://www.simantics.org/Diagram-2.2>\r
+\r
+// Old StyleProvider-styling\r
\r
+DIA.StyleProvider <T L0.Entity\r
+\r
+DIA.FontProvider <T DIA.StyleProvider\r
+    L0.HasDescription """An element inheriting this type tells its font is configurable."""\r
+    @L0.singleProperty G2D.HasFont\r
+\r
+DIA.ColorProvider <T DIA.StyleProvider\r
+    L0.HasDescription """An element inheriting this type tells its color is configurable."""\r
+    @L0.singleProperty G2D.HasColor\r
+\r
+//String formatting for monitors (to be defined later)\r
+DIA.FormatProvider <T DIA.StyleProvider\r
+//    @L0.singleProperty HasFormat\r
+\r
+DIA.HasPattern <R L0.HasProperty\r
+    L0.HasDescription "MetricsFormat pattern"\r
+    L0.HasRange L0.String\r
+\r
+DIA.Format <T L0.Entity\r
+    @L0.singleProperty DIA.HasPattern\r
+\r
+DIA.HasFormat <R L0.HasProperty\r
+    L0.HasLabel "Format"\r
+    L0.HasDescription "Number formatter as input to DoubleFormatter"\r
+    L0.HasRange DIA.Format\r
+\r
+\r
+// Monitor styling using realized and obtained properties\r
+\r
+DIA.HasFont <R L0.HasProperty : L0.FunctionalRelation\r
+DIA.HasColor <R L0.HasProperty : L0.FunctionalRelation\r
+DIA.HasFormatter <R L0.DependsOn : L0.FunctionalRelation\r
+\r
+DIA.ObtainedFont <T L0.Entity\r
+DIA.RealizedFont <T L0.Entity\r
+DIA.RealizedFont.HasFamily <R L0.HasProperty : L0.FunctionalRelation\r
+DIA.RealizedFont.HasSize <R L0.HasProperty : L0.FunctionalRelation\r
+DIA.RealizedFont.HasStyle <R L0.HasProperty : L0.FunctionalRelation\r
+\r
+DIA.ObtainedColor <T L0.Entity\r
+DIA.RealizedColor <T L0.Entity\r
+DIA.RealizedColor.HasRGB <R L0.HasProperty : L0.FunctionalRelation\r
+\r
+DIA.ObtainedFormatter <T L0.Entity\r
+DIA.RealizedFormatter <T L0.Entity\r
+DIA.RealizedFormatter.HasDefinition <R L0.HasProperty : L0.FunctionalRelation\r
+  >-- DIA.RealizedFormatter.sortKey --> L0.String <R L0.HasProperty : L0.FunctionalRelation\r
+\r
+DIA.ObtainedMonitorExpression <T L0.Entity\r
+\r
+DIA.MonitorTemplate <T L0.Entity\r
+DIA.HasDefaultMonitorTemplate <R L0.DependsOn : L0.FunctionalRelation\r
+\r
+DIA.DefaultMonitorTemplate : DIA.MonitorTemplate\r
+  L0.HasLabel "Simple"\r
+  DIA.HasFont _ : DIA.RealizedFont\r
+    DIA.RealizedFont.HasFamily "Verdana"\r
+    DIA.RealizedFont.HasSize 8\r
+    DIA.RealizedFont.HasStyle 0\r
+  DIA.HasColor _ : DIA.RealizedColor\r
+    DIA.RealizedColor.HasRGB [0.1, 0.3, 0.0]\r
+  DIA.HasFormatter DIA.DefaultFormatter\r
+  L0X.HasExpression """FormattedVariableLabel("")"""\r
+\r
+DIA.DescriptiveMonitorTemplate : DIA.MonitorTemplate\r
+  L0.HasLabel "Descriptive"\r
+  DIA.HasFont _ : DIA.RealizedFont\r
+    DIA.RealizedFont.HasFamily "Verdana"\r
+    DIA.RealizedFont.HasSize 8\r
+    DIA.RealizedFont.HasStyle 0\r
+  DIA.HasColor _ : DIA.RealizedColor\r
+    DIA.RealizedColor.HasRGB [0.1, 0.3, 0.0]\r
+  DIA.HasFormatter DIA.DefaultFormatter\r
+  L0X.HasExpression """#HasDisplayProperty + ' = ' + FormattedVariableLabel("") + ' ' + #HasDisplayUnit"""\r
+\r
+DIA.Formatter0: DIA.RealizedFormatter\r
+  L0.HasLabel "No Decimals"\r
+  DIA.RealizedFormatter.sortKey "0"\r
+  DIA.RealizedFormatter.HasDefinition "0"\r
+\r
+DIA.Formatter1: DIA.RealizedFormatter\r
+  L0.HasLabel "1 Decimals"\r
+  DIA.RealizedFormatter.sortKey "1"\r
+  DIA.RealizedFormatter.HasDefinition "0.0"\r
+\r
+DIA.DefaultFormatter : DIA.RealizedFormatter\r
+  L0.HasLabel "2 Decimals"\r
+  DIA.RealizedFormatter.sortKey "2"\r
+  DIA.RealizedFormatter.HasDefinition "0.00"\r
+\r
+DIA.Formatter3: DIA.RealizedFormatter\r
+  L0.HasLabel "3 Decimals"\r
+  DIA.RealizedFormatter.sortKey "3"\r
+  DIA.RealizedFormatter.HasDefinition "0.000"\r
+\r
+DIA.Formatter5: DIA.RealizedFormatter\r
+  L0.HasLabel "5 Decimals"\r
+  DIA.RealizedFormatter.sortKey "5"\r
+  DIA.RealizedFormatter.HasDefinition "0.00000"\r
+\r
+DIA.Formatter15: DIA.RealizedFormatter\r
+  L0.HasLabel "Up To 15 Decimals"\r
+  DIA.RealizedFormatter.sortKey "15"\r
+  DIA.RealizedFormatter.HasDefinition "0.###############"\r
+  \r
+DIA.FormatterScientific : DIA.RealizedFormatter\r
+  L0.HasLabel "Scientific"\r
+  DIA.RealizedFormatter.sortKey "100-scientific"\r
+  DIA.RealizedFormatter.HasDefinition "0.###E0"\r
+\r
+DIA.FormatterEngineering : DIA.RealizedFormatter\r
+  L0.HasLabel "Engineering"\r
+  DIA.RealizedFormatter.sortKey "50-engineering"\r
+  DIA.RealizedFormatter.HasDefinition "##0.###E0"\r
+\r
+DIA.RGB <T L0.DoubleArray\r