Skip to content

Commit

Permalink
Simplified logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mtygesen committed Jan 28, 2024
1 parent 170d613 commit 50cae6a
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/main/java/net/tapaal/gui/petrinet/dialog/QueryDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -826,20 +826,14 @@ private void updateQueryButtonsAccordingToSelection() {
enableOnlyStateButtons();
}

if (lens.isGame() || lens.isTimed() || queryType.getSelectedIndex() != 0) {
if (current instanceof TCTLAbstractPathProperty || newProperty instanceof TCTLPathPlaceHolder) {
boolean enableBooleanOperators = !(current instanceof LTLANode || current instanceof LTLENode) && queryType.getSelectedIndex() != 0;

disjunctionButton.setEnabled(enableBooleanOperators);
conjunctionButton.setEnabled(enableBooleanOperators);
negationButton.setEnabled(enableBooleanOperators || !lens.isGame() && lens.isTimed());

return;
}

disjunctionButton.setEnabled(true);
conjunctionButton.setEnabled(true);
negationButton.setEnabled(true);
if ((lens.isGame() || lens.isTimed() || queryType.getSelectedIndex() != 0) &&
current instanceof TCTLAbstractPathProperty || newProperty instanceof TCTLPathPlaceHolder) {

boolean enableBooleanOperators = !(current instanceof LTLANode || current instanceof LTLENode) && queryType.getSelectedIndex() != 0;

disjunctionButton.setEnabled(enableBooleanOperators);
conjunctionButton.setEnabled(enableBooleanOperators);
negationButton.setEnabled(enableBooleanOperators || !lens.isGame() && lens.isTimed());
}
}

Expand Down

0 comments on commit 50cae6a

Please sign in to comment.