Blame view

src/main/kotlin/application/App.kt 1.07 KB
f39d90e60   lsagona   Select/deselect MMSI
1
  @file:JvmName("App")
2f45c53df   lsagona   skeleton for user...
2
3
4
  package application
  
  import javafx.application.Application
f15a58907   lsagona   add better chart
5
6
  import javafx.application.Platform
  import javafx.event.EventHandler
2f45c53df   lsagona   skeleton for user...
7
8
9
10
  import javafx.fxml.FXMLLoader
  import javafx.scene.Parent
  import javafx.scene.Scene
  import javafx.stage.Stage
52321443a   lsagona   different color f...
11
12
  import jfxtras.styles.jmetro.JMetro
  import jfxtras.styles.jmetro.Style
f15a58907   lsagona   add better chart
13
  import kotlin.system.exitProcess
2f45c53df   lsagona   skeleton for user...
14

a6a8df6ff   lsagona   add the possibili...
15

2f45c53df   lsagona   skeleton for user...
16
  class App : Application() {
f39d90e60   lsagona   Select/deselect MMSI
17
      var style: Style = Style.LIGHT
2f45c53df   lsagona   skeleton for user...
18
19
  
      override fun start(primaryStage: Stage?) {
b350f9dfe   lsagona   import vessels an...
20
21
          val fxmlLoader = FXMLLoader(App::class.java.getResource("/gui/windows.fxml"))
          val parent: Parent = fxmlLoader.load()
2f45c53df   lsagona   skeleton for user...
22
          val scene = Scene(parent)
52321443a   lsagona   different color f...
23
          JMetro(scene, style)
2f45c53df   lsagona   skeleton for user...
24
25
          primaryStage!!.scene = scene
          primaryStage.title = "Maritime Visualisation"
f15a58907   lsagona   add better chart
26
          primaryStage.onCloseRequest = EventHandler { closeApplication() }
2f45c53df   lsagona   skeleton for user...
27
28
          primaryStage.show()
      }
f15a58907   lsagona   add better chart
29
30
31
32
      private fun closeApplication() {
          Platform.exit()
          exitProcess(0)
      }
2f45c53df   lsagona   skeleton for user...
33
34
35
36
37
38
39
40
      companion object {
          @JvmStatic
          fun main(args: Array<String>) {
              launch(App::class.java)
          }
      }
  
  }