Search in sources :

Example 76 with FXML

use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.

the class PreferencesController method selectTemplatesLocation.

/**
     * Select save location choose button click handler
     *
     * @param event
     */
@FXML
public void selectTemplatesLocation(ActionEvent event) {
    chooser.setTitle("Templates Directory");
    File templatesDirectory = new File(templatesLocation.getText());
    if (!Util.isNullOrEmpty(templatesLocation.getText()) && templatesDirectory.exists()) {
        chooser.setInitialDirectory(new File(templatesLocation.getText()));
    }
    File location = chooser.showDialog(((Button) (event.getSource())).getScene().getWindow());
    if (location != null) {
        templatesLocation.setText(location.getAbsolutePath());
    }
}
Also used : Button(javafx.scene.control.Button) File(java.io.File) FXML(javafx.fxml.FXML)

Example 77 with FXML

use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.

the class PreferencesController method handleOKBtnClicked.

/**
     * Handle OK button clicked
     *
     * @param event
     */
@FXML
public void handleOKBtnClicked(final MouseEvent event) {
    Node node = (Node) event.getSource();
    Stage stage = (Stage) node.getScene().getWindow();
    savePreferences(stage);
}
Also used : Node(javafx.scene.Node) Stage(javafx.stage.Stage) FXML(javafx.fxml.FXML)

Example 78 with FXML

use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.

the class PreferencesController method selectSavedLocation.

/**
     * Select save location choose button click handler
     *
     * @param event
     */
@FXML
public void selectSavedLocation(ActionEvent event) {
    chooser.setTitle("Save Location Directory");
    File locationDirectory = new File(savedLocation.getText());
    if (!Util.isNullOrEmpty(savedLocation.getText()) && locationDirectory.exists()) {
        chooser.setInitialDirectory(new File(savedLocation.getText()));
    }
    File location = chooser.showDialog(((Button) (event.getSource())).getScene().getWindow());
    if (location != null) {
        savedLocation.setText(location.getAbsolutePath());
    }
}
Also used : Button(javafx.scene.control.Button) File(java.io.File) FXML(javafx.fxml.FXML)

Example 79 with FXML

use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.

the class PreferencesController method selectLoadLocation.

/**
     * Select load location choose button click handler
     *
     * @param event
     */
@FXML
public void selectLoadLocation(ActionEvent event) {
    chooser.setTitle("Load Location Directory");
    File locationDirectory = new File(loadLocation.getText());
    if (!Util.isNullOrEmpty(loadLocation.getText()) && locationDirectory.exists()) {
        chooser.setInitialDirectory(new File(loadLocation.getText()));
    }
    File location = chooser.showDialog(((Button) (event.getSource())).getScene().getWindow());
    if (location != null) {
        loadLocation.setText(location.getAbsolutePath());
    }
}
Also used : Button(javafx.scene.control.Button) File(java.io.File) FXML(javafx.fxml.FXML)

Example 80 with FXML

use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.

the class ProfileStreamNameDialogController method handleOKBtnClicked.

/**
     * Handle OK button clicked
     *
     * @param event
     */
@FXML
public void handleOKBtnClicked(ActionEvent event) {
    Node node = (Node) event.getSource();
    Stage stage = (Stage) node.getScene().getWindow();
    doCreating(stage);
}
Also used : Node(javafx.scene.Node) Stage(javafx.stage.Stage) FXML(javafx.fxml.FXML)

Aggregations

FXML (javafx.fxml.FXML)280 Engine (jgnash.engine.Engine)46 InjectFXML (jgnash.uifx.util.InjectFXML)43 File (java.io.File)40 IOException (java.io.IOException)37 Stage (javafx.stage.Stage)32 List (java.util.List)23 ArrayList (java.util.ArrayList)22 Preferences (java.util.prefs.Preferences)18 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)18 ResourceBundle (java.util.ResourceBundle)17 Scene (javafx.scene.Scene)17 Button (javafx.scene.control.Button)17 FXCollections (javafx.collections.FXCollections)16 LocalDate (java.time.LocalDate)15 BigDecimal (java.math.BigDecimal)14 ObjectProperty (javafx.beans.property.ObjectProperty)14 ObservableList (javafx.collections.ObservableList)14 FXMLLoader (javafx.fxml.FXMLLoader)14 ChangeListener (javafx.beans.value.ChangeListener)13