Search in sources :

Example 6 with DialogWindow

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

the class PacketTableView method hanldeImportPcap.

/**
     * Handle import pcap
     */
private void hanldeImportPcap() {
    try {
        // open import dialog
        setStreamEditingWindowOpen(true);
        Stage owner = (Stage) streamPacketTableView.getScene().getWindow();
        DialogWindow importPcapWindow = new DialogWindow("ImportPcapWizard.fxml", "   Import Pcap", 60, 80, false, owner);
        ImportPcapWizardController importController = (ImportPcapWizardController) importPcapWindow.getController();
        importController.initWizard(tabledata.getProfiles(), tabledata.getYamlFileName());
        importPcapWindow.show(true);
    } catch (Exception ex) {
        LOG.error("Error loading pcap file", ex);
    }
}
Also used : ImportPcapWizardController(com.exalttech.trex.ui.controllers.ImportPcapWizardController) Stage(javafx.stage.Stage) DialogWindow(com.exalttech.trex.ui.dialog.DialogWindow) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) IllegalRawDataException(org.pcap4j.packet.IllegalRawDataException)

Example 7 with DialogWindow

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

the class MainViewController method openConnectDialog.

/**
     * Open connect dialog
     */
private void openConnectDialog() {
    try {
        DialogWindow connectWindow = new DialogWindow("ConnectDialog.fxml", "Connect", 300, 100, false, TrexApp.getPrimaryStage());
        connectWindow.show(true);
        if (ConnectionManager.getInstance().isConnected()) {
            StatsLoader.getInstance().start();
            StatsStorage.getInstance().startPolling();
            serverStatusLabel.setText("Connected");
            serverStatusIcon.setImage(new Image("/icons/connectedIcon.gif"));
            connectIcon.getStyleClass().add("disconnectIcon");
            connectDixconnectTooltip.setText("Disconnect from TRex server");
            connectMenuItem.setText(DISCONNECT_MENU_ITEM_TITLE);
            statsMenuItem.setDisable(false);
            clearCache.setDisable(false);
            logsContainer.setDisable(false);
            copyToClipboardBtn.setDisable(false);
            dashboardIcon.setDisable(false);
            serverRPCMethods.serverApiSync();
            loadSystemInfo();
            portManager.updatePortForce();
        }
    } catch (IOException ex) {
        LOG.error("Error while Connecting", ex);
    }
}
Also used : IOException(java.io.IOException) Image(javafx.scene.image.Image) DialogWindow(com.exalttech.trex.ui.dialog.DialogWindow)

Example 8 with DialogWindow

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

the class MainViewController method openTrafficProfile.

/**
     * Open manage traffic profile dialog
     *
     * @param event
     * @throws IOException
     */
@FXML
public void openTrafficProfile(ActionEvent event) throws IOException {
    DialogWindow trafficWindow = new DialogWindow("TrafficProfileDialog.fxml", "Traffic Profiles", 10, 50, true, TrexApp.getPrimaryStage());
    TrafficProfileDialogController controller = (TrafficProfileDialogController) trafficWindow.getController();
    controller.init();
    trafficWindow.show(true);
}
Also used : DialogWindow(com.exalttech.trex.ui.dialog.DialogWindow) FXML(javafx.fxml.FXML)

Example 9 with DialogWindow

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

the class ProfileManager method createNewProfile.

/**
     *
     * @param currentStage
     * @return
     * @throws IOException
     */
public String createNewProfile(Stage currentStage) throws IOException {
    String profileName = "";
    DialogWindow profileNameWindow = new DialogWindow("ProfileStreamNameDialog.fxml", "Create Profile", 150, 100, false, currentStage);
    ProfileStreamNameDialogController controller = (ProfileStreamNameDialogController) profileNameWindow.getController();
    controller.setProfileWindow(true);
    profileNameWindow.show(true);
    if (controller.isDataAvailable()) {
        profileName = controller.getName() + ".yaml";
        File newFile = FileManager.createNewFile(profileName);
        updateProfilesList(newFile, true);
    }
    return profileName;
}
Also used : ProfileStreamNameDialogController(com.exalttech.trex.ui.controllers.ProfileStreamNameDialogController) DialogWindow(com.exalttech.trex.ui.dialog.DialogWindow) File(java.io.File)

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