Search in sources :

Example 1 with DialogWindow

use of com.exalttech.trex.ui.dialog.DialogWindow in project trex-stateless-gui by cisco-system-traffic-generator.

the class MainViewController method openPreferencesWindow.

/**
     * Open preferences window
     */
private void openPreferencesWindow() {
    try {
        DialogWindow statsWindow = new DialogWindow("Preferences.fxml", "Preferences", 100, 50, false, TrexApp.getPrimaryStage());
        statsWindow.show(true);
    } catch (IOException ex) {
        LOG.error("Error opening preferences window", ex);
    }
}
Also used : IOException(java.io.IOException) DialogWindow(com.exalttech.trex.ui.dialog.DialogWindow)

Example 2 with DialogWindow

use of com.exalttech.trex.ui.dialog.DialogWindow in project trex-stateless-gui by cisco-system-traffic-generator.

the class MainViewController method openStateDialog.

/**
     * Open statistic dashboard view
     */
private void openStateDialog() {
    try {
        if (DialogManager.getInstance().getNumberOfOpenedDialog() < 4) {
            DialogWindow statsWindow = new DialogWindow("Dashboard/Dashboard.fxml", "Dashboard", 50, 10, true, TrexApp.getPrimaryStage());
            statsWindow.setMinSize(1210, 740);
            statsWindow.show(false);
        }
    } catch (IOException ex) {
        LOG.error("Error opening dashboard view", ex);
    }
}
Also used : IOException(java.io.IOException) DialogWindow(com.exalttech.trex.ui.dialog.DialogWindow)

Example 3 with DialogWindow

use of com.exalttech.trex.ui.dialog.DialogWindow in project trex-stateless-gui by cisco-system-traffic-generator.

the class MainViewController method handleAboutTreeItemClicked.

/**
     * Handle About tree item clicked
     *
     * @param event
     * @throws java.lang.Exception
     */
@FXML
public void handleAboutTreeItemClicked(ActionEvent event) throws Exception {
    DialogWindow statsWindow = new DialogWindow("AboutWindowView.fxml", "TRex", 200, 100, false, TrexApp.getPrimaryStage());
    statsWindow.show(true);
}
Also used : DialogWindow(com.exalttech.trex.ui.dialog.DialogWindow) FXML(javafx.fxml.FXML)

Example 4 with DialogWindow

use of com.exalttech.trex.ui.dialog.DialogWindow in project trex-stateless-gui by cisco-system-traffic-generator.

the class PacketTableView method viewStreamNameWindow.

/**
     * View stream name window
     *
     * @param type
     */
private void viewStreamNameWindow(StreamBuilderType type) {
    try {
        Stage currentStage = (Stage) streamPacketTableView.getScene().getWindow();
        DialogWindow profileNameWindow = new DialogWindow("ProfileStreamNameDialog.fxml", "Add Stream", 150, 100, false, currentStage);
        ProfileStreamNameDialogController controller = (ProfileStreamNameDialogController) profileNameWindow.getController();
        controller.setProfileList(tabledata.getProfiles());
        controller.setProfileWindow(false);
        profileNameWindow.show(true);
        if (controller.isDataAvailable()) {
            String streamName = controller.getName();
            handleAddPacket(streamName, type);
        }
    } catch (IOException ex) {
        LOG.error("Error adding new stream", ex);
    }
}
Also used : Stage(javafx.stage.Stage) ProfileStreamNameDialogController(com.exalttech.trex.ui.controllers.ProfileStreamNameDialogController) IOException(java.io.IOException) DialogWindow(com.exalttech.trex.ui.dialog.DialogWindow)

Example 5 with DialogWindow

use of com.exalttech.trex.ui.dialog.DialogWindow in project trex-stateless-gui by cisco-system-traffic-generator.

the class PacketTableView method openStreamDialog.

/**
     * open stream properties
     */
private void openStreamDialog(StreamBuilderType type) {
    try {
        TableProfileStream data = streamPacketTableView.getSelectionModel().getSelectedItem();
        if ("0".equals(data.getLength()) && !Util.isConfirmed("Problem reading file, Do you want to continue anyway ?")) {
            return;
        }
        setStreamEditingWindowOpen(true);
        Stage currentStage = (Stage) streamPacketTableView.getScene().getWindow();
        String windowTitle = "Edit Stream (" + data.getName() + ")";
        DialogWindow srteamWindow = new DialogWindow("PacketBuilderHome.fxml", windowTitle, 40, 30, false, currentStage);
        PacketBuilderHomeController controller = (PacketBuilderHomeController) srteamWindow.getController();
        boolean streaminited = false;
        switch(type) {
            case EDIT_STREAM:
                streaminited = controller.initStreamBuilder(data.getPcapBinary(), tabledata.getProfiles(), streamPacketTableView.getSelectionModel().getSelectedIndex(), tabledata.getYamlFileName(), StreamBuilderType.EDIT_STREAM);
                break;
            case ADD_STREAM:
                streaminited = controller.initStreamBuilder(null, tabledata.getProfiles(), streamPacketTableView.getSelectionModel().getSelectedIndex(), tabledata.getYamlFileName(), StreamBuilderType.ADD_STREAM);
                break;
            case BUILD_STREAM:
                streaminited = controller.initStreamBuilder(null, tabledata.getProfiles(), streamPacketTableView.getSelectionModel().getSelectedIndex(), tabledata.getYamlFileName(), StreamBuilderType.BUILD_STREAM);
                break;
            default:
                break;
        }
        if (streaminited) {
            srteamWindow.show(true);
        } else {
            LOG.error("Error while initing editor dialog");
        }
    } catch (IOException ex) {
        LOG.error("Error opening file", ex);
    }
}
Also used : PacketBuilderHomeController(com.exalttech.trex.ui.controllers.PacketBuilderHomeController) TableProfileStream(com.exalttech.trex.ui.views.models.TableProfileStream) Stage(javafx.stage.Stage) IOException(java.io.IOException) DialogWindow(com.exalttech.trex.ui.dialog.DialogWindow)

Aggregations

DialogWindow (com.exalttech.trex.ui.dialog.DialogWindow)9 IOException (java.io.IOException)6 Stage (javafx.stage.Stage)3 ProfileStreamNameDialogController (com.exalttech.trex.ui.controllers.ProfileStreamNameDialogController)2 FXML (javafx.fxml.FXML)2 ImportPcapWizardController (com.exalttech.trex.ui.controllers.ImportPcapWizardController)1 PacketBuilderHomeController (com.exalttech.trex.ui.controllers.PacketBuilderHomeController)1 TableProfileStream (com.exalttech.trex.ui.views.models.TableProfileStream)1 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 File (java.io.File)1 Image (javafx.scene.image.Image)1 IllegalRawDataException (org.pcap4j.packet.IllegalRawDataException)1