]> gerrit.simantics Code Review - simantics/platform.git/blob - 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
1 L0 = <http://www.simantics.org/Layer0-1.1>\r
2 L0X = <http://www.simantics.org/Layer0X-1.1>\r
3 G2D = <http://www.simantics.org/G2D-1.1>\r
4 DIA = <http://www.simantics.org/Diagram-2.2>\r
5 \r
6 // Old StyleProvider-styling\r
7  \r
8 DIA.StyleProvider <T L0.Entity\r
9 \r
10 DIA.FontProvider <T DIA.StyleProvider\r
11     L0.HasDescription """An element inheriting this type tells its font is configurable."""\r
12     @L0.singleProperty G2D.HasFont\r
13 \r
14 DIA.ColorProvider <T DIA.StyleProvider\r
15     L0.HasDescription """An element inheriting this type tells its color is configurable."""\r
16     @L0.singleProperty G2D.HasColor\r
17 \r
18 //String formatting for monitors (to be defined later)\r
19 DIA.FormatProvider <T DIA.StyleProvider\r
20 //    @L0.singleProperty HasFormat\r
21 \r
22 DIA.HasPattern <R L0.HasProperty\r
23     L0.HasDescription "MetricsFormat pattern"\r
24     L0.HasRange L0.String\r
25 \r
26 DIA.Format <T L0.Entity\r
27     @L0.singleProperty DIA.HasPattern\r
28 \r
29 DIA.HasFormat <R L0.HasProperty\r
30     L0.HasLabel "Format"\r
31     L0.HasDescription "Number formatter as input to DoubleFormatter"\r
32     L0.HasRange DIA.Format\r
33 \r
34 \r
35 // Monitor styling using realized and obtained properties\r
36 \r
37 DIA.HasFont <R L0.HasProperty : L0.FunctionalRelation\r
38 DIA.HasColor <R L0.HasProperty : L0.FunctionalRelation\r
39 DIA.HasFormatter <R L0.DependsOn : L0.FunctionalRelation\r
40 \r
41 DIA.ObtainedFont <T L0.Entity\r
42 DIA.RealizedFont <T L0.Entity\r
43 DIA.RealizedFont.HasFamily <R L0.HasProperty : L0.FunctionalRelation\r
44 DIA.RealizedFont.HasSize <R L0.HasProperty : L0.FunctionalRelation\r
45 DIA.RealizedFont.HasStyle <R L0.HasProperty : L0.FunctionalRelation\r
46 \r
47 DIA.ObtainedColor <T L0.Entity\r
48 DIA.RealizedColor <T L0.Entity\r
49 DIA.RealizedColor.HasRGB <R L0.HasProperty : L0.FunctionalRelation\r
50 \r
51 DIA.ObtainedFormatter <T L0.Entity\r
52 DIA.RealizedFormatter <T L0.Entity\r
53 DIA.RealizedFormatter.HasDefinition <R L0.HasProperty : L0.FunctionalRelation\r
54   >-- DIA.RealizedFormatter.sortKey --> L0.String <R L0.HasProperty : L0.FunctionalRelation\r
55 \r
56 DIA.ObtainedMonitorExpression <T L0.Entity\r
57 \r
58 DIA.MonitorTemplate <T L0.Entity\r
59 DIA.HasDefaultMonitorTemplate <R L0.DependsOn : L0.FunctionalRelation\r
60 \r
61 DIA.DefaultMonitorTemplate : DIA.MonitorTemplate\r
62   L0.HasLabel "Simple"\r
63   DIA.HasFont _ : DIA.RealizedFont\r
64     DIA.RealizedFont.HasFamily "Verdana"\r
65     DIA.RealizedFont.HasSize 8\r
66     DIA.RealizedFont.HasStyle 0\r
67   DIA.HasColor _ : DIA.RealizedColor\r
68     DIA.RealizedColor.HasRGB [0.1, 0.3, 0.0]\r
69   DIA.HasFormatter DIA.DefaultFormatter\r
70   L0X.HasExpression """FormattedVariableLabel("")"""\r
71 \r
72 DIA.DescriptiveMonitorTemplate : DIA.MonitorTemplate\r
73   L0.HasLabel "Descriptive"\r
74   DIA.HasFont _ : DIA.RealizedFont\r
75     DIA.RealizedFont.HasFamily "Verdana"\r
76     DIA.RealizedFont.HasSize 8\r
77     DIA.RealizedFont.HasStyle 0\r
78   DIA.HasColor _ : DIA.RealizedColor\r
79     DIA.RealizedColor.HasRGB [0.1, 0.3, 0.0]\r
80   DIA.HasFormatter DIA.DefaultFormatter\r
81   L0X.HasExpression """#HasDisplayProperty + ' = ' + FormattedVariableLabel("") + ' ' + #HasDisplayUnit"""\r
82 \r
83 DIA.Formatter0: DIA.RealizedFormatter\r
84   L0.HasLabel "No Decimals"\r
85   DIA.RealizedFormatter.sortKey "0"\r
86   DIA.RealizedFormatter.HasDefinition "0"\r
87 \r
88 DIA.Formatter1: DIA.RealizedFormatter\r
89   L0.HasLabel "1 Decimals"\r
90   DIA.RealizedFormatter.sortKey "1"\r
91   DIA.RealizedFormatter.HasDefinition "0.0"\r
92 \r
93 DIA.DefaultFormatter : DIA.RealizedFormatter\r
94   L0.HasLabel "2 Decimals"\r
95   DIA.RealizedFormatter.sortKey "2"\r
96   DIA.RealizedFormatter.HasDefinition "0.00"\r
97 \r
98 DIA.Formatter3: DIA.RealizedFormatter\r
99   L0.HasLabel "3 Decimals"\r
100   DIA.RealizedFormatter.sortKey "3"\r
101   DIA.RealizedFormatter.HasDefinition "0.000"\r
102 \r
103 DIA.Formatter5: DIA.RealizedFormatter\r
104   L0.HasLabel "5 Decimals"\r
105   DIA.RealizedFormatter.sortKey "5"\r
106   DIA.RealizedFormatter.HasDefinition "0.00000"\r
107 \r
108 DIA.Formatter15: DIA.RealizedFormatter\r
109   L0.HasLabel "Up To 15 Decimals"\r
110   DIA.RealizedFormatter.sortKey "15"\r
111   DIA.RealizedFormatter.HasDefinition "0.###############"\r
112   \r
113 DIA.FormatterScientific : DIA.RealizedFormatter\r
114   L0.HasLabel "Scientific"\r
115   DIA.RealizedFormatter.sortKey "100-scientific"\r
116   DIA.RealizedFormatter.HasDefinition "0.###E0"\r
117 \r
118 DIA.FormatterEngineering : DIA.RealizedFormatter\r
119   L0.HasLabel "Engineering"\r
120   DIA.RealizedFormatter.sortKey "50-engineering"\r
121   DIA.RealizedFormatter.HasDefinition "##0.###E0"\r
122 \r
123 DIA.RGB <T L0.DoubleArray\r