jvmMain.plot.MonolithicAwt.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lets-plot-common Show documentation
Show all versions of lets-plot-common Show documentation
Lets-Plot JVM package without rendering part
/*
* Copyright (c) 2019. JetBrains s.r.o.
* Use of this source code is governed by the MIT license that can be found in the LICENSE file.
*/
package jetbrains.datalore.plot
import jetbrains.datalore.base.geometry.DoubleVector
import jetbrains.datalore.base.unsupported.UNSUPPORTED
import jetbrains.datalore.plot.builder.PlotContainer
import jetbrains.datalore.vis.svg.SvgSvgElement
import javax.swing.JComponent
object MonolithicAwt {
fun buildPlotFromRawSpecs(
plotSpec: MutableMap,
plotSize: DoubleVector?,
plotMaxWidth: Double?,
svgComponentFactory: (svg: SvgSvgElement) -> JComponent,
executor: (() -> Unit) -> Unit,
computationMessagesHandler: ((List) -> Unit)
): JComponent {
return AwtPlotFactoryUtil.buildPlotFromRawSpecs(
plotSpec,
plotSize,
plotMaxWidth,
svgComponentFactory, executor,
computationMessagesHandler
)
}
fun buildPlotFromProcessedSpecs(
plotSpec: MutableMap,
plotSize: DoubleVector?,
plotMaxWidth: Double?,
svgComponentFactory: (svg: SvgSvgElement) -> JComponent,
executor: (() -> Unit) -> Unit,
computationMessagesHandler: ((List) -> Unit)
): JComponent {
return AwtPlotFactoryUtil.buildPlotFromProcessedSpecs(
plotSpec,
plotSize,
plotMaxWidth,
svgComponentFactory, executor,
computationMessagesHandler
)
}
fun buildPlotComponent(
plotContainer: PlotContainer,
svgComponentFactory: (svg: SvgSvgElement) -> JComponent,
executor: (() -> Unit) -> Unit
): JComponent {
return AwtPlotFactoryUtil.buildPlotComponent(
plotContainer,
svgComponentFactory, executor
)
}
/**
* Static SVG export
*/
@Deprecated(
level = DeprecationLevel.ERROR,
message = "was replaced with PlotSvgExport.buildSvgImageFromRawSpecs",
replaceWith = ReplaceWith(
expression = "PlotSvgExport.buildSvgImageFromRawSpecs(plotSpec, plotSize)",
imports = ["jetbrains.datalore.plot.PlotSvgExport"]
)
)
fun buildSvgImagesFromRawSpecs(
@Suppress("UNUSED_PARAMETER") plotSpec: MutableMap,
@Suppress("UNUSED_PARAMETER") plotSize: DoubleVector?,
@Suppress("UNUSED_PARAMETER") computationMessagesHandler: ((List) -> Unit)
): List {
UNSUPPORTED("was replaced with PlotSvgExport.buildSvgImageFromRawSpecs")
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy