Merge lp:~tapaal-contributor/tapaal/fixInfSymbol-1945643 into lp:tapaal

Proposed by Kristian Morsing Pedersen
Status: Merged
Approved by: Jiri Srba
Approved revision: 1151
Merged at revision: 1152
Proposed branch: lp:~tapaal-contributor/tapaal/fixInfSymbol-1945643
Merge into: lp:tapaal
Diff against target: 99 lines (+15/-9)
6 files modified
src/pipe/gui/GuiFrame.java (+1/-1)
src/pipe/gui/GuiFrameController.java (+1/-1)
src/pipe/gui/graphicElements/tapn/TimedInputArcComponent.java (+5/-0)
src/pipe/gui/graphicElements/tapn/TimedTransportArcComponent.java (+5/-4)
src/pipe/gui/widgets/GuardDialogue.java (+2/-2)
src/pipe/gui/widgets/PlaceEditorPanel.java (+1/-1)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/fixInfSymbol-1945643
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+410328@code.launchpad.net

This proposal supersedes a proposal from 2021-10-17.

Commit message

Now uses the infinity symbol

Description of the change

No longer breaks the verification process

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) wrote : Posted in a previous version of this proposal

For some reason show/hide intervals [0,inf) in menu/View does not work anymore (but it works in trunk). To reproduce, open intro example (in File/example nets) and try to trigger the view options but the interval 2x[0,inf) is visible all the time.

review: Needs Fixing
Revision history for this message
Jiri Srba (srba) wrote : Posted in a previous version of this proposal

This branch broke the verification - open for example intro example and verify the query, the engine returns and exception (probably the infinity symbol is sent to the engine but it should be only used in the GUI for visualization).

review: Needs Fixing
1152. By <email address hidden>

merged with trunk

Revision history for this message
Jiri Srba (srba) wrote :

Works as expected

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/pipe/gui/GuiFrame.java'
2--- src/pipe/gui/GuiFrame.java 2021-08-05 08:25:38 +0000
3+++ src/pipe/gui/GuiFrame.java 2021-10-17 18:42:08 +0000
4@@ -310,7 +310,7 @@
5 guiFrameController.ifPresent(GuiFrameControllerActions::toggleConstants);
6 }
7 };
8- private final GuiAction showZeroToInfinityIntervalsAction = new GuiAction("Display intervals [0,inf)", "Show/hide intervals [0,inf) that do not restrict transition firing in any way.", KeyStroke.getKeyStroke('7', shortcutkey), true) {
9+ private final GuiAction showZeroToInfinityIntervalsAction = new GuiAction("Display intervals [0," + Character.toString('\u221E') + ")", "Show/hide intervals [0," + Character.toString('\u221E') + ") that do not restrict transition firing in any way.", KeyStroke.getKeyStroke('7', shortcutkey), true) {
10 public void actionPerformed(ActionEvent e) {
11 guiFrameController.ifPresent(GuiFrameControllerActions::toggleZeroToInfinityIntervals);
12 }
13
14=== modified file 'src/pipe/gui/GuiFrameController.java'
15--- src/pipe/gui/GuiFrameController.java 2021-09-30 14:12:33 +0000
16+++ src/pipe/gui/GuiFrameController.java 2021-10-17 18:42:08 +0000
17@@ -246,7 +246,7 @@
18 buffer.append("TAPAAL GUI and Translations:\n");
19 buffer.append("Mathias Andersen, Sine V. Birch, Jacob Hjort Bundgaard, Joakim Byg, Jakob Dyhr,\nLouise Foshammer, Malte Neve-Graesboell, ");
20 buffer.append("Lasse Jacobsen, Morten Jacobsen,\nThomas S. Jacobsen, Jacob J. Jensen, Peter G. Jensen, ");
21- buffer.append("Mads Johannsen,\nKenneth Y. Joergensen, Mikael H. Moeller, Christoffer Moesgaard, Thomas Pedersen,\nLena Said, Niels N. Samuelsen, Jiri Srba, Mathias G. Soerensen, Jakob H. Taankvist\nand Peter H. Taankvist\n");
22+ buffer.append("Mads Johannsen,\nKenneth Y. Joergensen, Mikael H. Moeller, Christoffer Moesgaard, Kristian Morsing Pedersen,\nThomas Pedersen, Lena Said, Niels N. Samuelsen, Jiri Srba, Mathias G. Soerensen,\nJakob H. Taankvist and Peter H. Taankvist\n");
23
24 buffer.append("Aalborg University 2008-2021\n\n");
25
26
27=== modified file 'src/pipe/gui/graphicElements/tapn/TimedInputArcComponent.java'
28--- src/pipe/gui/graphicElements/tapn/TimedInputArcComponent.java 2020-09-10 08:59:28 +0000
29+++ src/pipe/gui/graphicElements/tapn/TimedInputArcComponent.java 2021-10-17 18:42:08 +0000
30@@ -102,6 +102,11 @@
31 getNameLabel().setText(inputArc.interval().toString(showConstantNames));
32 }
33
34+ if(getNameLabel().getText().contains("inf")) {
35+ String intervalStringWithInfSymbol = getNameLabel().getText().replace("inf", Character.toString('\u221e'));
36+ getNameLabel().setText(intervalStringWithInfSymbol);
37+ }
38+
39 getNameLabel().setText(getWeight().toString(showConstantNames)+" "+getNameLabel().getText());
40
41 // Handle constant highlighting
42
43=== modified file 'src/pipe/gui/graphicElements/tapn/TimedTransportArcComponent.java'
44--- src/pipe/gui/graphicElements/tapn/TimedTransportArcComponent.java 2020-09-10 08:59:28 +0000
45+++ src/pipe/gui/graphicElements/tapn/TimedTransportArcComponent.java 2021-10-17 18:42:08 +0000
46@@ -107,13 +107,14 @@
47 getNameLabel().setText(underlyingTransportArc.interval().toString(
48 displayConstantNames)
49 + " : " + getGroup());
50+ if(getNameLabel().getText().contains("inf")) {
51+ String intervalStringWithInfSymbol = getNameLabel().getText().replace("inf", Character.toString('\u221e'));
52+ getNameLabel().setText(intervalStringWithInfSymbol);
53+ }
54 }
55 else {
56- if (underlyingTransportArc.interval().toString(
57- displayConstantNames).equals("[0,inf)")) {
58-
59+ if (underlyingTransportArc.interval().toString(displayConstantNames).equals("[0,inf)")) {
60 getNameLabel().setText(" : " + getGroup());
61-
62 }
63 else {
64 getNameLabel().setText(underlyingTransportArc.interval().toString(
65
66=== modified file 'src/pipe/gui/widgets/GuardDialogue.java'
67--- src/pipe/gui/widgets/GuardDialogue.java 2021-08-24 09:32:59 +0000
68+++ src/pipe/gui/widgets/GuardDialogue.java 2021-10-17 18:42:08 +0000
69@@ -133,7 +133,7 @@
70 if(objectToBeEdited instanceof TimedInputArcComponent && !(objectToBeEdited instanceof TimedInhibitorArcComponent)
71 && ((TimedInputArcComponent) objectToBeEdited).isUrgentTransition()){
72 if(!guard.equals(TimeInterval.ZERO_INF)){
73- JOptionPane.showMessageDialog(myRootPane, "Incoming arcs to urgent transitions must have the interval [0,inf).", "Error", JOptionPane.ERROR_MESSAGE);
74+ JOptionPane.showMessageDialog(myRootPane, "Incoming arcs to urgent transitions must have the interval [0," + Character.toString('\u221E') + ")", "Error", JOptionPane.ERROR_MESSAGE);
75 return;
76 }
77 }
78@@ -347,7 +347,7 @@
79 gridBagConstraints.gridy = 1;
80 guardEditPanel.add(rightDelimiter, gridBagConstraints);
81
82- inf = new JCheckBox("inf", true);
83+ inf = new JCheckBox(Character.toString('\u221e'), true);
84 inf.addActionListener(evt -> {
85 if (inf.isSelected()) {
86 secondIntervalNumber.setEnabled(false);
87
88=== modified file 'src/pipe/gui/widgets/PlaceEditorPanel.java'
89--- src/pipe/gui/widgets/PlaceEditorPanel.java 2021-08-24 08:23:25 +0000
90+++ src/pipe/gui/widgets/PlaceEditorPanel.java 2021-10-17 18:42:08 +0000
91@@ -332,7 +332,7 @@
92 gbc = GridBagHelper.as(2,0, new Insets(3, 3, 3, 3));
93 invariantGroup.add(invariantSpinner, gbc);
94
95- invariantInf = new JCheckBox("inf");
96+ invariantInf = new JCheckBox(Character.toString('\u221e'));
97 invariantInf.addActionListener(arg0 -> {
98 if(!isUrgencyOK()){
99 invariantInf.setSelected(true);

Subscribers

People subscribed via source and target branches