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 { ...@@ -24,6 +24,11 @@ public class GoalOptionsMenu extends ContextMenu {
@FXML @FXML
private RadioMenuItem rmiShowSequent, rmiCFL, rmiCFS, rmiBranchLabels, rmiNodeNames, rmiRuleNames; private RadioMenuItem rmiShowSequent, rmiCFL, rmiCFS, rmiBranchLabels, rmiNodeNames, rmiRuleNames;
@FXML
private MenuItem showVarAssignment;
@Setter
private InspectionModel model;
private ObjectProperty<ViewOption> selectedViewOption = new SimpleObjectProperty<>(); private ObjectProperty<ViewOption> selectedViewOption = new SimpleObjectProperty<>();
...@@ -51,7 +56,26 @@ public class GoalOptionsMenu extends ContextMenu { ...@@ -51,7 +56,26 @@ public class GoalOptionsMenu extends ContextMenu {
selectedViewOption.setValue(ViewOption.SEQUENT); 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 { ...@@ -138,6 +138,8 @@ public class InspectionView extends BorderPane {
Utils.addDebugListener(model.get().currentInterpreterGoalProperty()); Utils.addDebugListener(model.get().currentInterpreterGoalProperty());
Utils.addDebugListener(model.get().highlightedJavaLinesProperty()); Utils.addDebugListener(model.get().highlightedJavaLinesProperty());
goalOptionsMenu.setModel(model.get());
/*TODO redefine CSS bases on selected mode /*TODO redefine CSS bases on selected mode
mode.addListener(o -> { mode.addListener(o -> {
getStyleClass().removeAll( getStyleClass().removeAll(
......
...@@ -25,6 +25,7 @@ import javafx.scene.control.ListView; ...@@ -25,6 +25,7 @@ import javafx.scene.control.ListView;
import javafx.scene.control.TextArea; import javafx.scene.control.TextArea;
import javafx.scene.input.MouseEvent; import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane; import javafx.scene.layout.BorderPane;
import lombok.Getter;
import org.controlsfx.control.StatusBar; import org.controlsfx.control.StatusBar;
import java.util.HashMap; import java.util.HashMap;
...@@ -40,6 +41,8 @@ public class SequentMatcher extends BorderPane { ...@@ -40,6 +41,8 @@ public class SequentMatcher extends BorderPane {
private final ListProperty<Map<String, MatchPath>> results = new SimpleListProperty<>(this, "results", FXCollections.observableArrayList()); private final ListProperty<Map<String, MatchPath>> results = new SimpleListProperty<>(this, "results", FXCollections.observableArrayList());
//sicht user selected //sicht user selected
private final ObjectProperty<GoalNode<KeyData>> selectedGoalNodeToShow = new SimpleObjectProperty<>(this, "selectedGoalNodeToShow"); private final ObjectProperty<GoalNode<KeyData>> selectedGoalNodeToShow = new SimpleObjectProperty<>(this, "selectedGoalNodeToShow");
@Getter
public GoalOptionsMenu goalOptionsMenu = new GoalOptionsMenu(); public GoalOptionsMenu goalOptionsMenu = new GoalOptionsMenu();
@FXML @FXML
private SequentViewForMatcher sequentView; private SequentViewForMatcher sequentView;
...@@ -97,6 +100,7 @@ public class SequentMatcher extends BorderPane { ...@@ -97,6 +100,7 @@ public class SequentMatcher extends BorderPane {
} }
}); });
} }
private void calculateLookupTable() { private void calculateLookupTable() {
......
...@@ -17,8 +17,7 @@ public class SequentOptionsMenu extends ContextMenu { ...@@ -17,8 +17,7 @@ public class SequentOptionsMenu extends ContextMenu {
private final InspectionModel model; private final InspectionModel model;
@FXML @FXML
private MenuItem openSequentMatcher; private MenuItem openSequentMatcher;
@FXML
private MenuItem showVarAssignment;
...@@ -35,6 +34,9 @@ public class SequentOptionsMenu extends ContextMenu { ...@@ -35,6 +34,9 @@ public class SequentOptionsMenu extends ContextMenu {
KeyData data = (KeyData) model.getSelectedGoalNodeToShow().getData(); KeyData data = (KeyData) model.getSelectedGoalNodeToShow().getData();
SequentMatcher root1 = new SequentMatcher(data.getProof().getServices()); SequentMatcher root1 = new SequentMatcher(data.getProof().getServices());
root1.getGoalOptionsMenu().setModel(model);
root1.setGoals(model.getGoals()); root1.setGoals(model.getGoals());
root1.setSelectedGoalNodeToShow(model.getSelectedGoalNodeToShow()); root1.setSelectedGoalNodeToShow(model.getSelectedGoalNodeToShow());
root1.getStyleClass().add("sequent-view"); root1.getStyleClass().add("sequent-view");
...@@ -63,26 +65,6 @@ public class SequentOptionsMenu extends ContextMenu { ...@@ -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 @@ ...@@ -6,6 +6,5 @@
prefHeight="400.0" prefWidth="600.0" type="javafx.scene.control.ContextMenu"> prefHeight="400.0" prefWidth="600.0" type="javafx.scene.control.ContextMenu">
<items> <items>
<MenuItem fx:id="openSequentMatcher" text="Open Sequent Matcher"/> <MenuItem fx:id="openSequentMatcher" text="Open Sequent Matcher"/>
<MenuItem fx:id="showVarAssignment" text="Show Variable Assignment"/>
</items> </items>
</fx:root> </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