All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.org.jetbrains.letsPlot.intern.settings.DefaultFrontendContext.kt Maven / Gradle / Ivy

There is a newer version: 4.8.0
Show newest version
/*
 * 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()
                )
            }
        }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy