From 2f570f27914ef07c4ff34c29c55c066c420d1e9e Mon Sep 17 00:00:00 2001 From: Peter Klimai Date: Sat, 8 Aug 2020 13:52:20 +0300 Subject: [PATCH] Add try/catch NoSuchFileException in FX demo --- .../hep/dataforge/vision/solid/demo/FXDemoApp.kt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/demo/spatial-showcase/src/jvmMain/kotlin/hep/dataforge/vision/solid/demo/FXDemoApp.kt b/demo/spatial-showcase/src/jvmMain/kotlin/hep/dataforge/vision/solid/demo/FXDemoApp.kt index 51da0f98..a0c05d29 100644 --- a/demo/spatial-showcase/src/jvmMain/kotlin/hep/dataforge/vision/solid/demo/FXDemoApp.kt +++ b/demo/spatial-showcase/src/jvmMain/kotlin/hep/dataforge/vision/solid/demo/FXDemoApp.kt @@ -3,6 +3,7 @@ package hep.dataforge.vision.solid.demo import hep.dataforge.vision.solid.gdml.gdml import javafx.stage.Stage import tornadofx.* +import java.nio.file.NoSuchFileException import java.nio.file.Paths class FXDemoApp : App(FXDemoGrid::class) { @@ -16,9 +17,15 @@ class FXDemoApp : App(FXDemoGrid::class) { stage.height = 600.0 view.showcase() - view.demo("gdml", "gdml-cubes") { - gdml(Paths.get("D:\\Work\\Projects\\gdml.kt\\gdml-source\\cubes.gdml")) - //setProperty(Material3D.MATERIAL_WIREFRAME_KEY, true) + try { + view.demo("gdml", "gdml-cubes") { + gdml(Paths.get("D:\\Work\\Projects\\gdml.kt\\gdml-source\\cubes.gdml")) + //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") } } }