Java 类javafx.event.ActionEvent 实例源码

项目:cemu_UI    文件:JFXTextAreaInfoDialog.java   
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();
}
项目:ReqMan    文件:GroupPropertiesScene.java   
@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;
    }
}
项目:Squid    文件:SquidUIController.java   
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);
        }
    }
项目:community-In-Action    文件:FXMLDocumentController.java   
@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);
    }

}
项目:Steam-trader-tools    文件:AppController.java   
@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();

}
项目:Java-9-Programming-Blueprints    文件:ConnectToPhoneController.java   
@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);
    }
}
项目:ABC-List    文件:TestdataApplication.java   
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();
}
项目:FYS_T3    文件:homepageController.java   
@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();
            }
        }
    });
}
项目:FYS_T3    文件:contactController.java   
@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);
            }
        }
    });
}
项目:Squid    文件:SquidUIController.java   
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);
    }
}
项目:cemu_UI    文件:MainWindowController.java   
@FXML
void autoUpdateToggleBtnAction(ActionEvent event) {
    if (isAutoUpdate()) {
        setAutoUpdate(false);
    } else {
        setAutoUpdate(true);
    }
    saveSettings();
}
项目:Java-9-Programming-Blueprints    文件:Controller.java   
@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();
        }
    });
}
项目:KutuphaneOtomasyonSistemi    文件:AyarlarController.java   
@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);
  }
项目:Squid    文件:SpotManagerController.java   
@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());
    }
}
项目:ReqMan    文件:MainHandler.java   
@Override
public void handleExportGroups(ActionEvent event) {
    if (!evaluatorHandler.isGroupLoaded()) {
        return;
    }
    evaluatorHandler.exportAllGroups();
}
项目:Money-Manager    文件:AboutController.java   
@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();
}
项目:Dr-Assistant    文件:PatientsController.java   
@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());
    }
}
项目:FYS_T3    文件:submitController.java   
@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);
            }
        }
    });
}
项目:Dr-Assistant    文件:TemplatesController.java   
@FXML
private void tfSearchOnAction(ActionEvent event) {
    if (tfSearch.getText() == null || tfSearch.getText().trim().length() == 0) {
        loadData();
    } else {
        searchData(tfSearch.getText().trim());
    }
}
项目:Money-Manager    文件:SettingsController.java   
@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();
}
项目:Money-Manager    文件:TransactionHistoryController.java   
@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();
}
项目:OpenDiabetes    文件:MainGuiController.java   
@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();
}
项目:Mod-Detection-Tools    文件:ModDetectionController.java   
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));
}
项目:World-of-Zuul-SDU    文件:FXMLDocumentController.java   
@FXML
private void talkButtonAction(ActionEvent event) {
    String talkTarget = "";
    if (event.getSource() == talkButton) {
        talkTarget = roomInventory.getSelectionModel().getSelectedItem();
        textOutArea.appendText("\n" + talkText(talkTarget));
    }
}
项目:Java-9-Programming-Blueprints    文件:FXMLController.java   
@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);
                }
            });
}
项目:HotaruFX    文件:EditorController.java   
@FXML
private void handleMenuOpen(ActionEvent event) {
    val isOpened = documentManager.open(primaryStage, editor::replaceText);
    if (isOpened) {
        updateTitle();
    }
}
项目:Squid    文件:SquidUIController.java   
@FXML
private void specifyIsotopesMenuItemAction(ActionEvent event) {
    mainPane.getChildren().remove(isotopesManagerUI);
    squidProject.getTask().buildSquidSpeciesModelList();
    launchIsotopesManager();
    showUI(isotopesManagerUI);
}
项目:Mafia-TCoS-CS319-Group2A    文件:WelcomeScreen.java   
@FXML
void mute(ActionEvent event) {

    if (isMute)
        SoundManager.get().play();

    else
        SoundManager.get().stop();

    isMute = !isMute;
}
项目:ReqMan    文件:MainHandler.java   
@Override
public void handleModMS(ActionEvent event) {
    if (mainScene.isEditorActive()) {
        if (editorHandler.isCatalogueLoaded()) {
            editorHandler.handleModification(CUDEvent.generateModificationEvent(event, TargetEntity.MILESTONE, editorHandler.getSelectedMS()));
        }
    }
}
项目:stvs    文件:SpecificationsPaneController.java   
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());
  }
}
项目:ReqMan    文件:MainHandler.java   
@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
        }
    }

}
项目:Java-9-Programming-Blueprints    文件:Controller.java   
@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);
}
项目:ETUmulator    文件:HelpMenuController.java   
@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();
}
项目:OpenVSP3Plugin    文件:JavaFXUI.java   
@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();
}
项目:Dr-Assistant    文件:NewTemplateController.java   
@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();
}
项目:Goliath-Overclocking-Utility-FX    文件:FanProfileEditPane.java   
@Override
public void handle(ActionEvent event)
{
    InstanceProvider.getCurrentFanProfile().getNodes().remove(tempTable.getSelectionModel().getSelectedItem());
    tempTable.getItems().remove(tempTable.getSelectionModel().getSelectedItem());
    tempTable.sort();
}
项目:creacoinj    文件:WalletPasswordController.java   
@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);
}
项目:jedai-ui    文件:Step2Controller.java   
/**
 * 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());
}
项目:alchem    文件:AddPurchaseController.java   
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);
}
项目:Steam-trader-tools    文件:SettingsController.java   
@FXML
void deleteImageCache(ActionEvent event) {
    try
    {
        imageCacheHandler.deleteImageCache();
    } catch (ImageCacheError imageCacheError)
    {
        JFXSnackbar error = new JFXSnackbar(root);
        error.show(I18n.getMessage("errorcachefolder"), 3000);
    }
}