@FXML public void handleInspectionButton() { FileChooser fileChooser = new FileChooser(); fileChooser.setInitialDirectory(new File("C:\\Users\\Christoph\\OneDrive\\newAnalysis")); fileChooser.setTitle("Choose Invariant File"); fileChooser.getExtensionFilters().addAll(new ExtensionFilter("Invariant Files", "*.txt")); File selectedFile = fileChooser.showOpenDialog(stage); if (selectedFile != null) { try { FXMLLoader loader = new FXMLLoader(); BorderPane root = (BorderPane) loader.load(getClass().getResource("InvariantInspectorTab.fxml").openStream()); InvariantInspectorTabController controller = (InvariantInspectorTabController) loader.getController(); controller.setPrimaryStage(stage); controller.loadData(selectedFile); Tab tab = new Tab(); tab.setContent(root); tabPane.getTabs().add(tab); } catch (Exception e) { e.printStackTrace(); } } }
@FXML public void handleComparisonButton() { InvariantParser parser = new InvariantParser(); List<Invariant> invariants1 = new ArrayList<>(); List<Invariant> invariants2 = new ArrayList<>(); File file1 = new File("C:\\Users\\Christoph\\OneDrive\\newAnalysis\\invariant1\\invariants.txt"); File file2 = new File("C:\\Users\\Christoph\\OneDrive\\newAnalysis\\full_eb.csv"); // File file1 = new // File("C:\\Users\\Christoph\\OneDrive\\newAnalysis\\experiment_rear_fogLight_random\\invariantsPruned1.txt"); // File file2 = new // File("C:\\Users\\Christoph\\OneDrive\\newAnalysis\\experiment_rear_fogLight_random\\invariantsPruned2.txt"); parser.parse(file1, invariants1); parser.parse(file2, invariants2); List<Invariant> extra1 = new ArrayList<>(); List<Invariant> extra2 = new ArrayList<>(); List<Invariant> common = new ArrayList<>(); InvariantComperator comperator = new InvariantComperator(); comperator.compare(invariants1, invariants2, extra1, common); comperator.compare(invariants2, invariants1, extra2, null); try { FXMLLoader loader = new FXMLLoader(); BorderPane root = (BorderPane) loader.load(getClass().getResource("InvariantInspectorTab.fxml").openStream()); InvariantInspectorTabController controller = (InvariantInspectorTabController) loader.getController(); controller.setPrimaryStage(stage); controller.loadData(extra1); Tab tab = new Tab("Extra1"); tab.setContent(root); tabPane.getTabs().add(tab); } catch (Exception e) { e.printStackTrace(); } try { FXMLLoader loader = new FXMLLoader(); BorderPane root = (BorderPane) loader.load(getClass().getResource("InvariantInspectorTab.fxml").openStream()); InvariantInspectorTabController controller = (InvariantInspectorTabController) loader.getController(); controller.setPrimaryStage(stage); controller.loadData(extra2); Tab tab = new Tab("Extra2"); tab.setContent(root); tabPane.getTabs().add(tab); } catch (Exception e) { e.printStackTrace(); } try { FXMLLoader loader = new FXMLLoader(); BorderPane root = (BorderPane) loader.load(getClass().getResource("InvariantInspectorTab.fxml").openStream()); InvariantInspectorTabController controller = (InvariantInspectorTabController) loader.getController(); controller.setPrimaryStage(stage); controller.loadData(common); Tab tab = new Tab("Common"); tab.setContent(root); tabPane.getTabs().add(tab); } catch (Exception e) { e.printStackTrace(); } }