javafx.event.ActionEvent Java Examples
The following examples show how to use
javafx.event.ActionEvent.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EditProjectSettingsAction.java From arma-dialog-creator with MIT License | 6 votes |
@Override public void handle(ActionEvent event) { Project project = Project.getCurrentProject(); EditProjectSettingsDialog dialog = new EditProjectSettingsDialog(project); dialog.show(); if (dialog.wasCancelled()) { return; } project.setProjectName(dialog.getProjectName()); project.setProjectDescription(dialog.getProjectDescription()); if (dialog.moveProjectDirectory()) { try { ApplicationManager.instance.setProjectDirectoryName(project, dialog.getProjectName()); } catch (IOException ignore) { ResourceBundle bundle = Lang.ApplicationBundle(); new SimpleErrorDialog<>( ArmaDialogCreator.getPrimaryStage(), bundle.getString("Popups.EditProjectSettings.couldnt_move_project_dir_short"), null, new Label(bundle.getString("Popups.EditProjectSettings.couldnt_move_project_dir")) ).show(); } } }
Example #2
Source File: MainDashboardController.java From School-Management-System with Apache License 2.0 | 6 votes |
@FXML void btnStaffMgmt(ActionEvent event){ try { AnchorPane user = FXMLLoader.load(getClass().getResource(("/sms/view/fxml/StaffManagement.fxml"))); root.getChildren().setAll(user); }catch(IOException e){ System.out.println(e); } /*Parent root = null; try { root = FXMLLoader.load(getClass().getResource("/sms/view/fxml/StaffManagement.fxml")); Stage stage = new Stage(); stage.setTitle("School Information"); stage.setScene(new Scene(root)); stage.getIcons().add(new Image(getClass().getResourceAsStream("/sms/other/img/HikmaLogo.jpg"))); stage.show(); } catch (IOException e) { e.printStackTrace(); }*/ }
Example #3
Source File: RequireNdockController.java From logbook-kai with MIT License | 6 votes |
/** * 画面の更新 * * @param e ActionEvent */ @FXML void update(ActionEvent e) { List<Ship> ndockList = ShipCollection.get() .getShipMap() .values() .stream() .filter(this::filter) .collect(Collectors.toList()); if (this.ndocksHashCode == ndockList.hashCode()) { this.ndocks.forEach(RequireNdock::update); } else { this.ndocks.clear(); ndockList.stream() .sorted(Comparator.comparing(Ship::getNdockTime, Comparator.reverseOrder())) .map(RequireNdock::toRequireNdock) .forEach(this.ndocks::add); this.ndocksHashCode = ndockList.hashCode(); } }
Example #4
Source File: FilesRenameController.java From MyBox with Apache License 2.0 | 6 votes |
@Override public void openTarget(ActionEvent event) { try { if (tableData == null || tableData.isEmpty()) { return; } File f = new File(tableData.get(0).getFileName()); if (f.isDirectory()) { browseURI(new File(f.getPath()).toURI()); } else { browseURI(new File(f.getParent()).toURI()); } recordFileOpened(f); } catch (Exception e) { logger.error(e.toString()); } }
Example #5
Source File: MainToolbar.java From Quelea with GNU General Public License v3.0 | 6 votes |
public void startRecording() { recordAudioButton.setSelected(true); recording = true; // getItems().add(pb); getItems().add(recordingPathTextField); recordAudioButton.setText("Recording..."); recordAudioButton.setSelected(true); recordingsHandler = new RecordButtonHandler(); recordingsHandler.passVariables("rec", pb, recordingPathTextField, recordAudioButton); final int interval = 1000; // 1000 ms recCount = new Timer(interval, (java.awt.event.ActionEvent e) -> { recTime += interval; setTime(recTime, recordAudioButton); }); recCount.start(); }
Example #6
Source File: AlarmClockTableController.java From MyBox with Apache License 2.0 | 6 votes |
@FXML private void activeAction(ActionEvent event) { ObservableList<AlarmClock> selected = alarmClocksView.getSelectionModel().getSelectedItems(); if (selected == null || selected.isEmpty()) { return; } for (AlarmClock alarm : selected) { alarm.setIsActive(true); alarm.setStatus(AppVariables.message("Active")); AlarmClock.calculateNextTime(alarm); alarm.setNext(DateTools.datetimeToString(alarm.getNextTime())); AlarmClock.scehduleAlarmClock(alarm); } AlarmClock.writeAlarmClocks(selected); alarmClocksView.refresh(); activeButton.setDisable(true); inactiveButton.setDisable(false); }
Example #7
Source File: RadioChooserDialog.java From pcgen with GNU Lesser General Public License v2.1 | 6 votes |
private void onOK(final ActionEvent ignored) { Toggle selectedToggle = toggleGroup.getSelectedToggle(); Logging.debugPrint("selected toggle is " + selectedToggle); if (selectedToggle != null) { Integer whichItemId = (Integer)selectedToggle.getUserData(); InfoFacade selectedItem = chooser.getAvailableList().getElementAt(whichItemId); chooser.addSelected(selectedItem); } if (chooser.isRequireCompleteSelection() && (chooser.getRemainingSelections().get() > 0)) { Dialog<ButtonType> alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle(chooser.getName()); alert.setContentText(LanguageBundle.getFormattedString("in_chooserRequireComplete", chooser.getRemainingSelections().get())); alert.showAndWait(); return; } chooser.commit(); committed = true; this.dispose(); }
Example #8
Source File: ConnectionController.java From Spring-generator with MIT License | 6 votes |
/** * 保存连接 * * @param event */ public void saveConnection(ActionEvent event) { LOG.debug("执行保存数据库连接..."); DatabaseConfig config = getDatabaseConfig(); if (config == null) { LOG.debug("连接数据库的数据为null,取消保存操作!!!"); return; } try { ConfigUtil.saveDatabaseConfig(config.getConnName(), config); getDialogStage().close(); indexController.loadTVDataBase(); LOG.debug("保存数据库连接成功!"); } catch (Exception e) { LOG.error("保存数据库连接失败!!!" , e); AlertUtil.showErrorAlert(e.getMessage()); } }
Example #9
Source File: MainMenuController.java From logbook-kai with MIT License | 6 votes |
/** * バージョン情報 * * @param e ActionEvent */ @FXML void version(ActionEvent e) { try { InternalFXMLLoader.showWindow("logbook/gui/version.fxml", this.parentController.getWindow(), "バージョン情報", root -> new Scene(root, Color.TRANSPARENT), null, stage -> { stage.initStyle(StageStyle.TRANSPARENT); stage.focusedProperty().addListener((ob, o, n) -> { if (!n) { stage.close(); } }); }); } catch (Exception ex) { LoggerHolder.get().error("設定の初期化に失敗しました", ex); } }
Example #10
Source File: OpenLabelerController.java From OpenLabeler with Apache License 2.0 | 5 votes |
@FXML private void onClose(ActionEvent actionEvent) { if (canClose()) { tagBoard.setModel(null); undoManager.forgetHistory(); mediaPane.clear(); } }
Example #11
Source File: ManagerRetrievedViewController.java From Corendon-LostLuggage with MIT License | 5 votes |
@FXML public void updateFormInfo(ActionEvent event) throws SQLException { String customer = customerid.getText(); String lostkoffer = lostluggageid.getText(); String deliverer = deivererid.getText(); String email = emailid.getText(); String adres = adresid.getText(); String id = this.formtextid.getText(); if (!id.isEmpty()) { int updateInfo = DB.executeUpdateQuery("UPDATE passenger " + " JOIN lostluggage ON lostluggage.passengerId = passenger.passengerId " + " JOIN matched on lostluggage.registrationNr = matched.lostluggage " + " SET passenger.name = '" + customer + "', passenger.email = '" + email + "', passenger.address = '" + adres + "', matched.delivery = '" + deliverer + "' " + " WHERE lostluggage.registrationNr = '" + lostkoffer + "'"); alertHeader = "Updated!"; headerColor = "#f03e3e"; alert = "The delivered luggage is updated"; buttonText = "Ok"; showAlertMessage(); } else { alertHeader = "Something went wrong!"; headerColor = "#f03e3e"; alert = "Please select a row before updating details"; buttonText = "Try again"; showAlertMessage(); } }
Example #12
Source File: MainMenuController.java From MyBox with Apache License 2.0 | 5 votes |
@FXML public void userGuideDesktopTools(ActionEvent event) { try { String link = "https://github.com/Mararsh/MyBox/releases/download/v" + CommonValues.AppDocVersion + "/MyBox-UserGuide-" + CommonValues.AppDocVersion + "-DesktopTools-" + AppVariables.getLanguage() + ".pdf"; browseURI(new URI(link)); } catch (Exception e) { logger.error(e.toString()); } }
Example #13
Source File: StopWatchSample.java From marathonv5 with Apache License 2.0 | 5 votes |
private void configureTimeline() { time.setCycleCount(Timeline.INDEFINITE); KeyFrame keyFrame = new KeyFrame(Duration.millis(47), new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { calculate(); } }); time.getKeyFrames().add(keyFrame); }
Example #14
Source File: ChatRoom.java From ChatRoomFX with MIT License | 5 votes |
@FXML void closeAction(ActionEvent event) { try { controller.removeChatObserver(chatObserver); controller.updateClientList(); } catch (RemoteException e) { e.printStackTrace(); } Runtime.getRuntime().exit(0); ((Stage)btnClose.getScene().getWindow()).close(); }
Example #15
Source File: MainController.java From cute-proxy with BSD 2-Clause "Simplified" License | 5 votes |
/** * Handle setting menu */ @FXML private void updateSetting(ActionEvent e) throws IOException { var dialog = new MainSettingDialog(); dialog.mainSettingProperty().setValue(context.serverSetting()); var newConfig = dialog.showAndWait(); if (newConfig.isPresent()) { var task = new SaveSettingTask(context, newConfig.get(), context.keyStoreSetting(), context.proxySetting()); UIUtils.runTaskWithProcessDialog(task, "append settings failed"); } }
Example #16
Source File: TemplateController.java From dctb-utfpr-2018-1 with Apache License 2.0 | 5 votes |
@FXML private void showMainActionM(ActionEvent evt) { MenuItem btn = (MenuItem) (evt.getSource()); String actionType; if (btn.getText().equals("Registro de Vendas")) { actionType = "Venda"; } else { actionType = "Compra"; } GUIController.getInstance().showMainActionScreen(actionType, false); }
Example #17
Source File: ProductRegisterController.java From dctb-utfpr-2018-1 with Apache License 2.0 | 5 votes |
@FXML private void showMainActionM(ActionEvent evt) { MenuItem btn = (MenuItem) (evt.getSource()); String actionType; if (btn.getText().equals("Registro de Vendas")) { actionType = "Venda"; } else { actionType = "Compra"; } GUIController.getInstance().showMainActionScreen(actionType, false); }
Example #18
Source File: ModFuncContextMenu.java From erlyberly with GNU General Public License v3.0 | 5 votes |
private void onSeqTrace(ActionEvent ae) { ModFunc func = selectedItem.get(); if(func == null) return; dbgController.seqTrace(func); ErlyBerly.showPane("Seq Trace", new SeqTraceView(dbgController.getSeqTraceLogs())); }
Example #19
Source File: IndexController.java From Spring-generator with MIT License | 5 votes |
/** * 打开设置CustomProperty * * @param event */ public void onSetCustomProperty(ActionEvent event) { SetCustomPropertyController controller = (SetCustomPropertyController) loadFXMLPage("SetCustomProperty Setting", FXMLPage.SET_CUSTOM_PROPERTY, false); controller.setIndexController(this); controller.showDialogStage(); controller.init(); }
Example #20
Source File: MainScreenController.java From SmartCity-ParkingManagement with Apache License 2.0 | 5 votes |
@FXML void logOutButtonClicked(ActionEvent event) throws Exception { Stage window = (Stage) ((Node)event.getSource()).getScene().getWindow(); window.setTitle("Login"); Parent root = FXMLLoader.load(getClass().getResource("LoginScreen.fxml")); window.setScene(new Scene(root, ScreenSizesConstants.LoginScreenWidth, ScreenSizesConstants.LoginScreenHeight)); DBManager.initialize(); window.show(); }
Example #21
Source File: ProfileController.java From oim-fx with MIT License | 5 votes |
public void saveProfile(ActionEvent event) { if (application == null){ // We are running in isolated FXML, possibly in Scene Builder. // NO-OP. animateMessage(); return; } User loggedUser = application.getLoggedUser(); loggedUser.setEmail(email.getText()); loggedUser.setPhone(phone.getText()); loggedUser.setSubscribed(subscribed.isSelected()); loggedUser.setAddress(address.getText()); animateMessage(); }
Example #22
Source File: SelectionTableToolbar.java From pdfsam with GNU Affero General Public License v3.0 | 5 votes |
public void loadDocuments(ActionEvent event) { RememberingLatestFileChooserWrapper fileChooser = FileChoosers.getFileChooser( DefaultI18nContext.getInstance().i18n("Select pdf documents to load"), FileType.PDF); List<File> chosenFiles = fileChooser.showOpenMultipleDialog(this.getScene().getWindow()); if (chosenFiles != null && !chosenFiles.isEmpty()) { PdfLoadRequestEvent loadEvent = new PdfLoadRequestEvent(getOwnerModule()); chosenFiles.stream().map(PdfDocumentDescriptor::newDescriptorNoPassword).forEach(loadEvent::add); eventStudio().broadcast(loadEvent, getOwnerModule()); } }
Example #23
Source File: SingleImageAnalyzerController.java From FakeImageDetection with GNU General Public License v3.0 | 5 votes |
@FXML private void loadNeuralNetwork(ActionEvent event) { FileChooser fileChooser = new FileChooser(); fileChooser.setTitle("Select Neural Network"); nnetSrc = fileChooser.showOpenDialog(rootPane.getScene().getWindow()); if (nnetSrc != null) { nnIndicator.setSelected(true); } }
Example #24
Source File: About.java From PeerWasp with MIT License | 5 votes |
@FXML private void opentomp2p(ActionEvent event) { String tomp2p = "http://tomp2p.net/"; try { BrowserUtils.openURL(tomp2p); } catch (Exception e) { logger.warn("Could not open TomP2P URL: '{}'", tomp2p, e); } }
Example #25
Source File: MetacheatUI.java From jace with GNU General Public License v2.0 | 5 votes |
@FXML void pauseClicked(ActionEvent event) { Application.invokeLater(() -> { if (Emulator.computer.isRunning()) { Emulator.computer.pause(); } else { Emulator.computer.resume(); } }); }
Example #26
Source File: SetAbstractSqlController.java From Vert.X-generator with MIT License | 5 votes |
/** * 添加自定义属性 * * @param event */ public void onAddPropertyToTable(ActionEvent event) { LOG.debug("执行添加自定义属性..."); TableAttributeKeyValue attribute = new TableAttributeKeyValue(txtKey.getText(), txtValue.getText(), txtDescribe.getText()); tblPropertyValues.add(attribute); LOG.debug("添加自定义属性-->成功!"); }
Example #27
Source File: FXMLAwardCategoryController.java From pikatimer with GNU General Public License v3.0 | 5 votes |
public void upPriority(ActionEvent fxevent){ if (awardCategory.getPriority()> 0) { awardCategory.getRaceAward().awardCategoriesProperty().remove(awardCategory); awardCategory.getRaceAward().awardCategoriesProperty().add(awardCategory.getPriority()-1, awardCategory); awardCategory.getRaceAward().recalcPriorities(); awardCategory.getRaceAward().awardCategoriesProperty().forEach(a -> raceDAO.updateAwardCategory(a)); } }
Example #28
Source File: MainScreenController.java From SmartCity-ParkingManagement with Apache License 2.0 | 5 votes |
@FXML public void newOrderButtonClicked(ActionEvent event) throws Exception { Stage window = (Stage) ((Node)event.getSource()).getScene().getWindow(); window.setTitle("New Order"); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("ChooseParkingSlotScreen.fxml")); Parent root = (Parent)fxmlLoader.load(); ChooseParkingSlotController controller = fxmlLoader.<ChooseParkingSlotController>getController(); controller.setUserId(userId); window.setScene(new Scene(root, ScreenSizesConstants.MapScreenWidth, ScreenSizesConstants.MapScreenHeight)); window.show(); }
Example #29
Source File: OpenFileByEditorAction.java From jmonkeybuilder with Apache License 2.0 | 5 votes |
@FxThread @Override protected void execute(@Nullable ActionEvent event) { super.execute(event); var newEvent = new RequestedOpenFileEvent(getElement().getFile()); newEvent.setDescription(description); FX_EVENT_MANAGER.notify(newEvent); }
Example #30
Source File: MainMenuController.java From logbook-kai with MIT License | 5 votes |
/** * キャプチャ * * @param e ActionEvent */ @FXML void capture(ActionEvent e) { try { InternalFXMLLoader.showWindow("logbook/gui/capture.fxml", this.parentController.getWindow(), "キャプチャ"); } catch (Exception ex) { LoggerHolder.get().error("キャプチャの初期化に失敗しました", ex); } }