use of com.cas.sim.tis.view.controller.DrawingController in project TeachingInSimulation by ScOrPiOzzy.
the class TypicalCaseBtnController method showDrawingWin.
@FXML
private void showDrawingWin(ActionEvent event) {
((Button) event.getSource()).setDisable(true);
try {
if (drawingWin == null) {
drawingWin = new Stage();
drawingWin.initStyle(StageStyle.TRANSPARENT);
drawingWin.setX(GUIState.getStage().getX() + 100);
drawingWin.setY(GUIState.getStage().getY() + 100);
FXMLLoader loader = new FXMLLoader();
loader.setResources(ResourceBundle.getBundle("i18n/messages"));
Region root = loader.load(TypicalCaseBtnController.class.getResourceAsStream("/view/jme/Drawing.fxml"));
DrawingController controller = loader.getController();
controller.setStage(drawingWin);
controller.setUI(typicalCase3D);
Scene scene = new Scene(root);
drawingWin.setScene(scene);
drawingWin.setOnHidden(e -> {
((Button) event.getSource()).setDisable(false);
});
}
drawingWin.show();
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations