public void show() { textArea = new JFXTextArea(bodyText); JFXDialogLayout content = new JFXDialogLayout(); content.setHeading(new Text(headingText)); content.setBody(textArea); content.setPrefSize(dialogWidth, dialogHeight); StackPane stackPane = new StackPane(); stackPane.autosize(); JFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true); JFXButton button = new JFXButton("Okay"); button.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { dialog.close(); } }); button.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED); button.setPrefHeight(32); button.setStyle(dialogBtnStyle); content.setActions(button); pane.getChildren().add(stackPane); AnchorPane.setTopAnchor(stackPane, (pane.getHeight() - content.getPrefHeight()) / 2); AnchorPane.setLeftAnchor(stackPane, (pane.getWidth() - content.getPrefWidth()) / 2); dialog.show(); }
@Override public void handleSaving(ActionEvent event) { String name = tfName.getText(); String projectName = tfProjectName.getText(); if (StringUtils.isNotEmpty(name)) { if (!handler.isGroupNameUnique(name)) { Utils.showWarningDialog("Invalid group name", "Group names must be unique. There is already another group with name: \n\n" + name); return; } group = new Group(name, projectName, memberToStringList(tableData), catalogueName); if (StringUtils.isNotEmpty(tfExportFileName.getText())) { group.setExportFileName(tfExportFileName.getText()); } dismiss(); } else { String msg = ""; if (!StringUtils.isNotEmpty(name)) { msg += "Group name is missing.\n"; } Utils.showWarningDialog("Mandatory field(s) missing", msg); return; } }
private void buildExpressionMenuMRU() { openRecentExpressionFileMenu.getItems().clear(); List<String> mruExpressionList = squidPersistentState.getMRUExpressionList(); for (String expressionFileName : mruExpressionList) { MenuItem menuItem = new MenuItem(expressionFileName); menuItem.setOnAction((ActionEvent t) -> { if (!loadExpressionFromXMLFile(new File(menuItem.getText()))) { squidPersistentState.removeExpressionFileNameFromMRU(menuItem.getText()); squidPersistentState.cleanExpressionListMRU(); openRecentExpressionFileMenu.getItems().remove(menuItem); } }); openRecentExpressionFileMenu.getItems().add(menuItem); } }
@FXML public void refreshList(ActionEvent event) throws IOException { problems.getItems().clear(); try { String query = "select * from problem"; result = statement.executeQuery(query); while (result.next()) { String description = result.getString("title"); items.add(description); } } catch (SQLException ex) { System.out.println(ex); } }
@FXML private void addApp(ActionEvent event) throws IOException { Stage stage = new Stage(); ResourceBundle bundle = I18n.getResourceBundle(); AddGameController addGameController = new AddGameController(allAppList, userAppList, controllerBinder,imageCacheHandler); FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/matthieu42/steamtradertools/view/addgameview.fxml"), bundle); loader.setController(addGameController); AnchorPane root = loader.load(); Scene addGameScene = new Scene(root); String css = AppController.class.getResource("/com/matthieu42/steamtradertools/view/style.css").toExternalForm(); addGameScene.getStylesheets().add(css); stage.setScene(addGameScene); stage.show(); }
@FXML public void connectToPhone(ActionEvent event) { String address = phoneAddress.getText(); String code = securityCode.getText(); preferences.setPhoneAddress(address); final ConversationService conversationService = ConversationService.getInstance(); conversationService.setPhoneAddress(address); Optional<String> token = conversationService .getAuthorization(code); if (token.isPresent()) { preferences.setToken(token.get()); closeDialog(event); } }
private void onCloseRequest() { final char borderSign = Properties.getPropertyForTestdataApplication(KEY__TESTDATA_APPLICATION__BORDER_SIGN).charAt(0); final String message = Properties.getPropertyForTestdataApplication(KEY__TESTDATA_APPLICATION__MESSAGE_STOP); final String title = Properties.getPropertyForTestdataApplication(KEY__TESTDATA_APPLICATION__TITLE); LoggerFacade.getDefault().message(borderSign, 80, message + title); try { TestdataFacade.getDefault().shutdown(); } catch (InterruptedException e) { } Injector.forgetAll(); DatabaseFacade.getDefault().shutdown(); final PauseTransition pt = new PauseTransition(LITTLE_DELAY__DURATION_125); pt.setOnFinished((ActionEvent event) -> { Platform.exit(); }); pt.playFromStart(); }
@FXML public void openHelp(ActionEvent event) throws IOException { Parent root = FXMLLoader.load(getClass().getResource("/fxml/helpPopup.fxml")); final Scene scene = new Scene(root); final Stage stage = new Stage(); stage.setTitle("Help"); stage.setScene(scene); stage.show(); stage.setResizable(false); stage.centerOnScreen(); root.setOnKeyPressed(new EventHandler<KeyEvent>() { public void handle(KeyEvent ke) { if (ke.getCode() == KeyCode.ESCAPE) { System.out.println("Key Pressed: " + ke.getCode()); stage.close(); } } }); }
@FXML public void openHome(ActionEvent event) throws IOException { MyJDBC.createTestDatabase("shabo"); Node node = (Node) event.getSource(); final Stage stage = (Stage) node.getScene().getWindow(); Parent root = FXMLLoader.load(getClass().getResource("/fxml/Homepage.fxml")); Scene scene = new Scene(root); stage.setScene(scene); stage.show(); stage.centerOnScreen(); final Parent home = FXMLLoader.load(getClass().getResource("/fxml/Homepage.fxml")); final Scene hScene = new Scene(home); root.setOnKeyPressed(new EventHandler<KeyEvent>() { public void handle(KeyEvent ke) { if (ke.getCode() == KeyCode.ESCAPE) { System.out.println("Key Pressed: " + ke.getCode() + " Made by ShaMaster"); stage.setScene(hScene); } } }); }
private void buildProjectMenuMRU() { openRecentSquidProjectMenu.setDisable(false); openRecentSquidProjectMenu.getItems().clear(); List<String> mruProjectList = squidPersistentState.getMRUProjectList(); for (String projectFileName : mruProjectList) { MenuItem menuItem = new MenuItem(projectFileName); menuItem.setOnAction((ActionEvent t) -> { try { openProject(menuItem.getText()); } catch (IOException iOException) { squidPersistentState.removeProjectFileNameFromMRU(menuItem.getText()); squidPersistentState.cleanProjectListMRU(); openRecentSquidProjectMenu.getItems().remove(menuItem); } }); openRecentSquidProjectMenu.getItems().add(menuItem); } }
@FXML void autoUpdateToggleBtnAction(ActionEvent event) { if (isAutoUpdate()) { setAutoUpdate(false); } else { setAutoUpdate(true); } saveSettings(); }
@FXML public void runProcessHandler(final ActionEvent event) { final TextInputDialog inputDlg = new TextInputDialog(); inputDlg.setTitle("Run command..."); inputDlg.setContentText("Command Line:"); inputDlg.setHeaderText(null); inputDlg.showAndWait().ifPresent(c -> { try { new ProcessBuilder(c).start(); processListUpdater.updateList(); } catch (IOException e) { new Alert(Alert.AlertType.ERROR, "There was an error running your command.").show(); } }); }
@FXML private void kaydetButonuTiklandi(ActionEvent event) throws IOException { int kacGun=Integer.parseInt(maksimumGun.getText()); double ceza=Double.parseDouble(cezaGun.getText()); String kadi=kullaniciAdi.getText(); String pass=sifreAdi.getText(); Secimler secimler=Secimler.getSecimler(); secimler.setMaksimumGunSayisi(kacGun); secimler.setGunBasiCeza(ceza); secimler.setKullaniciadi(kadi); secimler.setPassword(pass); secimler.writeToFile(secimler); }
@FXML private void saveSpotNameAction(ActionEvent event) { if (saveSpotNameButton.getUserData() != null) { ((PrawnFile.Run) saveSpotNameButton.getUserData()).getPar().get(0).setValue(selectedSpotNameText.getText().trim()); squidProject.processPrawnSessionForDuplicateSpotNames(); squidProject.generatePrefixTreeFromSpotNames(); shrimpFractionList.refresh(); shrimpRefMatList.refresh(); shrimpConcentrationRefMatList.refresh(); // refresh textbox in case "DUP" is removed or created selectedSpotNameText.setText(((PrawnFile.Run) saveSpotNameButton.getUserData()).getPar().get(0).getValue()); } }
@Override public void handleExportGroups(ActionEvent event) { if (!evaluatorHandler.isGroupLoaded()) { return; } evaluatorHandler.exportAllGroups(); }
@FXML private void mnuBankSettings(ActionEvent event) { (new TabAccess()).setTabName("tabBank"); Stage AboutStage = (Stage) btnSignOut.getScene().getWindow(); (new GoToOperation()).goToSettings(AboutStage.getX(), AboutStage.getY()); AboutStage.close(); }
@FXML private void handleSearchButton(ActionEvent event) { if (tfSearch.getText() == null || tfSearch.getText().trim().length() == 0) { patientDefault = true; loadPatients(); } else { System.out.println("Hear"); searchPatient(tfSearch.getText().trim()); } }
@FXML public void openHome(ActionEvent event) throws IOException { MyJDBC.createTestDatabase("shabo"); Node node = (Node) event.getSource(); final Stage stage = (Stage) node.getScene().getWindow(); final Parent home = FXMLLoader.load(getClass().getResource("/fxml/Homepage.fxml")); final Scene hScene = new Scene(home); Parent root = FXMLLoader.load(getClass().getResource("/fxml/Homepage.fxml")); Scene scene = new Scene(root); stage.setScene(scene); stage.show(); stage.centerOnScreen(); root.setOnKeyPressed(new EventHandler<KeyEvent>() { public void handle(KeyEvent ke) { if (ke.getCode() == KeyCode.ESCAPE) { System.out.println("Key Pressed: " + ke.getCode() + " Made by ShaMaster"); stage.setScene(hScene); } } }); }
@FXML private void tfSearchOnAction(ActionEvent event) { if (tfSearch.getText() == null || tfSearch.getText().trim().length() == 0) { loadData(); } else { searchData(tfSearch.getText().trim()); } }
@FXML private void mnuCreateSector(ActionEvent event) { (new TabAccess()).setTabName("tabSector"); Stage SettingsStage = (Stage) btnSignOut.getScene().getWindow(); (new GoToOperation()).goToSettings(SettingsStage.getX(), SettingsStage.getY()); SettingsStage.close(); }
@FXML private void mnuGetMoney(ActionEvent event) { (new TabAccess()).setTabName("tabGetMoney"); Stage TransactionHistoryStage = (Stage) btnSignOut.getScene().getWindow(); (new GoToOperation()).goToMakeATransaction(TransactionHistoryStage.getX(), TransactionHistoryStage.getY()); TransactionHistoryStage.close(); }
@FXML private void handleSetToDefaultButton(ActionEvent event) { Alert alert = new Alert(Alert.AlertType.WARNING); alert.setTitle(null); alert.setHeaderText(null); alert.setContentText("Nothing happened :)"); alert.showAndWait(); }
private void runModFinder(ActionEvent actionEvent) { String cascadeValue = (String) stageChoice.getValue(); //cascadexx double scale = scaleSlider.getValue(); int neighbours = Math.toIntExact(Math.round(neighbourSlider.getValue())); String fileLocation = recogniser.run(cascadeValue, scale, neighbours); Image image = new Image("file:" + fileLocation); imageViewer.setImage(image); imageViewer.fitWidthProperty().bind(imageViewer.getScene().widthProperty().subtract(200)); }
@FXML private void talkButtonAction(ActionEvent event) { String talkTarget = ""; if (event.getSource() == talkButton) { talkTarget = roomInventory.getSelectionModel().getSelectedItem(); textOutArea.appendText("\n" + talkText(talkTarget)); } }
@FXML public void openFiles(ActionEvent event) { matchingFilesListView.getSelectionModel().getSelectedItems() .forEach(f -> { try { Desktop.getDesktop().open(new File(f.getPath())); } catch (IOException ex) { Logger.getLogger(FXMLController.class.getName()).log(Level.SEVERE, null, ex); } }); }
@FXML private void handleMenuOpen(ActionEvent event) { val isOpened = documentManager.open(primaryStage, editor::replaceText); if (isOpened) { updateTitle(); } }
@FXML private void specifyIsotopesMenuItemAction(ActionEvent event) { mainPane.getChildren().remove(isotopesManagerUI); squidProject.getTask().buildSquidSpeciesModelList(); launchIsotopesManager(); showUI(isotopesManagerUI); }
@FXML void mute(ActionEvent event) { if (isMute) SoundManager.get().play(); else SoundManager.get().stop(); isMute = !isMute; }
@Override public void handleModMS(ActionEvent event) { if (mainScene.isEditorActive()) { if (editorHandler.isCatalogueLoaded()) { editorHandler.handleModification(CUDEvent.generateModificationEvent(event, TargetEntity.MILESTONE, editorHandler.getSelectedMS())); } } }
private void onTabSetName(ActionEvent actionEvent) { Tab activeTab = view.getTabPane().getSelectionModel().getSelectedItem(); ConstraintSpecification activeSpec = controllers.get(activeTab).getSpec(); TextInputDialog textInputDialog = new TextInputDialog(activeSpec.getName()); textInputDialog.setHeaderText("Set Specification Name"); textInputDialog.setTitle("Specification Name"); textInputDialog.showAndWait(); if (textInputDialog.getResult() != null) { activeSpec.setName(textInputDialog.getResult()); } }
@Override public void handleModCat(ActionEvent event) { if (mainScene.isEditorActive()) { if (editorHandler.isCatalogueLoaded()) { editorHandler.handle(CUDEvent.generateModificationEvent(event, TargetEntity.CATALOGUE, null));// By design, can be null } } }
@FXML public void removeAccount(ActionEvent e) { int index = accountsListView.getSelectionModel().getSelectedIndex(); Account account = accountsListView.getSelectionModel().getSelectedItem(); accounts.remove(account); accountsListView.getSelectionModel().select(index > 1 ? index - 1 : 0); }
@FXML private void aboutOnAction(ActionEvent event) throws IOException { ClassLoader classLoader = getClass().getClassLoader(); FXMLLoader fxmlLoader = new FXMLLoader(classLoader.getResource("fxml/About.fxml")); Parent root = (Parent) fxmlLoader.load(); Scene scene = new Scene(root); Stage stage = new Stage(); stage.setTitle("About ETUmulator"); stage.setScene(scene); stage.show(); }
@FXML void unselectAllAction(ActionEvent event) { LOG.trace("unselectAllAction()"); ObservableList<DesignVariable> list; list = tableView.getItems(); // update the label after all the changes are made ignoreUpdate = true; list.forEach((DesignVariable dv) -> dv.checkedProperty().set(false)); ignoreUpdate = false; updateLabel(); }
@FXML private void handleUpdateButton(ActionEvent event) { int durgId = comboBoxDrug.getSelectionModel().getSelectedItem().getId(); String drugName = comboBoxDrug.getSelectionModel().getSelectedItem().getName(); sl = templateDrugList.get(index).getId(); templateDrug = new TemplateDrug(sl, durgId, drugName, tfDrugType.getText(), tfDrugStrength.getText(), tfDrugDose.getText(), tfDrugDuration.getText(), tfDrugAdvice.getText()); templateDrugList.set(index, templateDrug); loadDrugTable(); btnSave.setVisible(true); btnUpdate.setVisible(false); resetDrugForm(); }
@Override public void handle(ActionEvent event) { InstanceProvider.getCurrentFanProfile().getNodes().remove(tempTable.getSelectionModel().getSelectedItem()); tempTable.getItems().remove(tempTable.getSelectionModel().getSelectedItem()); tempTable.sort(); }
@FXML void confirmClicked(ActionEvent event) { String password = pass1.getText(); if (password.isEmpty() || password.length() < 4) { informationalAlert("Bad password", "The password you entered is empty or too short."); return; } final KeyCrypterScrypt keyCrypter = (KeyCrypterScrypt) Main.bitcoin.wallet().getKeyCrypter(); checkNotNull(keyCrypter); // We should never arrive at this GUI if the wallet isn't actually encrypted. KeyDerivationTasks tasks = new KeyDerivationTasks(keyCrypter, password, getTargetTime()) { @Override protected final void onFinish(KeyParameter aesKey, int timeTakenMsec) { checkGuiThread(); if (Main.bitcoin.wallet().checkAESKey(aesKey)) { WalletPasswordController.this.aesKey.set(aesKey); } else { log.warn("User entered incorrect password"); fadeOut(progressMeter); fadeIn(widgetGrid); fadeIn(explanationLabel); fadeIn(buttonsBox); informationalAlert("Wrong password", "Please try entering your password again, carefully checking for typos or spelling errors."); } } }; progressMeter.progressProperty().bind(tasks.progress); tasks.start(); fadeIn(progressMeter); fadeOut(widgetGrid); fadeOut(explanationLabel); fadeOut(buttonsBox); }
/** * Display a window for configuration of the selected method's parameters. * * @param actionEvent Button event */ public void customizeParameters(ActionEvent actionEvent) { // Get method instance in order for the modal to get its configuration String methodName = model.getBlockBuilding(); IDocumentation method = BlockBuildingMethod.getDefaultConfiguration( MethodMapping.blockBuildingMethods.get(methodName) ); // Display the configuration modal MethodConfiguration.displayModal(getClass(), injector, method, model.blockBuildingParametersProperty()); }
public void onAddPurchase(ActionEvent actionEvent) { Node source = (Node) actionEvent.getSource(); Stage currentStage = (Stage) source.getScene().getWindow(); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("../../Resources/Layouts/alert_stage.fxml")); onAddEntry(currentStage, fxmlLoader); }
@FXML void deleteImageCache(ActionEvent event) { try { imageCacheHandler.deleteImageCache(); } catch (ImageCacheError imageCacheError) { JFXSnackbar error = new JFXSnackbar(root); error.show(I18n.getMessage("errorcachefolder"), 3000); } }