Merge lp:~tapaal-contributor/tapaal/cpn-caseSensitivity into lp:~tapaal-contributor/tapaal/cpn-gui-dev
- cpn-caseSensitivity
- Merge into cpn-gui-dev
Proposed by
Kenneth Yrke Jørgensen
Status: | Merged |
---|---|
Approved by: | Jiri Srba |
Approved revision: | 1614 |
Merged at revision: | 1615 |
Proposed branch: | lp:~tapaal-contributor/tapaal/cpn-caseSensitivity |
Merge into: | lp:~tapaal-contributor/tapaal/cpn-gui-dev |
Diff against target: |
338 lines (+34/-33) 12 files modified
src/dk/aau/cs/io/LoadTACPN.java (+1/-0) src/dk/aau/cs/model/tapn/ConstantStore.java (+4/-4) src/dk/aau/cs/model/tapn/TimedArcPetriNet.java (+4/-4) src/dk/aau/cs/model/tapn/TimedArcPetriNetNetwork.java (+13/-13) src/net/tapaal/gui/petrinet/editor/ColorTypeDialogPanel.java (+4/-4) src/net/tapaal/gui/petrinet/editor/ConstantsDialogPanel.java (+1/-1) src/net/tapaal/gui/petrinet/editor/SharedPlaceNamePanel.java (+1/-1) src/net/tapaal/gui/petrinet/editor/SharedTransitionNamePanel.java (+1/-1) src/net/tapaal/gui/petrinet/editor/TemplateExplorer.java (+1/-1) src/net/tapaal/gui/petrinet/editor/VariablesDialogPanel.java (+2/-2) src/pipe/gui/petrinet/editor/PlaceEditorPanel.java (+1/-1) src/pipe/gui/petrinet/editor/TAPNTransitionEditor.java (+1/-1) |
To merge this branch: | bzr merge lp:~tapaal-contributor/tapaal/cpn-caseSensitivity |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jiri Srba | Approve | ||
Review via email: mp+415949@code.launchpad.net |
Commit message
Description of the change
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/io/LoadTACPN.java' | |||
2 | --- src/dk/aau/cs/io/LoadTACPN.java 2022-01-09 18:33:52 +0000 | |||
3 | +++ src/dk/aau/cs/io/LoadTACPN.java 2022-02-23 08:27:59 +0000 | |||
4 | @@ -322,6 +322,7 @@ | |||
5 | 322 | } | 322 | } |
6 | 323 | } | 323 | } |
7 | 324 | 324 | ||
8 | 325 | /// This will select the wrong color if the is overlap in naming, eg for IntegerRangeExpr (1,2,3,4) & (1,2) | ||
9 | 325 | private dk.aau.cs.model.CPN.Color getColor(String colorname) throws FormatException { | 326 | private dk.aau.cs.model.CPN.Color getColor(String colorname) throws FormatException { |
10 | 326 | for (ColorType ct : colortypes.values()) { | 327 | for (ColorType ct : colortypes.values()) { |
11 | 327 | for (dk.aau.cs.model.CPN.Color c : ct) { | 328 | for (dk.aau.cs.model.CPN.Color c : ct) { |
12 | 328 | 329 | ||
13 | === modified file 'src/dk/aau/cs/model/tapn/ConstantStore.java' | |||
14 | --- src/dk/aau/cs/model/tapn/ConstantStore.java 2022-01-09 18:09:13 +0000 | |||
15 | +++ src/dk/aau/cs/model/tapn/ConstantStore.java 2022-02-23 08:27:59 +0000 | |||
16 | @@ -74,7 +74,7 @@ | |||
17 | 74 | 74 | ||
18 | 75 | public boolean containsConstantByName(String name) { | 75 | public boolean containsConstantByName(String name) { |
19 | 76 | for(Constant c : constants) { | 76 | for(Constant c : constants) { |
21 | 77 | if(c.name().equalsIgnoreCase(name)) | 77 | if(c.name().equals(name)) |
22 | 78 | return true; | 78 | return true; |
23 | 79 | } | 79 | } |
24 | 80 | return false; | 80 | return false; |
25 | @@ -82,7 +82,7 @@ | |||
26 | 82 | 82 | ||
27 | 83 | public Constant getConstantByName(String name) { | 83 | public Constant getConstantByName(String name) { |
28 | 84 | for(Constant c : constants) { | 84 | for(Constant c : constants) { |
30 | 85 | if(c.name().equalsIgnoreCase(name)) | 85 | if(c.name().equals(name)) |
31 | 86 | return c; | 86 | return c; |
32 | 87 | } | 87 | } |
33 | 88 | return null; | 88 | return null; |
34 | @@ -218,11 +218,11 @@ | |||
35 | 218 | } | 218 | } |
36 | 219 | 219 | ||
37 | 220 | private boolean isNameInf(String name) { | 220 | private boolean isNameInf(String name) { |
39 | 221 | return name.equalsIgnoreCase("inf"); | 221 | return name.equals("inf"); |
40 | 222 | } | 222 | } |
41 | 223 | 223 | ||
42 | 224 | public Command updateConstant(String oldName, Constant updatedConstant, TimedArcPetriNetNetwork model) { | 224 | public Command updateConstant(String oldName, Constant updatedConstant, TimedArcPetriNetNetwork model) { |
44 | 225 | if (oldName.equalsIgnoreCase(updatedConstant.name()) || !containsConstantByName(updatedConstant.name())) { | 225 | if (oldName.equals(updatedConstant.name()) || !containsConstantByName(updatedConstant.name())) { |
45 | 226 | if (containsConstantByName(oldName)) { | 226 | if (containsConstantByName(oldName)) { |
46 | 227 | Constant old = getConstantByName(oldName); | 227 | Constant old = getConstantByName(oldName); |
47 | 228 | updatedConstant.setLowerBound(old.lowerBound()); | 228 | updatedConstant.setLowerBound(old.lowerBound()); |
48 | 229 | 229 | ||
49 | === modified file 'src/dk/aau/cs/model/tapn/TimedArcPetriNet.java' | |||
50 | --- src/dk/aau/cs/model/tapn/TimedArcPetriNet.java 2022-02-10 07:46:25 +0000 | |||
51 | +++ src/dk/aau/cs/model/tapn/TimedArcPetriNet.java 2022-02-23 08:27:59 +0000 | |||
52 | @@ -259,12 +259,12 @@ | |||
53 | 259 | if(parentNetwork != null && parentNetwork.isNameUsedForShared(name)) return true; | 259 | if(parentNetwork != null && parentNetwork.isNameUsedForShared(name)) return true; |
54 | 260 | 260 | ||
55 | 261 | for (TimedPlace place : places){ | 261 | for (TimedPlace place : places){ |
57 | 262 | if (place.name().equalsIgnoreCase(name)){ | 262 | if (place.name().equals(name)){ |
58 | 263 | return true; | 263 | return true; |
59 | 264 | } | 264 | } |
60 | 265 | } | 265 | } |
61 | 266 | for (TimedTransition transition : transitions){ | 266 | for (TimedTransition transition : transitions){ |
63 | 267 | if (transition.name().equalsIgnoreCase(name)){ | 267 | if (transition.name().equals(name)){ |
64 | 268 | return true; | 268 | return true; |
65 | 269 | } | 269 | } |
66 | 270 | } | 270 | } |
67 | @@ -287,7 +287,7 @@ | |||
68 | 287 | 287 | ||
69 | 288 | public TimedPlace getPlaceByName(String placeName) { | 288 | public TimedPlace getPlaceByName(String placeName) { |
70 | 289 | for (TimedPlace p : places) { | 289 | for (TimedPlace p : places) { |
72 | 290 | if (p.name().equalsIgnoreCase(placeName)) { | 290 | if (p.name().equals(placeName)) { |
73 | 291 | return p; | 291 | return p; |
74 | 292 | } | 292 | } |
75 | 293 | } | 293 | } |
76 | @@ -296,7 +296,7 @@ | |||
77 | 296 | 296 | ||
78 | 297 | public TimedTransition getTransitionByName(String transitionName) { | 297 | public TimedTransition getTransitionByName(String transitionName) { |
79 | 298 | for (TimedTransition t : transitions) { | 298 | for (TimedTransition t : transitions) { |
81 | 299 | if (t.name().equalsIgnoreCase(transitionName)) { | 299 | if (t.name().equals(transitionName)) { |
82 | 300 | return t; | 300 | return t; |
83 | 301 | } | 301 | } |
84 | 302 | } | 302 | } |
85 | 303 | 303 | ||
86 | === modified file 'src/dk/aau/cs/model/tapn/TimedArcPetriNetNetwork.java' | |||
87 | --- src/dk/aau/cs/model/tapn/TimedArcPetriNetNetwork.java 2022-01-09 19:10:28 +0000 | |||
88 | +++ src/dk/aau/cs/model/tapn/TimedArcPetriNetNetwork.java 2022-02-23 08:27:59 +0000 | |||
89 | @@ -95,13 +95,13 @@ | |||
90 | 95 | 95 | ||
91 | 96 | public boolean isNameUsedForShared(String name){ | 96 | public boolean isNameUsedForShared(String name){ |
92 | 97 | for(SharedTransition transition : sharedTransitions){ | 97 | for(SharedTransition transition : sharedTransitions){ |
94 | 98 | if(transition.name().equalsIgnoreCase(name)) { | 98 | if(transition.name().equals(name)) { |
95 | 99 | return true; | 99 | return true; |
96 | 100 | } | 100 | } |
97 | 101 | } | 101 | } |
98 | 102 | 102 | ||
99 | 103 | for(SharedPlace place : sharedPlaces){ | 103 | for(SharedPlace place : sharedPlaces){ |
101 | 104 | if(place.name().equalsIgnoreCase(name)) { | 104 | if(place.name().equals(name)) { |
102 | 105 | return true; | 105 | return true; |
103 | 106 | } | 106 | } |
104 | 107 | } | 107 | } |
105 | @@ -119,7 +119,7 @@ | |||
106 | 119 | public boolean isNameUsedForPlacesOnly(String name) { | 119 | public boolean isNameUsedForPlacesOnly(String name) { |
107 | 120 | for(TimedArcPetriNet net : tapns){ | 120 | for(TimedArcPetriNet net : tapns){ |
108 | 121 | for(TimedTransition transition : net.transitions()) { | 121 | for(TimedTransition transition : net.transitions()) { |
110 | 122 | if(name.equalsIgnoreCase(transition.name())) | 122 | if(name.equals(transition.name())) |
111 | 123 | return false; | 123 | return false; |
112 | 124 | } | 124 | } |
113 | 125 | } | 125 | } |
114 | @@ -128,7 +128,7 @@ | |||
115 | 128 | public boolean isNameUsedForTransitionsOnly(String name) { | 128 | public boolean isNameUsedForTransitionsOnly(String name) { |
116 | 129 | for(TimedArcPetriNet net : tapns){ | 129 | for(TimedArcPetriNet net : tapns){ |
117 | 130 | for(TimedPlace place : net.places()) { | 130 | for(TimedPlace place : net.places()) { |
119 | 131 | if(name.equalsIgnoreCase(place.name())) | 131 | if(name.equals(place.name())) |
120 | 132 | return false; | 132 | return false; |
121 | 133 | } | 133 | } |
122 | 134 | } | 134 | } |
123 | @@ -366,14 +366,14 @@ | |||
124 | 366 | 366 | ||
125 | 367 | public SharedTransition getSharedTransitionByName(String name) { | 367 | public SharedTransition getSharedTransitionByName(String name) { |
126 | 368 | for(SharedTransition t : sharedTransitions){ | 368 | for(SharedTransition t : sharedTransitions){ |
128 | 369 | if(t.name().equalsIgnoreCase(name)) return t; | 369 | if(t.name().equals(name)) return t; |
129 | 370 | } | 370 | } |
130 | 371 | return null; | 371 | return null; |
131 | 372 | } | 372 | } |
132 | 373 | 373 | ||
133 | 374 | public TimedPlace getSharedPlaceByName(String name) { | 374 | public TimedPlace getSharedPlaceByName(String name) { |
134 | 375 | for(SharedPlace place : sharedPlaces){ | 375 | for(SharedPlace place : sharedPlaces){ |
136 | 376 | if(place.name().equalsIgnoreCase(name)) return place; | 376 | if(place.name().equals(name)) return place; |
137 | 377 | } | 377 | } |
138 | 378 | return null; | 378 | return null; |
139 | 379 | } | 379 | } |
140 | @@ -660,7 +660,7 @@ | |||
141 | 660 | 660 | ||
142 | 661 | public Integer getColorTypeIndex(String name) { | 661 | public Integer getColorTypeIndex(String name) { |
143 | 662 | for (int i = 0; i < colorTypes.size(); i++) { | 662 | for (int i = 0; i < colorTypes.size(); i++) { |
145 | 663 | if (colorTypes.get(i).getName().equalsIgnoreCase(name)) { | 663 | if (colorTypes.get(i).getName().equals(name)) { |
146 | 664 | return i; | 664 | return i; |
147 | 665 | } | 665 | } |
148 | 666 | } | 666 | } |
149 | @@ -668,7 +668,7 @@ | |||
150 | 668 | } | 668 | } |
151 | 669 | public ColorType getColorTypeByName(String name) { | 669 | public ColorType getColorTypeByName(String name) { |
152 | 670 | for (ColorType element : colorTypes) { | 670 | for (ColorType element : colorTypes) { |
154 | 671 | if (element.getName().equalsIgnoreCase(name)) { | 671 | if (element.getName().equals(name)) { |
155 | 672 | return element; | 672 | return element; |
156 | 673 | } | 673 | } |
157 | 674 | } | 674 | } |
158 | @@ -677,7 +677,7 @@ | |||
159 | 677 | 677 | ||
160 | 678 | public Integer getVariableIndex(String name) { | 678 | public Integer getVariableIndex(String name) { |
161 | 679 | for (int i = 0; i < variables.size(); i++) { | 679 | for (int i = 0; i < variables.size(); i++) { |
163 | 680 | if (variables.get(i).getName().equalsIgnoreCase(name)) { | 680 | if (variables.get(i).getName().equals(name)) { |
164 | 681 | return i; | 681 | return i; |
165 | 682 | } | 682 | } |
166 | 683 | } | 683 | } |
167 | @@ -686,7 +686,7 @@ | |||
168 | 686 | 686 | ||
169 | 687 | public boolean isNameUsedForColorType(String name) { | 687 | public boolean isNameUsedForColorType(String name) { |
170 | 688 | for (ColorType element : colorTypes) { | 688 | for (ColorType element : colorTypes) { |
172 | 689 | if (element.getName().equalsIgnoreCase(name)) { | 689 | if (element.getName().equals(name)) { |
173 | 690 | return true; | 690 | return true; |
174 | 691 | } | 691 | } |
175 | 692 | } | 692 | } |
176 | @@ -694,7 +694,7 @@ | |||
177 | 694 | } | 694 | } |
178 | 695 | public boolean isNameUsedForVariable(String name) { | 695 | public boolean isNameUsedForVariable(String name) { |
179 | 696 | for (Variable element : variables) { | 696 | for (Variable element : variables) { |
181 | 697 | if (element.getName().equalsIgnoreCase(name)) { | 697 | if (element.getName().equals(name)) { |
182 | 698 | return true; | 698 | return true; |
183 | 699 | } | 699 | } |
184 | 700 | } | 700 | } |
185 | @@ -704,7 +704,7 @@ | |||
186 | 704 | for (ColorType e : colorTypes) { | 704 | for (ColorType e : colorTypes) { |
187 | 705 | if (e != ignored && !e.isIntegerRange() && !e.isProductColorType()){ | 705 | if (e != ignored && !e.isIntegerRange() && !e.isProductColorType()){ |
188 | 706 | for (Color c : e.getColors()) { | 706 | for (Color c : e.getColors()) { |
190 | 707 | if (c.getName().equalsIgnoreCase(name)) { | 707 | if (c.getName().equals(name)) { |
191 | 708 | return true; | 708 | return true; |
192 | 709 | } | 709 | } |
193 | 710 | } | 710 | } |
194 | @@ -718,7 +718,7 @@ | |||
195 | 718 | 718 | ||
196 | 719 | public Variable getVariableByName(String name){ | 719 | public Variable getVariableByName(String name){ |
197 | 720 | for (Variable variable : variables) { | 720 | for (Variable variable : variables) { |
199 | 721 | if (variable.getName().equalsIgnoreCase(name)) { | 721 | if (variable.getName().equals(name)) { |
200 | 722 | return variable; | 722 | return variable; |
201 | 723 | } | 723 | } |
202 | 724 | } | 724 | } |
203 | 725 | 725 | ||
204 | === modified file 'src/net/tapaal/gui/petrinet/editor/ColorTypeDialogPanel.java' | |||
205 | --- src/net/tapaal/gui/petrinet/editor/ColorTypeDialogPanel.java 2022-01-09 19:10:28 +0000 | |||
206 | +++ src/net/tapaal/gui/petrinet/editor/ColorTypeDialogPanel.java 2022-02-23 08:27:59 +0000 | |||
207 | @@ -445,11 +445,11 @@ | |||
208 | 445 | "The color cannot be named \"" + enumerationName + "\", as the name is reserved", | 445 | "The color cannot be named \"" + enumerationName + "\", as the name is reserved", |
209 | 446 | "Error", JOptionPane.ERROR_MESSAGE); | 446 | "Error", JOptionPane.ERROR_MESSAGE); |
210 | 447 | } else { | 447 | } else { |
212 | 448 | boolean nameIsInUse = network.isNameUsedForVariable(enumerationName) || network.isNameUsedForColor(enumerationName, null) || network.isNameUsedForColorType(enumerationName) || network.isNameUsedForConstant(enumerationName) || nameTextField.getText().equalsIgnoreCase(enumerationName); | 448 | boolean nameIsInUse = network.isNameUsedForVariable(enumerationName) || network.isNameUsedForColor(enumerationName, null) || network.isNameUsedForColorType(enumerationName) || network.isNameUsedForConstant(enumerationName) || nameTextField.getText().equals(enumerationName); |
213 | 449 | for (int i = 0; i < cyclicModel.getSize(); i++) { | 449 | for (int i = 0; i < cyclicModel.getSize(); i++) { |
214 | 450 | String n = cyclicModel.getElementAt(i).toString(); | 450 | String n = cyclicModel.getElementAt(i).toString(); |
215 | 451 | 451 | ||
217 | 452 | if (n.equalsIgnoreCase(enumerationName)) { | 452 | if (n.equals(enumerationName)) { |
218 | 453 | nameIsInUse = true; | 453 | nameIsInUse = true; |
219 | 454 | break; | 454 | break; |
220 | 455 | } | 455 | } |
221 | @@ -896,7 +896,7 @@ | |||
222 | 896 | "Error", JOptionPane.ERROR_MESSAGE); | 896 | "Error", JOptionPane.ERROR_MESSAGE); |
223 | 897 | return; | 897 | return; |
224 | 898 | } | 898 | } |
226 | 899 | if (!oldName.equals("") && !oldName.equalsIgnoreCase(name) && network.isNameUsedForColorType(name)) { | 899 | if (!oldName.equals("") && !oldName.equals(name) && network.isNameUsedForColorType(name)) { |
227 | 900 | JOptionPane.showMessageDialog( | 900 | JOptionPane.showMessageDialog( |
228 | 901 | TAPAALGUI.getApp(), | 901 | TAPAALGUI.getApp(), |
229 | 902 | "There is already another color type with the same name.\n\n" | 902 | "There is already another color type with the same name.\n\n" |
230 | @@ -981,7 +981,7 @@ | |||
231 | 981 | ArrayList<String> overlaps = new ArrayList<>(); | 981 | ArrayList<String> overlaps = new ArrayList<>(); |
232 | 982 | for (int i = 0; i < enumList.getModel().getSize(); i++) { | 982 | for (int i = 0; i < enumList.getModel().getSize(); i++) { |
233 | 983 | String e = enumList.getModel().getElementAt(i).toString(); | 983 | String e = enumList.getModel().getElementAt(i).toString(); |
235 | 984 | if (network.isNameUsedForVariable(e) || network.isNameUsedForColor(e, oldColorType) || network.isNameUsedForColorType(e) || network.isNameUsedForConstant(e) || name.equalsIgnoreCase(e)) { | 984 | if (network.isNameUsedForVariable(e) || network.isNameUsedForColor(e, oldColorType) || network.isNameUsedForColorType(e) || network.isNameUsedForConstant(e) || name.equals(e)) { |
236 | 985 | overlaps.add(e); | 985 | overlaps.add(e); |
237 | 986 | } | 986 | } |
238 | 987 | } | 987 | } |
239 | 988 | 988 | ||
240 | === modified file 'src/net/tapaal/gui/petrinet/editor/ConstantsDialogPanel.java' | |||
241 | --- src/net/tapaal/gui/petrinet/editor/ConstantsDialogPanel.java 2022-01-09 16:01:49 +0000 | |||
242 | +++ src/net/tapaal/gui/petrinet/editor/ConstantsDialogPanel.java 2022-02-23 08:27:59 +0000 | |||
243 | @@ -212,7 +212,7 @@ | |||
244 | 212 | } else { | 212 | } else { |
245 | 213 | int val = (Integer) valueSpinner.getValue(); | 213 | int val = (Integer) valueSpinner.getValue(); |
246 | 214 | if (!oldName.equals("")) { | 214 | if (!oldName.equals("")) { |
248 | 215 | if (!oldName.equalsIgnoreCase(newName) | 215 | if (!oldName.equals(newName) |
249 | 216 | && model.isNameUsedForConstant(newName)) { | 216 | && model.isNameUsedForConstant(newName)) { |
250 | 217 | JOptionPane | 217 | JOptionPane |
251 | 218 | .showMessageDialog( | 218 | .showMessageDialog( |
252 | 219 | 219 | ||
253 | === modified file 'src/net/tapaal/gui/petrinet/editor/SharedPlaceNamePanel.java' | |||
254 | --- src/net/tapaal/gui/petrinet/editor/SharedPlaceNamePanel.java 2022-01-09 16:46:17 +0000 | |||
255 | +++ src/net/tapaal/gui/petrinet/editor/SharedPlaceNamePanel.java 2022-02-23 08:27:59 +0000 | |||
256 | @@ -137,7 +137,7 @@ | |||
257 | 137 | private boolean updateExistingPlace(String name) { | 137 | private boolean updateExistingPlace(String name) { |
258 | 138 | String oldName = placeToEdit.name(); | 138 | String oldName = placeToEdit.name(); |
259 | 139 | 139 | ||
261 | 140 | if(placeToEdit.network().isNameUsed(name) && !oldName.equalsIgnoreCase(name)) { | 140 | if(placeToEdit.network().isNameUsed(name) && !oldName.equals(name)) { |
262 | 141 | JOptionPane.showMessageDialog(SharedPlaceNamePanel.this, "The specified name is already used by a place or transition in one of the components.", "Error", JOptionPane.ERROR_MESSAGE); | 141 | JOptionPane.showMessageDialog(SharedPlaceNamePanel.this, "The specified name is already used by a place or transition in one of the components.", "Error", JOptionPane.ERROR_MESSAGE); |
263 | 142 | nameField.requestFocusInWindow(); | 142 | nameField.requestFocusInWindow(); |
264 | 143 | return false; | 143 | return false; |
265 | 144 | 144 | ||
266 | === modified file 'src/net/tapaal/gui/petrinet/editor/SharedTransitionNamePanel.java' | |||
267 | --- src/net/tapaal/gui/petrinet/editor/SharedTransitionNamePanel.java 2022-01-09 16:46:17 +0000 | |||
268 | +++ src/net/tapaal/gui/petrinet/editor/SharedTransitionNamePanel.java 2022-02-23 08:27:59 +0000 | |||
269 | @@ -140,7 +140,7 @@ | |||
270 | 140 | 140 | ||
271 | 141 | String oldName = transitionToEdit.name(); | 141 | String oldName = transitionToEdit.name(); |
272 | 142 | 142 | ||
274 | 143 | if(transitionToEdit.network().isNameUsed(name) && !oldName.equalsIgnoreCase(name)) { | 143 | if(transitionToEdit.network().isNameUsed(name) && !oldName.equals(name)) { |
275 | 144 | JOptionPane.showMessageDialog(SharedTransitionNamePanel.this, "The specified name is already used by a place or transition in one of the components.", "Error", JOptionPane.ERROR_MESSAGE); | 144 | JOptionPane.showMessageDialog(SharedTransitionNamePanel.this, "The specified name is already used by a place or transition in one of the components.", "Error", JOptionPane.ERROR_MESSAGE); |
276 | 145 | nameField.requestFocusInWindow(); | 145 | nameField.requestFocusInWindow(); |
277 | 146 | return false; | 146 | return false; |
278 | 147 | 147 | ||
279 | === modified file 'src/net/tapaal/gui/petrinet/editor/TemplateExplorer.java' | |||
280 | --- src/net/tapaal/gui/petrinet/editor/TemplateExplorer.java 2022-02-11 09:08:00 +0000 | |||
281 | +++ src/net/tapaal/gui/petrinet/editor/TemplateExplorer.java 2022-02-23 08:27:59 +0000 | |||
282 | @@ -442,7 +442,7 @@ | |||
283 | 442 | showRenameTemplateDialog(newName); | 442 | showRenameTemplateDialog(newName); |
284 | 443 | return; | 443 | return; |
285 | 444 | } | 444 | } |
287 | 445 | else if (parent.network().hasTAPNCalled(newName) && !template.model().name().equalsIgnoreCase(newName)) { | 445 | else if (parent.network().hasTAPNCalled(newName) && !template.model().name().equals(newName)) { |
288 | 446 | JOptionPane.showMessageDialog( | 446 | JOptionPane.showMessageDialog( |
289 | 447 | parent.drawingSurface(), | 447 | parent.drawingSurface(), |
290 | 448 | "A component named \"" + newName + "\" already exists. Try another name.", | 448 | "A component named \"" + newName + "\" already exists. Try another name.", |
291 | 449 | 449 | ||
292 | === modified file 'src/net/tapaal/gui/petrinet/editor/VariablesDialogPanel.java' | |||
293 | --- src/net/tapaal/gui/petrinet/editor/VariablesDialogPanel.java 2022-01-09 16:46:17 +0000 | |||
294 | +++ src/net/tapaal/gui/petrinet/editor/VariablesDialogPanel.java 2022-02-23 08:27:59 +0000 | |||
295 | @@ -258,7 +258,7 @@ | |||
296 | 258 | return; | 258 | return; |
297 | 259 | } | 259 | } |
298 | 260 | //If we are editing a variable it is allowed to have the same name | 260 | //If we are editing a variable it is allowed to have the same name |
300 | 261 | if ((variable == null || !variable.getName().equalsIgnoreCase(newName)) && network.isNameUsedForVariable(newName) ) { | 261 | if ((variable == null || !variable.getName().equals(newName)) && network.isNameUsedForVariable(newName) ) { |
301 | 262 | JOptionPane | 262 | JOptionPane |
302 | 263 | .showMessageDialog( | 263 | .showMessageDialog( |
303 | 264 | TAPAALGUI.getApp(), | 264 | TAPAALGUI.getApp(), |
304 | @@ -268,7 +268,7 @@ | |||
305 | 268 | nameTextField.requestFocusInWindow(); | 268 | nameTextField.requestFocusInWindow(); |
306 | 269 | return; | 269 | return; |
307 | 270 | } | 270 | } |
309 | 271 | if (!oldName.equals("") && !oldName.equalsIgnoreCase(newName) && network.isNameUsedForVariable(newName)) { | 271 | if (!oldName.equals("") && !oldName.equals(newName) && network.isNameUsedForVariable(newName)) { |
310 | 272 | JOptionPane | 272 | JOptionPane |
311 | 273 | .showMessageDialog( | 273 | .showMessageDialog( |
312 | 274 | TAPAALGUI.getApp(), | 274 | TAPAALGUI.getApp(), |
313 | 275 | 275 | ||
314 | === modified file 'src/pipe/gui/petrinet/editor/PlaceEditorPanel.java' | |||
315 | --- src/pipe/gui/petrinet/editor/PlaceEditorPanel.java 2022-01-09 19:10:28 +0000 | |||
316 | +++ src/pipe/gui/petrinet/editor/PlaceEditorPanel.java 2022-02-23 08:27:59 +0000 | |||
317 | @@ -623,7 +623,7 @@ | |||
318 | 623 | 623 | ||
319 | 624 | String newName = nameTextField.getText(); | 624 | String newName = nameTextField.getText(); |
320 | 625 | String oldName = place.underlyingPlace().name(); | 625 | String oldName = place.underlyingPlace().name(); |
322 | 626 | if(context.activeModel().isNameUsed(newName) && !oldName.equalsIgnoreCase(newName)){ | 626 | if(context.activeModel().isNameUsed(newName) && !oldName.equals(newName)){ |
323 | 627 | context.undoManager().undo(); | 627 | context.undoManager().undo(); |
324 | 628 | JOptionPane.showMessageDialog(this, "The specified name is already used by another place or transition.", "Error", JOptionPane.ERROR_MESSAGE); | 628 | JOptionPane.showMessageDialog(this, "The specified name is already used by another place or transition.", "Error", JOptionPane.ERROR_MESSAGE); |
325 | 629 | return false; | 629 | return false; |
326 | 630 | 630 | ||
327 | === modified file 'src/pipe/gui/petrinet/editor/TAPNTransitionEditor.java' | |||
328 | --- src/pipe/gui/petrinet/editor/TAPNTransitionEditor.java 2022-01-07 16:58:59 +0000 | |||
329 | +++ src/pipe/gui/petrinet/editor/TAPNTransitionEditor.java 2022-02-23 08:27:59 +0000 | |||
330 | @@ -402,7 +402,7 @@ | |||
331 | 402 | return false; | 402 | return false; |
332 | 403 | } | 403 | } |
333 | 404 | }else{ | 404 | }else{ |
335 | 405 | if(transition.underlyingTransition().model().isNameUsed(newName) && (wasShared || !transition.underlyingTransition().name().equalsIgnoreCase(newName))){ | 405 | if(transition.underlyingTransition().model().isNameUsed(newName) && (wasShared || !transition.underlyingTransition().name().equals(newName))){ |
336 | 406 | context.undoManager().undo(); | 406 | context.undoManager().undo(); |
337 | 407 | JOptionPane.showMessageDialog(this, | 407 | JOptionPane.showMessageDialog(this, |
338 | 408 | "The specified name is already used by another place or transition.", | 408 | "The specified name is already used by another place or transition.", |