Blame view

src/main/kotlin/application/model/ObservableVessel.kt 508 Bytes
b350f9dfe   lsagona   import vessels an...
1
2
3
4
5
6
  package application.model
  
  import kotlin.properties.Delegates
  
  class ObservableVessel {
      val listeners: MutableList<MessageListener> = mutableListOf()
f39d90e60   lsagona   Select/deselect MMSI
7
      var vessels: MutableMap<String?, Vessel> by Delegates.observable(
b350f9dfe   lsagona   import vessels an...
8
          initialValue = mutableMapOf(),
52321443a   lsagona   different color f...
9
          onChange = { _, _, new ->
b350f9dfe   lsagona   import vessels an...
10
              run {
79b001037   lsagona   heat map
11
                  observableSelectedVessel.vessel = Vessel(null)
b350f9dfe   lsagona   import vessels an...
12
13
14
15
16
17
18
19
                  listeners.forEach {
                      it.onValueChanged(new)
                  }
              }
          }
      )
  
  }