Skip to content

Commit

Permalink
Issue 624 nonmodifiable contradiction (#649)
Browse files Browse the repository at this point in the history
* Update TreeView.java

Made board unmodifiable when a selected tree node is part of a contradiction branch

* Added contradiction check to mouse event

Removed previous changes from TreeView

Added board modifiability update to TreeController for each mouse press on the proof tree: modifiability is determined by whether or not the current selected node is part of a contradiction branch

* Added comments

Added comments to TreeController

* Updated modifiability on rule application

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 authored Oct 17, 2023
1 parent b718165 commit e05d8e5
Show file tree
Hide file tree
Showing 3 changed files with 759 additions and 784 deletions.
3 changes: 2 additions & 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 @@ -42,7 +43,7 @@ public void mousePressed(MouseEvent e) {

/**
* Mouse Released event sets the cursor back to the default cursor and reset info for panning
*
* Set board modifiability
* @param e MouseEvent object
*/
@Override
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
Loading

0 comments on commit e05d8e5

Please sign in to comment.