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
15
  
  class App : Application() {
f39d90e60   lsagona   Select/deselect MMSI
16
      var style: Style = Style.LIGHT
2f45c53df   lsagona   skeleton for user...
17
18
  
      override fun start(primaryStage: Stage?) {
b350f9dfe   lsagona   import vessels an...
19
20
          val fxmlLoader = FXMLLoader(App::class.java.getResource("/gui/windows.fxml"))
          val parent: Parent = fxmlLoader.load()
2f45c53df   lsagona   skeleton for user...
21
          val scene = Scene(parent)
52321443a   lsagona   different color f...
22
          JMetro(scene, style)
2f45c53df   lsagona   skeleton for user...
23
24
          primaryStage!!.scene = scene
          primaryStage.title = "Maritime Visualisation"
f15a58907   lsagona   add better chart
25
          primaryStage.onCloseRequest = EventHandler { closeApplication() }
2f45c53df   lsagona   skeleton for user...
26
27
          primaryStage.show()
      }
f15a58907   lsagona   add better chart
28
      private fun closeApplication() {
e220e082b   lsagona   graph binded to s...
29

f15a58907   lsagona   add better chart
30
31
32
          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)
          }
      }
  
  }