45 lines
1.4 KiB
Kotlin
45 lines
1.4 KiB
Kotlin
package dev.fyloz.plannervio.ui
|
|
|
|
import dev.fyloz.plannervio.core.repository.IBoardRepository
|
|
import dev.fyloz.plannervio.core.repository.memory.MemoryBoardRepository
|
|
import dev.fyloz.plannervio.core.service.BackgroundImageService
|
|
import dev.fyloz.plannervio.core.service.BoardService
|
|
import dev.fyloz.plannervio.core.service.IBackgroundImageService
|
|
import dev.fyloz.plannervio.core.service.IBoardService
|
|
import dev.fyloz.plannervio.ui.style.Style
|
|
import dev.fyloz.plannervio.ui.view.MainView
|
|
import org.kodein.di.DI
|
|
import org.kodein.di.DIAware
|
|
import org.kodein.di.bind
|
|
import org.kodein.di.singleton
|
|
import org.kodein.di.tornadofx.installTornadoSource
|
|
import tornadofx.App
|
|
import tornadofx.launch
|
|
import tornadofx.loadFont
|
|
import tornadofx.reloadStylesheetsOnFocus
|
|
|
|
fun main(args: Array<String>) {
|
|
launch<Plannervio>(args)
|
|
}
|
|
|
|
class Plannervio : App(MainView::class, Style::class), DIAware {
|
|
override val di: DI
|
|
get() = DI {
|
|
installTornadoSource()
|
|
|
|
bind<IBoardRepository>() with singleton { MemoryBoardRepository() }
|
|
bind<IBoardService>() with singleton { BoardService(di) }
|
|
bind<IBackgroundImageService>() with singleton { BackgroundImageService() }
|
|
}
|
|
|
|
init {
|
|
loadFonts()
|
|
reloadStylesheetsOnFocus()
|
|
}
|
|
|
|
private fun loadFonts() {
|
|
loadFont("/fonts/biryani/Biryani-Regular.ttf", 12)
|
|
loadFont("/fonts/biryani/Biryani-DemiBold.ttf", 12)
|
|
}
|
|
}
|