@FXML private void handleMouseClicked(MouseEvent mouseEvent) { if(mouseEvent.getClickCount() == 1){ try{ TreeItem<String> item = treeview.getSelectionModel().getSelectedItem(); Fx1.CurrDirName = item.getValue(); System.out.println("Selected Text : " + item.getValue()); Fx1.CurrDirFile = new File(Fx1.FindAbsolutePath(item,item.getValue())); Fx1.CurrDirStr = Fx1.CurrDirFile.getAbsolutePath(); label.setText(Fx1.CurrDirStr); Fx2.tableview.getItems().clear(); Fx2.CreateTableView(); Fx3.CreateTiles(); /**tableview.getItems().clear(); CreateTableView(); /**call some other function to activate createtableview() in corres controller */ }catch(Exception x){ System.out.println(x.getMessage()); } } //Fx2.tableview.getItems().clear(); //Fx2.CreateTableView(); }
@FXML private void onBtnChangePiccKeyClicked(ActionEvent event) { try { SmartcardIoTransmitter transmitter = SmartcardIoTransmitter.create(); ApduSession session = new ApduSession(); session.nextCommands(new GetVersion()); session.transmit(transmitter); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("fxml/ChangePiccKey.fxml")); Parent root = (Parent)fxmlLoader.load(); ChangePiccKeyController controller = fxmlLoader.<ChangePiccKeyController>getController(); String curr_key = checkUseKeyDiv() ? edDiversificationKey.getText() : (edNoDivKey.isDisable()?"":edNoDivKey.getText()); controller.setSession(session, historyData, checkUseKeyDiv(), curr_key, cbTypes.getValue().equals("AES")); Stage stage = new Stage(); stage.setTitle("Change PICC Key"); stage.setScene(new Scene(root, 450, 300)); stage.showAndWait(); } catch (Exception e) { lbResultTabApp.setText(e.getMessage()); } }
@FXML private void gmAmountValidation() { if (!validAmount(gmtxtAmount.getText())) { if (!gmtxtAmount.getText().isEmpty()) { gmlblWarningMsg.setText(InvalidInput); gmtxtAmount.clear(); } } else { gmlblWarningMsg.setText(" "); try { gmUpdateBalanceShow(); } catch (Exception e) { e.printStackTrace(); } } }
@FXML private void onNextButtonClicked() { // Prevent proceeding when no rooms are selected if(selectedRooms.size() <= 0) { return; } Object temp = ScreenManager.getInstance().switchToScreen("/fxml/PlaceBookingScreen.fxml"); PlaceBookingScreenController controller = (PlaceBookingScreenController) temp; Map<RoomCategory, Integer> roomsData = new HashMap<>(); LocalDate checkInDate = checkInDatePicker.getValue(); LocalDate checkOutDate = checkOutDatePicker.getValue(); selectedRooms.forEach((r) -> { roomsData.merge(r.getRoomCategory(), 1, Integer::sum); }); controller.initializeData(roomsData, this.packageQtys, checkInDate, checkOutDate); }
@FXML private void emailcheck(KeyEvent k) { String c=k.getCharacter(); if(c.equals(" ")) { k.consume(); } String EMAIL_REGEX = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$"; if(userNameTF.getText().matches(EMAIL_REGEX)) { validateFalseLabel.setVisible(false); validateTrueLabel.setVisible(true); validateTrueLabel.setText("Kindly click on Login"); b=true; } else { validateTrueLabel.setVisible(false); validateFalseLabel.setVisible(true); validateFalseLabel.setText("Invalid E-Mail Format"); b=false; } }
@FXML void romTFBtnAction(ActionEvent event) { File romDirectory = directoryChooser.showDialog(main.getPrimaryStage()); if (romDirectory == null) { LOGGER.info("No Directory selected"); } else { setRomPath(romDirectory.getAbsolutePath()); saveSettings(); cemuTextField.setText(getCemuPath()); try { Runtime.getRuntime().exec("java -jar cemu_UI.jar"); // start again System.exit(0); // finishes itself } catch (IOException e) { LOGGER.error("an error occurred", e); } } }
@FXML private void processDot(ActionEvent event) { //Impede que pontos (vírgula) sejam concatenados como resultado de uma operação if (start) { output.setText(""); start = false; } //Impede que o ponto (vírgula) seja clicada mais de uma vez if (dot) { return; } //Impede que inicie um número clicando no ponto (vírgula) if (!number1Value) { return; } String value = ((Button) event.getSource()).getText(); output.setText(output.getText() + value); dot = true; }
@FXML private void handleButtonBrowseGoogleFit(ActionEvent event) { Stage stage = (Stage) ap.getScene().getWindow(); File lastPath = new File(prefs.get(Constants.IMPORTER_GOOGLE_FIT_IMPORT_PATH_KEY + 0, "")); FileChooser fileChooser = new FileChooser(); configureFileChooser(fileChooser, lastPath, Constants.CSV_EXTENSION_FILTER); List<File> files = fileChooser.showOpenMultipleDialog(stage); if (files != null && !files.isEmpty()) { StringBuilder sb = new StringBuilder(); files.forEach((item) -> { sb.append(item.getAbsolutePath()).append(Constants.MULTI_FILE_PATH_DELIMITER); }); googleFitTextField.setText(sb.toString().substring(0, sb.length() - 1)); googleFitCheckBox.setSelected(true); } }
@FXML @Override protected boolean cancel() { String pointRef = (initEventDutyDTO.getPoints() != null)? String.valueOf(initEventDutyDTO.getPoints()) : "0.0"; if(!name.getText().equals(initEventDutyDTO.getName()) || !description.getText().equals(initEventDutyDTO.getDescription()) || !date.getValue().equals(initEventDutyDTO.getEndTime().toLocalDateTime().toLocalDate()) || !startTime.getValue().equals(initEventDutyDTO.getStartTime().toLocalDateTime().toLocalTime()) || !endTime.getValue().equals(initEventDutyDTO.getEndTime().toLocalDateTime().toLocalTime()) || !eventLocation.getText().equals(initEventDutyDTO.getLocation()) || !points.getText().equals(pointRef)) { Alert confirmationAlertMessage = new Alert(Alert.AlertType.CONFIRMATION, PlanchesterMessages.DISCARD_CHANGES, ButtonType.YES, ButtonType.NO); confirmationAlertMessage.showAndWait(); if (confirmationAlertMessage.getResult() == ButtonType.NO) { return false; } } // remove content of sidebar EventScheduleController.resetSideContent(); EventScheduleController.removeSelection(initAppointment); return true; }
@FXML void btnExcluir_onAction(ActionEvent event) { if (tblClientes.getSelectionModel().getSelectedIndex() >= 0) { dlgConfirmacao.setTitle("CONFIRMAÇÃO"); dlgConfirmacao.setContentText("Tem certeza que deseja excluir?\nEsta operação não poderá ser desfeita."); Optional<ButtonType> result = dlgConfirmacao.showAndWait(); if (result.isPresent() && result.get() == bttSim) { cliente.delete(tblClientes.getSelectionModel().getSelectedItem()); btnProcurar.fire(); lblStatus.setText("Cliente excluído com sucesso."); } } else { dlgMensagem.setTitle("ERRO DE SELEÇÃO"); dlgMensagem.setContentText("É preciso selecionar um cliente da tabela para poder realizar a exclusão."); dlgMensagem.showAndWait(); } }
/** * Opens a dialog to save the game */ @FXML protected void handleSaveGame() { try { // Load game saving view FXMLLoader loader = new FXMLLoader(); loader.setResources(this.scrabble.getI18nMessages()); loader.setLocation(Scrabble.class.getResource("view/SaveGame.fxml")); VBox page = loader.load(); // Create the dialog stage Stage dialogStage = new Stage(); dialogStage.setMinWidth(SaveGameController.STAGE_WIDTH); dialogStage.setMaxWidth(SaveGameController.STAGE_WIDTH); dialogStage.setMinHeight(SaveGameController.STAGE_HEIGHT); dialogStage.setMaxHeight(SaveGameController.STAGE_HEIGHT); dialogStage.setTitle(this.scrabble.getI18nMessages().getString("save")); dialogStage.initModality(Modality.WINDOW_MODAL); dialogStage.initOwner(this.scrabble.getPrimaryStage()); Scene scene = new Scene(page); dialogStage.setScene(scene); SaveGameController controller = loader.getController(); controller.setDialogStage(dialogStage); controller.setScrabble(this.scrabble); dialogStage.showAndWait(); } catch (IOException e) { this.scrabble.showGeneralApplicationError(e); } }
@FXML public void btnEditarOnAction(ActionEvent evt) { SoftwareEntity tmpSoftware = getSoftwareSelected(); if (tmpSoftware != null) { setSoftware(tmpSoftware); tbpGerenciaSoftware.getSelectionModel().select(tabSoftware); } }
/** * When the user changes the log level and new {@link Runnable} command is added to {@link Settings}. * <p> * Command run when the user applies the change in setting. * * @param event action event */ @FXML public void onLogLevelChanged(final ActionEvent event) { settings.addRunnable(() -> { final String logLevel = choiceBox.getSelectionModel().getSelectedItem(); final Logger logger = LogManager.getRootLogger(); Configurator.setLevel(logger.getName(), Level.toLevel(logLevel)); LOGGER.info("Log level was set to: " + Level.toLevel(logLevel)); }); event.consume(); }
@FXML private void mouseExited() { final LocationPresentation locationPresentation = (LocationPresentation) this.root; if(!locationPresentation.isInteractable()) return; circle.setCursor(Cursor.DEFAULT); locationPresentation.animateHoverExited(); KeyboardTracker.unregisterKeybind(KeyboardTracker.MAKE_LOCATION_URGENT); KeyboardTracker.unregisterKeybind(KeyboardTracker.MAKE_LOCATION_COMMITTED); }
@FXML private void loadPlayback() throws IOException { FileChooser chooser = new FileChooser(); chooser.setInitialDirectory(Storage.getRecordingDir()); chooser.getExtensionFilters().setAll( new FileChooser.ExtensionFilter("Shuffleboard Data Recording", "*.sbr")); final File selected = chooser.showOpenDialog(root.getScene().getWindow()); if (selected == null) { return; } Playback playback = Playback.load(selected.getAbsolutePath()); playback.start(); }
@FXML private void onBtnSelectAppClicked(ActionEvent event) { StatusResponse status = null; try { SmartcardIoTransmitter transmitter = SmartcardIoTransmitter.create(); ApduSession session = new ApduSession(); Object selectedItem = tbViewAppIDs.getSelectionModel().getSelectedItem(); SelectApplication selectAppCmd = new SelectTsApplication(); String aid = ""; if (selectedItem != null) { aid = ((ApplicationModel)selectedItem).getId(); selectAppCmd = new SelectApplication(Hex.decode(aid)); } session.nextCommands( new GetVersion(), selectAppCmd ); status = session.transmit(transmitter); String uid = getParamValueByKey(session, DesfireGetCardUID.CARD_UID_KEY); String receivedData = "AID: " + getParamValueByKey(session, SelectTsApplication.AID_KEY); historyData.add(0, new HistoryModel( status.getStatus().name(),//status "SelectTsApplication",//action uid,//uid receivedData));//received data if (status.getStatus() == ApduStatus.SUCCESS) { FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("fxml/AuthenticateApp.fxml")); Parent root = (Parent)fxmlLoader.load(); AuthenticateAppController controller = fxmlLoader.<AuthenticateAppController>getController(); controller.setSession(session, historyData); Stage stage = new Stage(); stage.setTitle("Authenticate App - [" + aid + "]"); stage.setScene(new Scene(root, 450, 300)); stage.showAndWait(); } } catch (Exception e) { lbResultTabApp.setText(e.getMessage()); } }
@FXML private void handleButtonStopAction(ActionEvent event) { this.servChat.stopServer(); this.servJeu.stopServer(); statusChatLbl.setText("down"); statusChatLbl.setTextFill(Color.BROWN); statusGameLbl.setText("down"); statusGameLbl.setTextFill(Color.BROWN); startBtn.setDisable(false); restartBtn.setDisable(true); stopBtn.setDisable(true); }
@FXML private void systemtxtRePassword() { if (systemtxtPassword.getText().length() <= systemtxtRePassword.getText().length()) { if (!systemtxtRePassword.getText().equals(systemtxtPassword.getText())) { systemlblWarningMsg.setText("Password didn't match"); } } else { systemlblWarningMsg.setText(""); } }
@FXML private void addSong() { String s = songToAdd.getText().trim(); if(!s.isEmpty() && !songs.getItems().contains(s) ) { songs.getItems().add(s); songToAdd.setText(""); } }
/** * Helps the player to play his turn by playing the best turn possible for him */ @FXML protected void handleAskHelp() { this.controlButtons.setDisable(true); this.playerLettersContainer.setDisable(true); HumanPlayerInterface currentPlayer = (HumanPlayerInterface) this.scrabble.getCurrentPlayer(); Task<SortedMap<BoardPosition, LetterInterface>> bestTurnTaskFinder = ArtificialIntelligenceHelper.getBestTurnPossible(this.scrabble.getLanguage(), this.scrabble.getBoard(), currentPlayer); bestTurnTaskFinder.setOnSucceeded(event -> { if (null != bestTurnTaskFinder.getValue()) { try { this.scrabble.playLetters(bestTurnTaskFinder.getValue()); currentPlayer.decreaseAvailableHelps(); return; } catch (InvalidPlayedTurnException ignored) { } } this.askHelpButton.setDisable(true); this.controlButtons.setDisable(false); this.playerLettersContainer.setDisable(false); this.showAlertOfNoBestTurnPossible(); }); new Thread(bestTurnTaskFinder).start(); }
@FXML private void mnuSettings(ActionEvent event) { (new TabAccess()).setTabName("tabBank"); Stage TransactionHistoryStage = (Stage) btnSignOut.getScene().getWindow(); (new GoToOperation()).goToSettings(TransactionHistoryStage.getX(), TransactionHistoryStage.getY()); TransactionHistoryStage.close(); }
@FXML private void handleBuyMeCoffee(ActionEvent event) throws IOException { FXMLLoader fXMLLoader = new FXMLLoader(); fXMLLoader.setLocation(getClass().getResource("/view/other/Donate.fxml")); Stage stage = new Stage(); Scene scene = new Scene(fXMLLoader.load()); stage.setScene(scene); stage.setTitle("Buy me a coffee"); stage.show(); }
@FXML private void mnuSourceSettings(ActionEvent event) { (new TabAccess()).setTabName("tabSource"); Stage TransactionHistoryStage = (Stage) btnSignOut.getScene().getWindow(); (new GoToOperation()).goToSettings(TransactionHistoryStage.getX(), TransactionHistoryStage.getY()); TransactionHistoryStage.close(); }
/** * When the user wants to zoom out by a single hop. * * @param actionEvent the {@link ActionEvent} */ @FXML void zoomOutAction(final ActionEvent actionEvent) { graphMovementCalculator.onScroll(SCROLL_DELTA); actionEvent.consume(); }
@FXML private void handleDeleteAction(ActionEvent event) { ObservableList<Integer> selectedIndices = ownersListView.getSelectionModel().getSelectedIndices(); for (int i = 0; i < selectedIndices.size(); i++) { try { Connection connection = DriverManager .getConnection("jdbc:mysql://172.17.0.134/propertydb", "javauser", "java"); Statement statement = connection.createStatement(); int propertyId = ownersList.get(selectedIndices.get(i)).getPropertyId(); String ownersName = ownersList.get(selectedIndices.get(i)).getOwnersName(); statement.executeUpdate("DELETE FROM property WHERE propertyId = " + propertyId + " AND ownersName = '" + ownersName + "'"); ownersList.remove(selectedIndex); statusLabel.setText("Deleted " + propertyId + " " + ownersName); propertyIdField.clear(); ownersNameField.clear(); } catch (SQLException sqle) { Alert alert = new Alert(AlertType.ERROR); alert.setTitle("Error message"); alert.setHeaderText("Database error"); alert.setContentText("Could not connect to the database"); alert.showAndWait(); System.err.println("Cannot connect to the database"); } } }
@FXML private void exbtnAdvancedSaveAndAdd(ActionEvent event) { if (total == 0) { exlblAdvWarningMsg.setText("Empty or Zero is not approved."); } else { TextField AdvancedExtxt[] = {extxtAdvSector1, extxtAdvSector2, extxtAdvSector3, extxtAdvSector4, extxtAdvSector5, extxtAdvSector6, extxtAdvSector7 }; Label AdvancedExlbl[] = {exlblAdvSector1, exlblAdvSector2, exlblAdvSector3, exlblAdvSector4, exlblAdvSector5, exlblAdvSector6, exlblAdvSector7 }; int index = 0; for (TextField textField : AdvancedExtxt) { if ((!textField.getText().isEmpty()) && (!textField.getText().equals("0"))) { exAdvSaveFunction(textField.getText(), AdvancedExlbl[index].getText()); } ++index; } exInitialize(); extxtAdvancedDescription.clear(); Alert confirmationMsg = new Alert(AlertType.INFORMATION); confirmationMsg.setTitle("Successfull Transaction"); confirmationMsg.setHeaderText(null); confirmationMsg.setContentText("Your transaction completed successfully."); Stage MakeATransactionStage = (Stage) exbtnSave.getScene().getWindow(); confirmationMsg.setX(MakeATransactionStage.getX() + 200); confirmationMsg.setY(MakeATransactionStage.getY() + 170); confirmationMsg.showAndWait(); } }
@FXML private void actionAdd(ActionEvent event) { if (childSetter == null) { new Alert(Alert.AlertType.ERROR, "No childSetter defined.", ButtonType.CLOSE).showAndWait(); return; } Class<T> entityClass = query.getEntityClass(); Query<T> allQuery = new Query<>(query.getService(), entityClass); Optional<List<T>> result = EntityGuiController.entitySearchDialog(allQuery, true); if (result.isPresent() && !result.get().isEmpty()) { List<T> newChildren = result.get(); childSetter.setChildren(newChildren); } }
@FXML protected void chbxTDClickedDefaultTikFolder(){ if(chbxTDDefaultTikFolder.isSelected()){ btnTDTikFolder.setDisable(false); }else{ btnTDTikFolder.setDisable(true); PropertiesHandler.setProperties("", "tdtikfolder"); } }
@FXML public void addRecipient(ActionEvent event) { final Recipient recipient = new Recipient(); recips.add(recipient); recipList.getSelectionModel().select(recipient); type.requestFocus(); }
/** * Handles logout request, and return the user to the login screen. * @param event The event that trigger this function. * @throws IOException If the fxml was not found. */ @FXML public void logoutUser(ActionEvent event) throws IOException { //Close current window, and go back to login screen Stage stage = (Stage) menuBar.getScene().getWindow(); stage.close(); Stage stage2 = new Stage(); Parent root2 = FXMLLoader.load(getClass().getResource("/dataBaseLogin/MountieLib.fxml")); Scene scene2 = new Scene(root2); stage2.setScene(scene2); stage2.getIcons().add(new Image("images/titleIcon.png")); stage2.initModality(Modality.NONE); stage2.show(); }
@FXML private void resetButtonAction(ActionEvent event) { redoListForExpressionTextFlow.clear(); undoListForExpressionTextFlow.clear(); expressionTextFlow.getChildren().clear(); updateButtons(); makeAndAuditExpression(); }
@FXML void cmbLaboratorio_onAction(ActionEvent event) { if (!cmbLaboratorio.getSelectionModel().isEmpty()) { cmbDisciplina.getSelectionModel().select(-1); cmbProfessor.getSelectionModel().select(-1); filtrarReservas(); tblConsultarHorario.refresh(); } }
@FXML public void showExtract() { try { if (!extraitEntretien.getText().isEmpty()) { ShowTextWindow win = new ShowTextWindow(extraitEntretien.getText()); win.show(); } } catch (Exception e) { System.out.println("No DATA to display"); } }
@FXML private void logout(ActionEvent event) throws IOException { stage = (Stage) label.getScene().getWindow(); root = FXMLLoader.load(getClass().getResource("/callib/Views/Login.fxml")); Scene scene = new Scene(root); stage.setScene(scene); stage.show(); }
@FXML private void addCvFile() { fileChooser.setInitialDirectory(new File(CommonUtils.USER_DIR)); if (Boolean.valueOf(props.getDEFAULT_PATH_CHK())) { File file = new File(props.getDEFAULT_PATH()); fileChooser.setInitialDirectory(file); } List<File> files = fileChooser.showOpenMultipleDialog(Start.getStage()); if (files != null) { addFilesToTable(files); } }
@FXML private void removeMusicalWorkFromSelected() { String selecetdItem = tableSelected.getSelectionModel().getSelectedItem(); if(selecetdItem != null && selecetdItem != "" ) { tableSelected.getItems().remove(tableSelected.getSelectionModel().getFocusedIndex()); tableAvailable.getItems().add(selecetdItem); } }
@FXML private void toggleFavouritesMode() { serverTable.setPlaceholder(new Label("")); serverTable.setServerTableMode(SampServerTableMode.FAVOURITES); serverTable.clear(); serverTable.addAll(FavouritesController.getFavourites()); }
@FXML public void removeImage() { db.removeDB(CloudHost.getPublicID(previewImageUrl)); cloudHost.deleteImage(CloudHost.getPublicID(previewImageUrl)); //удаление с сервера contentGallery(); reloadContentGallery(); Platform.runLater(() -> { imagePreview.setImage(null); previewImageUrl = null; }); }
@FXML private void chooseImagesDirectory(ActionEvent event) { Window owner = getWindowFrom(event); File dir = dialogProvider.chooseImagesDirectory(owner); if (dir != null) { imagesDirectoryField.setText(dir.getAbsolutePath()); } }
@FXML private void mnuCreateSource(ActionEvent event) { (new TabAccess()).setTabName("tabSource"); Stage HelpStage = (Stage) btnSignOut.getScene().getWindow(); (new GoToOperation()).goToSettings(HelpStage.getX(), HelpStage.getY()); HelpStage.close(); }