/** * Inizializes the filechooser that loads the pdbfile * * @param primaryStage */ public void setOpenFileEvent(Stage primaryStage) { openItem.setOnAction( value -> { File selectedFile = fileChooser.showOpenDialog(primaryStage); if (selectedFile.exists() && !selectedFile.isDirectory()) { try { onPdbFileOpened(selectedFile); } catch (IOException e) { e.printStackTrace(); } } }); }
/** * Set action that happens on button "close" press * * @param primaryStage */ public void setOnCloseEvent(Stage primaryStage) { closeItem.setOnAction(value -> primaryStage.close()); }