Commit b4a17252 authored by Lulu Luong's avatar Lulu Luong

variable assigment button moved to SequentOptionsMenu

Bug: model.getSelectedGoalNodeToShow().getAssignment() in GoalOptionsMenu is always empty
parent 0af5dbd6
Pipeline #28284 passed with stages
in 7 minutes and 16 seconds
......@@ -24,6 +24,11 @@ public class GoalOptionsMenu extends ContextMenu {
@FXML
private RadioMenuItem rmiShowSequent, rmiCFL, rmiCFS, rmiBranchLabels, rmiNodeNames, rmiRuleNames;
@FXML
private MenuItem showVarAssignment;
@Setter
private InspectionModel model;
private ObjectProperty<ViewOption> selectedViewOption = new SimpleObjectProperty<>();
......@@ -51,7 +56,26 @@ public class GoalOptionsMenu extends ContextMenu {
selectedViewOption.setValue(ViewOption.SEQUENT);
showVarAssignment.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
if(model == null || model.getSelectedGoalNodeToShow() == null) {
Utils.showInfoDialog("Select a goal", "Select a goal", "Please select a goal first.");
return;
}
VariableAssignment var_assignm = model.getSelectedGoalNodeToShow().getAssignments();
Stage stage = new Stage();
stage.setTitle("Variable Assignment");
VariableAssignmentWindow vaw = new VariableAssignmentWindow(var_assignm);
Scene scene = new Scene(vaw);
stage.setScene(scene);
stage.show();
}
});
}
......
......@@ -138,6 +138,8 @@ public class InspectionView extends BorderPane {
Utils.addDebugListener(model.get().currentInterpreterGoalProperty());
Utils.addDebugListener(model.get().highlightedJavaLinesProperty());
goalOptionsMenu.setModel(model.get());
/*TODO redefine CSS bases on selected mode
mode.addListener(o -> {
getStyleClass().removeAll(
......
......@@ -25,6 +25,7 @@ import javafx.scene.control.ListView;
import javafx.scene.control.TextArea;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import lombok.Getter;
import org.controlsfx.control.StatusBar;
import java.util.HashMap;
......@@ -40,6 +41,8 @@ public class SequentMatcher extends BorderPane {
private final ListProperty<Map<String, MatchPath>> results = new SimpleListProperty<>(this, "results", FXCollections.observableArrayList());
//sicht user selected
private final ObjectProperty<GoalNode<KeyData>> selectedGoalNodeToShow = new SimpleObjectProperty<>(this, "selectedGoalNodeToShow");
@Getter
public GoalOptionsMenu goalOptionsMenu = new GoalOptionsMenu();
@FXML
private SequentViewForMatcher sequentView;
......@@ -97,6 +100,7 @@ public class SequentMatcher extends BorderPane {
}
});
}
private void calculateLookupTable() {
......
......@@ -17,8 +17,7 @@ public class SequentOptionsMenu extends ContextMenu {
private final InspectionModel model;
@FXML
private MenuItem openSequentMatcher;
@FXML
private MenuItem showVarAssignment;
......@@ -35,6 +34,9 @@ public class SequentOptionsMenu extends ContextMenu {
KeyData data = (KeyData) model.getSelectedGoalNodeToShow().getData();
SequentMatcher root1 = new SequentMatcher(data.getProof().getServices());
root1.getGoalOptionsMenu().setModel(model);
root1.setGoals(model.getGoals());
root1.setSelectedGoalNodeToShow(model.getSelectedGoalNodeToShow());
root1.getStyleClass().add("sequent-view");
......@@ -63,26 +65,6 @@ public class SequentOptionsMenu extends ContextMenu {
});
showVarAssignment.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
if(model == null || model.getSelectedGoalNodeToShow() == null) {
Utils.showInfoDialog("Select a goal", "Select a goal", "Please select a goal first.");
return;
}
VariableAssignment var_assignm = model.getSelectedGoalNodeToShow().getAssignments();
Stage stage = new Stage();
stage.setTitle("Variable Assignment");
VariableAssignmentWindow vaw = new VariableAssignmentWindow(var_assignm);
Scene scene = new Scene(vaw);
stage.setScene(scene);
stage.show();
}
});
}
......
......@@ -6,6 +6,5 @@
prefHeight="400.0" prefWidth="600.0" type="javafx.scene.control.ContextMenu">
<items>
<MenuItem fx:id="openSequentMatcher" text="Open Sequent Matcher"/>
<MenuItem fx:id="showVarAssignment" text="Show Variable Assignment"/>
</items>
</fx:root>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment