-
Notifications
You must be signed in to change notification settings - Fork 5
/
AppHtml5.java
205 lines (166 loc) · 7.71 KB
/
AppHtml5.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
package org.genericsystem.reactor.example;
import org.genericsystem.api.core.annotations.Components;
import org.genericsystem.api.core.annotations.Meta;
import org.genericsystem.api.core.annotations.SystemGeneric;
import org.genericsystem.api.core.annotations.value.IntValue;
import org.genericsystem.api.core.annotations.value.StringValue;
import org.genericsystem.carcolor.model.Car;
import org.genericsystem.carcolor.model.CarColor;
import org.genericsystem.carcolor.model.CarColor2;
import org.genericsystem.carcolor.model.Color;
import org.genericsystem.carcolor.model.Power;
import org.genericsystem.carcolor.model.UsedCar;
import org.genericsystem.reactor.annotations.DependsOnModel;
import org.genericsystem.reactor.annotations.DirectSelect;
import org.genericsystem.reactor.annotations.ForEach.ChildForEach;
import org.genericsystem.reactor.annotations.ReactorDependencies;
import org.genericsystem.reactor.annotations.ReactorDependencies.ChildReactorDependencies;
import org.genericsystem.reactor.annotations.RunScript;
import org.genericsystem.reactor.annotations.Styles;
import org.genericsystem.reactor.annotations.Styles.BackgroundColor;
import org.genericsystem.reactor.annotations.Styles.ChildFlexDirection;
import org.genericsystem.reactor.annotations.Styles.Flex;
import org.genericsystem.reactor.annotations.Styles.FlexDirectionStyle;
import org.genericsystem.reactor.annotations.Styles.FlexWrap;
import org.genericsystem.reactor.annotations.Styles.MarginBottom;
import org.genericsystem.reactor.annotations.Styles.MarginRight;
import org.genericsystem.reactor.annotations.Styles.Style;
import org.genericsystem.reactor.appserver.ApplicationServer;
import org.genericsystem.reactor.az.FlexDirection;
import org.genericsystem.reactor.az.GSApp;
import org.genericsystem.reactor.az3.GSComposite;
import org.genericsystem.reactor.az3.GSComposite.GSContentComponent;
import org.genericsystem.reactor.az3.GSComposite.GSHeaderComponent;
import org.genericsystem.reactor.example.AppHtml.ExampleReactorScript;
import org.genericsystem.reactor.example.AppHtml5.AudiTT;
import org.genericsystem.reactor.example.AppHtml5.AudiTT.AudiTTGreen;
import org.genericsystem.reactor.example.AppHtml5.AudiTT.AudiTTPower;
import org.genericsystem.reactor.example.AppHtml5.AudiTT.Green;
import org.genericsystem.reactor.example.AppHtml5.GSInstancesComposite;
import org.genericsystem.reactor.example.AppHtml5.GSRowInstancesComposite;
import org.genericsystem.reactor.example.AppHtml5.GSTypeAttributes;
import org.genericsystem.reactor.example.AppHtml5.GSTypeAttributesRow;
import org.genericsystem.reactor.example.AppHtml5.GSTypeLabeledInstancesComposite;
import org.genericsystem.reactor.example.AppHtml5.GSTypeTableInstancesComposite;
import org.genericsystem.reactor.example.AppHtml5.GSValueComponents;
import org.genericsystem.reactor.example.AppHtml5.TestCell;
import org.genericsystem.reactor.example.AppHtml5.Unit;
import org.genericsystem.reactor.model.ObservableListExtractor;
import org.genericsystem.reactor.modelproperties.SelectionDefaults;
@DependsOnModel({ Car.class, Power.class, UsedCar.class, Color.class, CarColor.class, CarColor2.class, AudiTT.class, Green.class, AudiTTGreen.class, AudiTTPower.class, Unit.class })
@RunScript(ExampleReactorScript.class)
@ReactorDependencies({ GSInstancesComposite.class, GSRowInstancesComposite.class, GSTypeAttributes.class, GSTypeAttributesRow.class, GSValueComponents.class, GSTypeLabeledInstancesComposite.class, GSTypeTableInstancesComposite.class, TestCell.class })
@FlexWrap("wrap")
@Flex("1 1 0%")
public class AppHtml5 extends GSApp implements SelectionDefaults {
public static void main(String[] mainArgs) {
ApplicationServer.startSimpleGenericApp(mainArgs, AppHtml5.class, "/example-reactor");
}
@BackgroundColor("Green")
@DirectSelect(Car.class)
@ChildForEach(ObservableListExtractor.SUBINSTANCES.class)
public static class GSInstancesComposite extends GSComposite {
}
@BackgroundColor("Blue")
@FlexDirectionStyle(FlexDirection.ROW)
@DirectSelect(Car.class)
@ChildForEach(ObservableListExtractor.SUBINSTANCES.class)
public static class GSRowInstancesComposite extends GSComposite {
}
@BackgroundColor("Red")
@DirectSelect(Car.class)
@ChildForEach(ObservableListExtractor.ATTRIBUTES_OF_TYPE.class)
@ReactorDependencies({ GSHeaderComponent.class, GSContentComponent.class })
public static class GSTypeAttributes extends GSComposite {
}
@BackgroundColor("Purple")
@Styles.Color("White")
@DirectSelect(Car.class)
@FlexDirectionStyle(FlexDirection.ROW)
@ChildForEach(ObservableListExtractor.ATTRIBUTES_OF_TYPE.class)
@ChildFlexDirection("row")
@ReactorDependencies({ GSHeaderComponent.class, GSContentComponent.class })
public static class GSTypeAttributesRow extends GSComposite {
}
@BackgroundColor("Orange")
@FlexDirectionStyle(FlexDirection.ROW)
@ChildFlexDirection("row")
@ChildForEach(ObservableListExtractor.ATTRIBUTES_OF_INSTANCES.class)
@ReactorDependencies({ GSHeaderComponent.class, GSContentComponent.class })
public static class GSInstanceAttributesRow extends GSComposite {
}
@BackgroundColor("Brown")
@ChildForEach(ObservableListExtractor.HOLDERS.class)
@ChildReactorDependencies(GSValueComponents2.class)
@MarginRight("1px")
@MarginBottom("1px")
public static class GSHolders extends GSComposite {
}
// @DirectSelect(Power.class)
@BackgroundColor("Purple")
@FlexDirectionStyle(FlexDirection.ROW)
@ChildForEach(ObservableListExtractor.COMPONENTS.class)
@ReactorDependencies({ GSHeaderComponent.class, GSContentComponent.class })
public static class GSValueComponents extends GSComposite {
}
@ChildForEach(ObservableListExtractor.OTHER_COMPONENTS_1.class)
public static class GSValueComponents1 extends GSValueComponents {
}
@BackgroundColor("Yellow")
@ChildForEach(ObservableListExtractor.OTHER_COMPONENTS_2.class)
public static class GSValueComponents2 extends GSValueComponents {
}
@DirectSelect(AudiTT.class)
@ReactorDependencies(GSCell.class)
public static class TestCell extends GSComposite {
}
@DirectSelect(CarColor.class)
public static class GSCell extends GSHolders {
}
@DirectSelect(Car.class)
@ReactorDependencies({ GSHeaderComponent.class, GSContentComponent.class })
@ChildReactorDependencies(decorate = GSHeaderComponent.class, value = GSTypeAttributesRow.class)
@ChildReactorDependencies(GSInstanceAttributesRow.class)
@ChildFlexDirection("row")
@Style(propertyName = "margin", propertyValue = "4px")
public static class GSTypeLabeledInstancesComposite extends GSInstancesComposite {
}
@DirectSelect(Car.class)
@ChildReactorDependencies(decorate = GSHeaderComponent.class, value = GSTypeAttributesRowWithComponents.class)
@ChildReactorDependencies(GSInstanceAttributesRowWithComponents.class)
public static class GSTypeTableInstancesComposite extends GSTypeLabeledInstancesComposite {
}
@Styles.Color("#000000")
@BackgroundColor("purple")
@ChildReactorDependencies(decorate = GSHeaderComponent.class, value = GSValueComponents1.class)
@ChildReactorDependencies(GSValueComponents1.class)
public static class GSTypeAttributesRowWithComponents extends GSTypeAttributesRow {
}
@ChildReactorDependencies(decorate = GSHeaderComponent.class, value = GSValueComponents2.class)
@ChildReactorDependencies(GSHolders.class)
public static class GSInstanceAttributesRowWithComponents extends GSInstanceAttributesRow {
}
@SystemGeneric
@Meta(Car.class)
@StringValue("Audi TT")
public static class AudiTT {
@SystemGeneric
@Meta(Color.class)
@StringValue("green")
public static class Green {
}
@Meta(Power.class)
@IntValue(432)
@SystemGeneric
@Components(AudiTT.class)
public static class AudiTTPower {
}
@Meta(CarColor.class)
@SystemGeneric
@Components({ AudiTT.class, Green.class })
public static class AudiTTGreen {
}
}
public static class Unit {
}
}