-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path002_Simple_application_code_ui.java
45 lines (43 loc) · 1.6 KB
/
002_Simple_application_code_ui.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
package proto;
import org.rubber.framework.*;
import org.rubber.framework.yaml.*;
import org.rubber.framework.css.*;
import org.rubber.framework.ui.*;
import org.rubber.framework.window.*;
import org.rubber.framework.data.*;
import org.rubber.framework.input.*;
class Zygote {
public static void main(String[] args) {
new Application(
new PrimaryMonitor(
new Monitors(),
new Window(
new WindowCenterPos(),
new WindowAutoSize(),
new WindowTitle("Hello World!"),
new Root(
new Component(
new Content(
new FlexBox(
new TextBlock(
new StyleId("text"),
new Text("Count: {}"),
new FormattingBinding(() -> List.of(vm.count))
),
new Button(
new StyleId("increment"),
new Text("increment"),
new CommandBinding(() -> vm.increment)
)
)
),
new Stylesheet("home.css"),
new HomeViewModel()
)
)
)
),
new ApplicationArgs(args)
).go();
}
}