Skip to content

Commit

Permalink
Updated modifiability on rule application
Browse files Browse the repository at this point in the history
Set board modifiability of the current transition to false when a contradiction is applied in ValidateContradictionRuleCommand;
Removed previous change to TreeController.
  • Loading branch information
Chase-Grajeda committed Oct 14, 2023
1 parent 9b68d11 commit 3ddb5b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/edu/rpi/legup/controller/TreeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import edu.rpi.legup.model.Puzzle;
import edu.rpi.legup.model.tree.Tree;
import edu.rpi.legup.model.tree.TreeElementType;
import edu.rpi.legup.ui.boardview.BoardView;
import edu.rpi.legup.ui.proofeditorui.treeview.*;

Expand Down Expand Up @@ -55,7 +56,6 @@ public void mouseReleased(MouseEvent e) {
Puzzle puzzle = getInstance().getPuzzleModule();
TreeViewSelection selection = treeView.getSelection();
if (treeElementView != null) {
treeElementView.getTreeElement().getBoard().setModifiable(!treeElementView.getTreeElement().isContradictoryBranch());
if (e.isShiftDown()) {
selection.addToSelection(treeElementView);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ public void executeCommand() {
if (transition == null) {
transition = tree.addNewTransition(treeNode);
transition.setRule(newRule);
transition.getBoard().setModifiable(false);
tree.addTreeElement(transition);
}
else {
transition.getBoard().setModifiable(false);
tree.addTreeElement(treeNode, transition);
}

Expand Down

0 comments on commit 3ddb5b5

Please sign in to comment.