Merge lp:~tapaal-contributor/tapaal/fix-urgent-missing-check-1951292 into lp:tapaal

Proposed by Kristian Morsing Pedersen
Status: Merged
Approved by: Jiri Srba
Approved revision: 1158
Merged at revision: 1158
Proposed branch: lp:~tapaal-contributor/tapaal/fix-urgent-missing-check-1951292
Merge into: lp:tapaal
Diff against target: 30 lines (+6/-2)
2 files modified
src/dk/aau/cs/gui/TabContent.java (+5/-1)
src/pipe/gui/widgets/TAPNTransitionEditor.java (+1/-1)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/fix-urgent-missing-check-1951292
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+412033@code.launchpad.net

Commit message

Now checks if valid action when toggeling a transition to urgent when pressing U, or using the draw menu

Description of the change

When selecting a transition and pressing U (or use the "Toggle urgent transition" in the draw menu), it now checks if the transition can be changed to urgent. It will display an error, if the action is invalid.

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/dk/aau/cs/gui/TabContent.java'
2--- src/dk/aau/cs/gui/TabContent.java 2021-11-05 14:11:49 +0000
3+++ src/dk/aau/cs/gui/TabContent.java 2021-11-17 19:47:04 +0000
4@@ -568,8 +568,12 @@
5 for (PetriNetObject o : selection) {
6 if (o instanceof TimedTransitionComponent) {
7 TimedTransitionComponent transition = (TimedTransitionComponent) o;
8+ if(!transition.underlyingTransition().hasUntimedPreset()) {
9+ JOptionPane.showMessageDialog(null,"Incoming arcs to urgent transitions must have the interval [0,\u221e).", "Error", JOptionPane.ERROR_MESSAGE);
10+ return;
11+ }
12+
13 Command cmd = new ToggleTransitionUrgent(transition.underlyingTransition(), currentTab);
14-
15 cmd.redo();
16 getUndoManager().addEdit(cmd);
17 }
18
19=== modified file 'src/pipe/gui/widgets/TAPNTransitionEditor.java'
20--- src/pipe/gui/widgets/TAPNTransitionEditor.java 2021-08-24 08:23:25 +0000
21+++ src/pipe/gui/widgets/TAPNTransitionEditor.java 2021-11-17 19:47:04 +0000
22@@ -40,7 +40,7 @@
23
24 public class TAPNTransitionEditor extends JPanel {
25
26- private static final String untimed_preset_warning = "Incoming arcs to urgent transitions must have the interval [0,inf).";
27+ private static final String untimed_preset_warning = "Incoming arcs to urgent transitions must have the interval [0,\u221e).";
28 private static final String transport_destination_invariant_warning = "Transport arcs going through urgent transitions cannot have an invariant at the destination.";
29 private final TimedTransitionComponent transition;
30 private final JRootPane rootPane;

Subscribers

People subscribed via source and target branches