Roman Elizarov | 660c2d7 | 2020-02-14 13:18:37 +0300 | [diff] [blame] | 1 | // This file was automatically generated from ${file.name} by Knit tool. Do not edit. |
| 2 | package ${knit.package}.${knit.name} |
| 3 | |
| 4 | import kotlinx.coroutines.* |
| 5 | import kotlinx.coroutines.channels.* |
| 6 | import kotlinx.coroutines.javafx.JavaFx as Main |
| 7 | import javafx.application.Application |
| 8 | import javafx.event.EventHandler |
| 9 | import javafx.geometry.* |
| 10 | import javafx.scene.* |
| 11 | import javafx.scene.input.MouseEvent |
| 12 | import javafx.scene.layout.StackPane |
| 13 | import javafx.scene.paint.Color |
| 14 | import javafx.scene.shape.Circle |
| 15 | import javafx.scene.text.Text |
| 16 | import javafx.stage.Stage |
| 17 | |
| 18 | fun main(args: Array<String>) { |
| 19 | Application.launch(ExampleApp::class.java, *args) |
| 20 | } |
| 21 | |
| 22 | class ExampleApp : Application() { |
| 23 | val hello = Text("Hello World!").apply { |
| 24 | fill = Color.valueOf("#C0C0C0") |
| 25 | } |
| 26 | |
| 27 | val fab = Circle(20.0, Color.valueOf("#FF4081")) |
| 28 | |
| 29 | val root = StackPane().apply { |
| 30 | children += hello |
| 31 | children += fab |
| 32 | StackPane.setAlignment(hello, Pos.CENTER) |
| 33 | StackPane.setAlignment(fab, Pos.BOTTOM_RIGHT) |
| 34 | StackPane.setMargin(fab, Insets(15.0)) |
| 35 | } |
| 36 | |
| 37 | val scene = Scene(root, 240.0, 380.0).apply { |
| 38 | fill = Color.valueOf("#303030") |
| 39 | } |
| 40 | |
| 41 | override fun start(stage: Stage) { |
| 42 | stage.title = "Example" |
| 43 | stage.scene = scene |
| 44 | stage.show() |
| 45 | setup(hello, fab) |
| 46 | } |
| 47 | } |