-
Notifications
You must be signed in to change notification settings - Fork 5
/
AppHtml5.java
236 lines (202 loc) · 9.35 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
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.Parent;
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.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.GSCell.GSSubcell;
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.GSTypeLabeledInstancesComposite.GSHeaderComponent_;
import org.genericsystem.reactor.example.AppHtml5.GSTypeLabeledInstancesComposite.GSHeaderComponent_.GSTypeAttributesRow_;
import org.genericsystem.reactor.example.AppHtml5.GSValueComponents;
import org.genericsystem.reactor.example.AppHtml5.TestCell;
import org.genericsystem.reactor.example.AppHtml5.TestCell.GSCell_;
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 org.genericsystem.reactor.az3.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 })
// PB here, the parent is not exactly le good ... that change behavior of parent search annotation @ParentReactorDependency
@Parent(GSContentComponent.class)
public static class GSInstanceAttributesRow extends GSComposite {
}
@BackgroundColor("Brown")
@ChildForEach(ObservableListExtractor.HOLDERS.class)
@ReactorDependencies({ GSContentComponent.class })
public static class GSHolders extends GSComposite {
}
@DirectSelect(Power.class)
@BackgroundColor("Yellow")
@FlexDirectionStyle(FlexDirection.ROW)
@ChildForEach(ObservableListExtractor.COMPONENTS.class)
@ReactorDependencies({ GSHeaderComponent.class, GSContentComponent.class })
public static class GSValueComponents extends GSComposite {
}
@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 {
}
}
@DirectSelect(AudiTT.class)
@ReactorDependencies(GSCell_.class)
public static class TestCell extends GSComposite {
@DirectSelect(CarColor.class)
public static class GSCell_ extends GSCell {
}
}
// @org.genericsystem.reactor.annotations.ReactorDependencies(GSCellContentComponent.class)
// public static class GSCell extends GSHolders {
// @org.genericsystem.reactor.annotations.ReactorDependencies({ GSSubcell.class })
// public static class GSCellContentComponent extends GSContentComponent {
// public static class GSSubcell extends GSValueComponents {
//
// }
// }
// }
@ChildReactorDependencies(GSSubcell.class)
public static class GSCell extends GSHolders {
@Parent(GSContentComponent.class)
public static class GSSubcell extends GSValueComponents {
}
}
@DirectSelect(Car.class)
@ReactorDependencies({ GSHeaderComponent_.class, GSInstanceAttributesRow.class })
@ChildReactorDependencies(GSInstanceAttributesRow.class)
@ChildFlexDirection("row")
public static class GSTypeLabeledInstancesComposite extends GSInstancesComposite {
@org.genericsystem.reactor.annotations.ReactorDependencies({ GSTypeAttributesRow_.class })
public static class GSHeaderComponent_ extends GSHeaderComponent {
public static class GSTypeAttributesRow_ extends GSTypeAttributesRow {
}
}
// @Parent(GSContentComponent.class)
// @ChildReactorDependencies(GSContentComponent.class)
// public static class GSInstanceAttributesRow_ extends GSInstanceAttributesRow {
//
// }
// @org.genericsystem.reactor.annotations.ReactorDependencies({ GSInstanceAttributesRow_.class })
// public static class GSInstanceContentComponent_ extends GSContentComponent {
// public static class GSInstanceAttributesRow_ extends GSInstanceAttributesRow {
//
// }
// }
}
@SystemGeneric
@Components(Power.class)
@StringValue("Unit")
public static class Unit {
}
// @org.genericsystem.reactor.annotations.DirectSelect(Car.class)
// @org.genericsystem.reactor.annotations.ReactorDependencies({ GSHeaderComponent_.class, GSInstanceContentComponent__.class })
// @ChildReactorDependencies(GSInstanceContentComponent__.class)
// public static class GSTypeTableInstancesComposite extends GSTypeLabeledInstancesComposite {
// @org.genericsystem.reactor.annotations.ReactorDependencies({ GSInstanceAttributesRow__.class })
// public static class GSInstanceContentComponent__ extends GSInstanceContentComponent_ {
// @org.genericsystem.reactor.annotations.ReactorDependencies({ GSInstanceNameComponent.class, GSHoldersContentComponent.class })
// public static class GSInstanceAttributesRow__ extends GSInstanceAttributesRow_ {
// @org.genericsystem.reactor.annotations.ReactorDependencies(GSInstanceNameSubcell_.class)
// public static class GSInstanceNameComponent extends GSHeaderComponent {
// @BackgroundColor("Orange")
// public static class GSInstanceNameSubcell_ extends GSValueComponents {
//
// }
// }
//
// @org.genericsystem.reactor.annotations.ReactorDependencies({ GSCell__.class })
// public static class GSHoldersContentComponent extends GSContentComponent {
// public static class GSCell__ extends GSCell {
//
// }
// }
// }
// }
// }
}