jvmMain.org.jetbrains.letsPlot.intern.settings.DefaultFrontendContext.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lets-plot-kotlin-kernel Show documentation
Show all versions of lets-plot-kotlin-kernel Show documentation
Lets-Plot Kotlin API without dependencies.
/*
* Copyright (c) 2022. JetBrains s.r.o.
* Use of this source code is governed by the MIT license that can be found in the LICENSE file.
*/
package org.jetbrains.letsPlot.intern.settings
import org.jetbrains.letsPlot.FrontendContext
import org.jetbrains.letsPlot.frontend.DefaultSwingBatikFrontendContext
import org.jetbrains.letsPlot.frontend.DefaultSwingJfxFrontendContext
actual fun createDefaultFrontendContext(): FrontendContext {
return DefaultSwingBatikFrontendContext.tryCreate()
?: DefaultSwingJfxFrontendContext.tryCreate()
?: object : FrontendContext {
override fun display(plotSpecRaw: MutableMap) {
throw IllegalStateException(
"""
The frontend context is not defined.
To define the frontend context please select one of the following options:
a. Add "lets-plot-batik-.jar" to your classpath.
b. Add "lets-plot-jfx-.jar" to your classpath.
c. Specify the frontend context explicitly: "LetsPlot.frontendContext = ..."
""".trimIndent()
)
}
}
}