Add try/catch NoSuchFileException in FX demo

This commit is contained in:
Peter Klimai 2020-08-08 13:52:20 +03:00
parent 4f8efa0ee0
commit 2f570f2791

View File

@ -3,6 +3,7 @@ package hep.dataforge.vision.solid.demo
import hep.dataforge.vision.solid.gdml.gdml import hep.dataforge.vision.solid.gdml.gdml
import javafx.stage.Stage import javafx.stage.Stage
import tornadofx.* import tornadofx.*
import java.nio.file.NoSuchFileException
import java.nio.file.Paths import java.nio.file.Paths
class FXDemoApp : App(FXDemoGrid::class) { class FXDemoApp : App(FXDemoGrid::class) {
@ -16,11 +17,17 @@ class FXDemoApp : App(FXDemoGrid::class) {
stage.height = 600.0 stage.height = 600.0
view.showcase() view.showcase()
try {
view.demo("gdml", "gdml-cubes") { view.demo("gdml", "gdml-cubes") {
gdml(Paths.get("D:\\Work\\Projects\\gdml.kt\\gdml-source\\cubes.gdml")) gdml(Paths.get("D:\\Work\\Projects\\gdml.kt\\gdml-source\\cubes.gdml"))
//setProperty(Material3D.MATERIAL_WIREFRAME_KEY, true) //setProperty(Material3D.MATERIAL_WIREFRAME_KEY, true)
} }
} }
catch (e: NoSuchFileException) {
println("GDML demo: Please specify the correct file path e.g. " +
"visionforge\\demo\\gdml\\src\\commonMain\\resources\\cubes.gdml")
}
}
} }
fun main() { fun main() {