Merge lp:~yrke/tapaal/removeNetType into lp:tapaal
- removeNetType
- Merge into trunk
Proposed by
Kenneth Yrke Jørgensen
Status: | Merged |
---|---|
Approved by: | Jiri Srba |
Approved revision: | 1367 |
Merged at revision: | 1056 |
Proposed branch: | lp:~yrke/tapaal/removeNetType |
Merge into: | lp:tapaal |
Diff against target: |
594 lines (+112/-156) 12 files modified
src/dk/aau/cs/gui/TabContent.java (+11/-12) src/dk/aau/cs/io/TimedArcPetriNetNetworkWriter.java (+2/-7) src/pipe/dataLayer/DataLayer.java (+1/-11) src/pipe/gui/AnimationController.java (+17/-19) src/pipe/gui/GuiFrame.java (+3/-10) src/pipe/gui/TikZExporter.java (+12/-22) src/pipe/gui/graphicElements/tapn/TimedInputArcComponent.java (+55/-58) src/pipe/gui/handler/ArcHandler.java (+2/-2) src/pipe/gui/handler/LabelHandler.java (+1/-4) src/pipe/gui/handler/TimedArcHandler.java (+1/-3) src/pipe/gui/widgets/ConstantsPane.java (+4/-4) src/pipe/gui/widgets/NewTAPNPanel.java (+3/-4) |
To merge this branch: | bzr merge lp:~yrke/tapaal/removeNetType |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jiri Srba | Approve | ||
Review via email: mp+384089@code.launchpad.net |
Commit message
Removed the legacy NetType values, removed before staring reimplementing untimed support.
Description of the change
To post a comment you must log in.
Revision history for this message
Kenneth Yrke Jørgensen (yrke) wrote : | # |
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 2020-04-30 12:51:14 +0000 |
3 | +++ src/dk/aau/cs/gui/TabContent.java 2020-05-18 07:40:41 +0000 |
4 | @@ -59,7 +59,7 @@ |
5 | * Creates a new tab with the selected file, or a new file if filename==null |
6 | */ |
7 | public static TabContent createNewTabFromInputStream(InputStream file, String name) throws Exception { |
8 | - TabContent tab = new TabContent(NetType.TAPN); |
9 | + TabContent tab = new TabContent(); |
10 | tab.setInitialName(name); |
11 | |
12 | try { |
13 | @@ -80,8 +80,8 @@ |
14 | return tab; |
15 | } |
16 | |
17 | - public static TabContent createNewEmptyTab(String name, NetType netType){ |
18 | - TabContent tab = new TabContent(NetType.TAPN); |
19 | + public static TabContent createNewEmptyTab(String name){ |
20 | + TabContent tab = new TabContent(); |
21 | tab.setInitialName(name); |
22 | |
23 | //Set Default Template |
24 | @@ -97,7 +97,7 @@ |
25 | */ |
26 | |
27 | public static TabContent createNewTabFromPNMLFile(File file) throws Exception { |
28 | - TabContent tab = new TabContent(NetType.TAPN); |
29 | + TabContent tab = new TabContent(); |
30 | |
31 | String name = null; |
32 | |
33 | @@ -225,7 +225,7 @@ |
34 | |
35 | private WorkflowDialog workflowDialog = null; |
36 | |
37 | - public TabContent(NetType netType) { |
38 | + public TabContent() { |
39 | for (TimedArcPetriNet net : tapnNetwork.allTemplates()) { |
40 | guiModels.put(net, new DataLayer()); |
41 | zoomLevels.put(net, new Zoomer()); |
42 | @@ -256,7 +256,7 @@ |
43 | drawingSurfaceDummy.add(new JLabel("The net is too big to be drawn"), gc); |
44 | |
45 | createEditorLeftPane(); |
46 | - createAnimatorSplitPane(netType); |
47 | + createAnimatorSplitPane(); |
48 | |
49 | this.setOrientation(HORIZONTAL_SPLIT); |
50 | this.setLeftComponent(editorSplitPaneScroller); |
51 | @@ -279,9 +279,8 @@ |
52 | } |
53 | |
54 | public void createEditorLeftPane() { |
55 | - boolean enableAddButton = getModel() == null ? true : !getModel().netType().equals(NetType.UNTIMED); |
56 | |
57 | - constantsPanel = new ConstantsPane(enableAddButton, this); |
58 | + constantsPanel = new ConstantsPane(this); |
59 | constantsPanel.setPreferredSize( |
60 | new Dimension( |
61 | constantsPanel.getPreferredSize().width, |
62 | @@ -507,12 +506,12 @@ |
63 | ); |
64 | } |
65 | |
66 | - private void createAnimatorSplitPane(NetType netType) { |
67 | + private void createAnimatorSplitPane() { |
68 | if (animBox == null) { |
69 | createAnimationHistory(); |
70 | } |
71 | if (animControlerBox == null) { |
72 | - createAnimationController(netType); |
73 | + createAnimationController(); |
74 | } |
75 | if (transitionFireing == null) { |
76 | createTransitionFireing(); |
77 | @@ -696,8 +695,8 @@ |
78 | animatorSplitPane.validate(); |
79 | } |
80 | |
81 | - private void createAnimationController(NetType netType) { |
82 | - animControlerBox = new AnimationController(netType); |
83 | + private void createAnimationController() { |
84 | + animControlerBox = new AnimationController(); |
85 | |
86 | animationControllerScrollPane = new JScrollPane(animControlerBox); |
87 | animationControllerScrollPane.setBorder(new EmptyBorder(0, 0, 0, 0)); |
88 | |
89 | === modified file 'src/dk/aau/cs/io/TimedArcPetriNetNetworkWriter.java' |
90 | --- src/dk/aau/cs/io/TimedArcPetriNetNetworkWriter.java 2020-04-18 15:50:17 +0000 |
91 | +++ src/dk/aau/cs/io/TimedArcPetriNetNetworkWriter.java 2020-05-18 07:40:41 +0000 |
92 | @@ -193,13 +193,8 @@ |
93 | NET.setAttributeNode(netAttrActive); |
94 | |
95 | Attr netAttrType = document.createAttribute("type"); |
96 | - switch (guiModel.netType()) { |
97 | - case UNTIMED: |
98 | - netAttrType.setValue("Untimed P/T net"); |
99 | - break; |
100 | - default: |
101 | - netAttrType.setValue("P/T net"); |
102 | - } |
103 | + netAttrType.setValue("P/T net"); |
104 | + |
105 | NET.setAttributeNode(netAttrType); |
106 | |
107 | appendAnnotationNotes(document, guiModel, NET); |
108 | |
109 | === modified file 'src/pipe/dataLayer/DataLayer.java' |
110 | --- src/pipe/dataLayer/DataLayer.java 2020-04-18 16:13:35 +0000 |
111 | +++ src/pipe/dataLayer/DataLayer.java 2020-05-18 07:40:41 +0000 |
112 | @@ -97,8 +97,6 @@ |
113 | return result; |
114 | } |
115 | |
116 | - private NetType type = NetType.TAPN; |
117 | - |
118 | /** |
119 | * Create empty Petri-Net object |
120 | */ |
121 | @@ -836,15 +834,7 @@ |
122 | return null; |
123 | } |
124 | |
125 | - public NetType netType() { |
126 | - return type; |
127 | - } |
128 | - |
129 | - public void setNetType(NetType type) { |
130 | - this.type = type; |
131 | - } |
132 | - |
133 | - public void redrawVisibleTokenLists() { |
134 | + public void redrawVisibleTokenLists() { |
135 | for (Place place : placesArray) { |
136 | if (place instanceof TimedPlaceComponent) { |
137 | TimedPlaceComponent tp = (TimedPlaceComponent) place; |
138 | |
139 | === removed file 'src/pipe/dataLayer/NetType.java' |
140 | === modified file 'src/pipe/gui/AnimationController.java' |
141 | --- src/pipe/gui/AnimationController.java 2020-04-18 14:41:05 +0000 |
142 | +++ src/pipe/gui/AnimationController.java 2020-05-18 07:40:41 +0000 |
143 | @@ -21,7 +21,6 @@ |
144 | import javax.swing.border.EmptyBorder; |
145 | import javax.swing.text.AbstractDocument; |
146 | |
147 | -import pipe.dataLayer.NetType; |
148 | import pipe.gui.action.GuiAction; |
149 | import net.tapaal.swinghelpers.DecimalOnlyDocumentFilter; |
150 | import dk.aau.cs.gui.components.NonsearchableJComboBox; |
151 | @@ -53,7 +52,7 @@ |
152 | JComboBox<String> firermodebox = null; |
153 | private static final String[] FIRINGMODES = { "Random", "Oldest", "Youngest", "Manual" }; |
154 | |
155 | - public AnimationController(NetType netType) { |
156 | + public AnimationController() { |
157 | |
158 | stepbackwardAction = CreateGui.getAppGui().stepbackwardAction; |
159 | stepforwardAction = CreateGui.getAppGui().stepforwardAction; |
160 | @@ -86,23 +85,22 @@ |
161 | c.gridy = 2; |
162 | add(animationToolBar, c); |
163 | |
164 | - if (!netType.equals(NetType.UNTIMED)) { |
165 | - JPanel firemode = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
166 | - |
167 | - JLabel label = new JLabel("Token selection: "); |
168 | - |
169 | - firemode.add(label); |
170 | - firemode.add(firermodebox); |
171 | - |
172 | - c.weightx = 0.5; |
173 | - c.gridx = 0; |
174 | - c.gridy = 0; |
175 | - add(firemode, c); |
176 | - |
177 | - initDelayTimePanel(animationToolBar); |
178 | - |
179 | - initDelaySlider(); |
180 | - } |
181 | + JPanel firemode = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
182 | + |
183 | + JLabel label = new JLabel("Token selection: "); |
184 | + |
185 | + firemode.add(label); |
186 | + firemode.add(firermodebox); |
187 | + |
188 | + c.weightx = 0.5; |
189 | + c.gridx = 0; |
190 | + c.gridy = 0; |
191 | + add(firemode, c); |
192 | + |
193 | + initDelayTimePanel(animationToolBar); |
194 | + |
195 | + initDelaySlider(); |
196 | + |
197 | |
198 | setBorder(BorderFactory.createCompoundBorder(BorderFactory |
199 | .createTitledBorder("Simulation Control"), BorderFactory |
200 | |
201 | === modified file 'src/pipe/gui/GuiFrame.java' |
202 | --- src/pipe/gui/GuiFrame.java 2020-04-30 12:51:14 +0000 |
203 | +++ src/pipe/gui/GuiFrame.java 2020-05-18 07:40:41 +0000 |
204 | @@ -25,7 +25,6 @@ |
205 | import net.tapaal.helpers.Reference.Reference; |
206 | import net.tapaal.swinghelpers.ExtendedJTabbedPane; |
207 | import net.tapaal.swinghelpers.ToggleButtonWithoutText; |
208 | -import pipe.dataLayer.NetType; |
209 | import pipe.gui.Pipe.ElementType; |
210 | import pipe.gui.action.GuiAction; |
211 | import pipe.gui.graphicElements.PetriNetObject; |
212 | @@ -919,11 +918,7 @@ |
213 | timedPlaceAction.setEnabled(true); |
214 | timedArcAction.setEnabled(true); |
215 | inhibarcAction.setEnabled(true); |
216 | - if (!CreateGui.getModel().netType().equals(NetType.UNTIMED)) { |
217 | - transportArcAction.setEnabled(true); |
218 | - } else { |
219 | - transportArcAction.setEnabled(false); |
220 | - } |
221 | + transportArcAction.setEnabled(true); |
222 | |
223 | annotationAction.setEnabled(true); |
224 | transAction.setEnabled(true); |
225 | @@ -982,10 +977,8 @@ |
226 | showConstantsAction.setEnabled(false); |
227 | showQueriesAction.setEnabled(false); |
228 | |
229 | - // Only enable this if it is not an untimed net. |
230 | - if (CreateGui.getModel().netType() != NetType.UNTIMED) { |
231 | - timeAction.setEnabled(true); |
232 | - } |
233 | + timeAction.setEnabled(true); |
234 | + |
235 | delayFireAction.setEnabled(true); |
236 | stepbackwardAction.setEnabled(true); |
237 | stepforwardAction.setEnabled(true); |
238 | |
239 | === modified file 'src/pipe/gui/TikZExporter.java' |
240 | --- src/pipe/gui/TikZExporter.java 2020-04-18 16:13:35 +0000 |
241 | +++ src/pipe/gui/TikZExporter.java 2020-05-18 07:40:41 +0000 |
242 | @@ -8,7 +8,6 @@ |
243 | import dk.aau.cs.model.tapn.TimedToken; |
244 | |
245 | import pipe.dataLayer.DataLayer; |
246 | -import pipe.dataLayer.NetType; |
247 | import pipe.gui.graphicElements.Arc; |
248 | import pipe.gui.graphicElements.ArcPathPoint; |
249 | import pipe.gui.graphicElements.Place; |
250 | @@ -132,13 +131,7 @@ |
251 | String arcLabelPositionString = "\\draw (" + RoundCoordinate(arc.getNameLabel().getXPosition())+ "," + (RoundCoordinate(arc.getNameLabel().getYPosition())*(-1)) + ") node {"; |
252 | |
253 | if (arc instanceof TimedInputArcComponent) { |
254 | - if (net.netType().equals(NetType.UNTIMED)) { |
255 | - if (arc.getWeight().value() > 1) { |
256 | - arcLabel += arcLabelPositionString + "$" + arc.getWeight().value() + "\\times$}\\;\n"; |
257 | - } |
258 | - return arcLabel; |
259 | - } |
260 | - if (!(arc.getSource() instanceof TimedTransitionComponent)) { |
261 | + if (!(arc.getSource() instanceof TimedTransitionComponent)) { |
262 | arcLabel = arcLabelPositionString; |
263 | if (arc.getWeight().value() > 1) { |
264 | arcLabel += "$" + arc.getWeight().value() + "\\times$\\ "; |
265 | @@ -264,7 +257,7 @@ |
266 | |
267 | String tokensInPlace = ""; |
268 | if (tokens.size() > 0) { |
269 | - if (tokens.size() == 1 && !net.netType().equals(NetType.UNTIMED)) { |
270 | + if (tokens.size() == 1) { |
271 | tokensInPlace = ", structured tokens={" + tokens.get(0).age().setScale(1) + "},"; |
272 | } else { |
273 | tokensInPlace = exportMultipleTokens(tokens); |
274 | @@ -274,8 +267,7 @@ |
275 | } |
276 | |
277 | protected String getPlaceInvariantString(Place place) { |
278 | - if (net.netType().equals(NetType.UNTIMED)) return ""; |
279 | - String invariant = ""; |
280 | + String invariant = ""; |
281 | |
282 | if (!((TimedPlaceComponent) place).getInvariantAsString().contains("inf")) |
283 | invariant = "$\\mathrm{" + replaceWithMathLatex(((TimedPlaceComponent) place).getInvariantAsString()) + "}$};\n"; |
284 | @@ -289,16 +281,14 @@ |
285 | out.append(tokens.size()); |
286 | |
287 | out.append("},"); |
288 | - if (!net.netType().equals(NetType.UNTIMED)) { |
289 | - out.append("pin=above:{\\{"); |
290 | - for (int i = 0; i < tokens.size() - 1; i++) { |
291 | - out.append(tokens.get(i).age().setScale(1)); |
292 | - out.append(','); |
293 | - } |
294 | - out.append(tokens.get(tokens.size() - 1).age().setScale(1)); |
295 | - out.append("\\}},"); |
296 | - } |
297 | - return out.toString(); |
298 | + out.append("pin=above:{\\{"); |
299 | + for (int i = 0; i < tokens.size() - 1; i++) { |
300 | + out.append(tokens.get(i).age().setScale(1)); |
301 | + out.append(','); |
302 | + } |
303 | + out.append(tokens.get(tokens.size() - 1).age().setScale(1)); |
304 | + out.append("\\}},"); |
305 | + return out.toString(); |
306 | } |
307 | |
308 | private StringBuffer exportTikZstyle() { |
309 | @@ -313,7 +303,7 @@ |
310 | out.append("%% This can be adjusted by tuning the coordinates of the label\n"); |
311 | out.append("\\tikzstyle{arc}=[->,>=stealth,thick]\n"); |
312 | |
313 | - if (!net.netType().equals(NetType.UNTIMED)) out.append("\\tikzstyle{transportArc}=[->,>=diamond,thick]\n"); |
314 | + out.append("\\tikzstyle{transportArc}=[->,>=diamond,thick]\n"); |
315 | out.append("\\tikzstyle{inhibArc}=[->,>=o,thick]\n"); |
316 | |
317 | out.append("\\tikzstyle{every place}=[minimum size=6mm,thick]\n"); |
318 | |
319 | === modified file 'src/pipe/gui/graphicElements/tapn/TimedInputArcComponent.java' |
320 | --- src/pipe/gui/graphicElements/tapn/TimedInputArcComponent.java 2020-04-18 12:27:02 +0000 |
321 | +++ src/pipe/gui/graphicElements/tapn/TimedInputArcComponent.java 2020-05-18 07:40:41 +0000 |
322 | @@ -2,7 +2,6 @@ |
323 | |
324 | import java.util.Hashtable; |
325 | |
326 | -import pipe.dataLayer.NetType; |
327 | import pipe.gui.CreateGui; |
328 | import pipe.gui.Pipe; |
329 | import pipe.gui.graphicElements.PlaceTransitionObject; |
330 | @@ -78,63 +77,61 @@ |
331 | if(CreateGui.getModel() == null) { |
332 | return; |
333 | } |
334 | - if (!CreateGui.getModel().netType().equals(NetType.UNTIMED)) { |
335 | - if (inputArc == null) |
336 | - getNameLabel().setText(""); |
337 | - else { |
338 | - if (!CreateGui.getApp().showZeroToInfinityIntervals()) { |
339 | - if (inputArc.interval().toString(showConstantNames).equals("[0,inf)")){ |
340 | - getNameLabel().setText(""); |
341 | - } |
342 | - else { |
343 | - getNameLabel().setText(inputArc.interval().toString(showConstantNames)); |
344 | - } |
345 | - } |
346 | - else { |
347 | - getNameLabel().setText(inputArc.interval().toString(showConstantNames)); |
348 | - } |
349 | - |
350 | - getNameLabel().setText(getWeight().toString(showConstantNames)+" "+getNameLabel().getText()); |
351 | - |
352 | - // Handle constant highlighting |
353 | - boolean focusedConstant = false; |
354 | - boolean isvisible = true; |
355 | - if(inputArc.interval().lowerBound() instanceof ConstantBound){ |
356 | - if(((ConstantBound) inputArc.interval().lowerBound()).constant().hasFocus()){ |
357 | - focusedConstant = true; |
358 | - } |
359 | - |
360 | - if(!((ConstantBound) inputArc.interval().lowerBound()).constant().getVisible()) { |
361 | - isvisible = false; |
362 | - } |
363 | - } |
364 | - if(inputArc.interval().upperBound() instanceof ConstantBound){ |
365 | - if(((ConstantBound) inputArc.interval().upperBound()).constant().hasFocus()){ |
366 | - focusedConstant = true; |
367 | - } |
368 | - if(!((ConstantBound) inputArc.interval().upperBound()).constant().getVisible()){ |
369 | - isvisible = false; |
370 | - } |
371 | - } |
372 | - if(getWeight() instanceof ConstantWeight){ |
373 | - if(((ConstantWeight) getWeight()).constant().hasFocus()){ |
374 | - focusedConstant = true; |
375 | - } |
376 | - if(((ConstantWeight) getWeight()).constant().getVisible()){ |
377 | - isvisible = false; |
378 | - } |
379 | - } |
380 | - if(focusedConstant){ |
381 | - getNameLabel().setForeground(Pipe.SELECTION_TEXT_COLOUR); |
382 | - }else{ |
383 | - getNameLabel().setForeground(Pipe.ELEMENT_TEXT_COLOUR); |
384 | - } |
385 | - pnName.setVisible(isvisible); |
386 | - |
387 | - } |
388 | - this.setLabelPosition(); |
389 | - } |
390 | - } |
391 | + if (inputArc == null) |
392 | + getNameLabel().setText(""); |
393 | + else { |
394 | + if (!CreateGui.getApp().showZeroToInfinityIntervals()) { |
395 | + if (inputArc.interval().toString(showConstantNames).equals("[0,inf)")){ |
396 | + getNameLabel().setText(""); |
397 | + } |
398 | + else { |
399 | + getNameLabel().setText(inputArc.interval().toString(showConstantNames)); |
400 | + } |
401 | + } |
402 | + else { |
403 | + getNameLabel().setText(inputArc.interval().toString(showConstantNames)); |
404 | + } |
405 | + |
406 | + getNameLabel().setText(getWeight().toString(showConstantNames)+" "+getNameLabel().getText()); |
407 | + |
408 | + // Handle constant highlighting |
409 | + boolean focusedConstant = false; |
410 | + boolean isvisible = true; |
411 | + if(inputArc.interval().lowerBound() instanceof ConstantBound){ |
412 | + if(((ConstantBound) inputArc.interval().lowerBound()).constant().hasFocus()){ |
413 | + focusedConstant = true; |
414 | + } |
415 | + |
416 | + if(!((ConstantBound) inputArc.interval().lowerBound()).constant().getVisible()) { |
417 | + isvisible = false; |
418 | + } |
419 | + } |
420 | + if(inputArc.interval().upperBound() instanceof ConstantBound){ |
421 | + if(((ConstantBound) inputArc.interval().upperBound()).constant().hasFocus()){ |
422 | + focusedConstant = true; |
423 | + } |
424 | + if(!((ConstantBound) inputArc.interval().upperBound()).constant().getVisible()){ |
425 | + isvisible = false; |
426 | + } |
427 | + } |
428 | + if(getWeight() instanceof ConstantWeight){ |
429 | + if(((ConstantWeight) getWeight()).constant().hasFocus()){ |
430 | + focusedConstant = true; |
431 | + } |
432 | + if(((ConstantWeight) getWeight()).constant().getVisible()){ |
433 | + isvisible = false; |
434 | + } |
435 | + } |
436 | + if(focusedConstant){ |
437 | + getNameLabel().setForeground(Pipe.SELECTION_TEXT_COLOUR); |
438 | + }else{ |
439 | + getNameLabel().setForeground(Pipe.ELEMENT_TEXT_COLOUR); |
440 | + } |
441 | + pnName.setVisible(isvisible); |
442 | + |
443 | + } |
444 | + this.setLabelPosition(); |
445 | + } |
446 | |
447 | public dk.aau.cs.model.tapn.TimedInputArc underlyingTimedInputArc() { |
448 | return inputArc; |
449 | |
450 | === modified file 'src/pipe/gui/handler/ArcHandler.java' |
451 | --- src/pipe/gui/handler/ArcHandler.java 2020-04-02 09:28:14 +0000 |
452 | +++ src/pipe/gui/handler/ArcHandler.java 2020-05-18 07:40:41 +0000 |
453 | @@ -4,7 +4,7 @@ |
454 | import java.awt.geom.Point2D; |
455 | import javax.swing.JMenuItem; |
456 | import javax.swing.JPopupMenu; |
457 | -import pipe.dataLayer.NetType; |
458 | + |
459 | import pipe.gui.CreateGui; |
460 | import pipe.gui.action.SplitArcAction; |
461 | import pipe.gui.graphicElements.Arc; |
462 | @@ -65,7 +65,7 @@ |
463 | e.isAltDown() |
464 | ) |
465 | ); |
466 | - } else if (!CreateGui.getModel().netType().equals(NetType.UNTIMED)) { |
467 | + } else { |
468 | ((TimedOutputArcComponent) myObject).showTimeIntervalEditor(); |
469 | } |
470 | } else { |
471 | |
472 | === modified file 'src/pipe/gui/handler/LabelHandler.java' |
473 | --- src/pipe/gui/handler/LabelHandler.java 2020-04-02 09:44:05 +0000 |
474 | +++ src/pipe/gui/handler/LabelHandler.java 2020-05-18 07:40:41 +0000 |
475 | @@ -6,7 +6,6 @@ |
476 | import javax.swing.SwingUtilities; |
477 | |
478 | import dk.aau.cs.gui.undo.UpdateNameLabelOffsetCommand; |
479 | -import pipe.dataLayer.NetType; |
480 | import pipe.gui.CreateGui; |
481 | import pipe.gui.graphicElements.Arc; |
482 | import pipe.gui.graphicElements.NameLabel; |
483 | @@ -44,9 +43,7 @@ |
484 | if (CreateGui.getApp().isEditionAllowed()) { |
485 | if (e.getClickCount() == 2) { |
486 | Arc arc = (Arc) obj; |
487 | - if (!CreateGui.getModel().netType().equals(NetType.UNTIMED)) { |
488 | - ((TimedOutputArcComponent) arc).showTimeIntervalEditor(); |
489 | - } |
490 | + ((TimedOutputArcComponent) arc).showTimeIntervalEditor(); |
491 | } |
492 | } |
493 | } |
494 | |
495 | === modified file 'src/pipe/gui/handler/TimedArcHandler.java' |
496 | --- src/pipe/gui/handler/TimedArcHandler.java 2020-04-02 09:44:05 +0000 |
497 | +++ src/pipe/gui/handler/TimedArcHandler.java 2020-05-18 07:40:41 +0000 |
498 | @@ -5,8 +5,6 @@ |
499 | import javax.swing.JMenuItem; |
500 | import javax.swing.JPopupMenu; |
501 | |
502 | -import pipe.dataLayer.NetType; |
503 | -import pipe.gui.CreateGui; |
504 | import pipe.gui.action.SplitArcAction; |
505 | import pipe.gui.graphicElements.Arc; |
506 | import pipe.gui.graphicElements.tapn.TimedInhibitorArcComponent; |
507 | @@ -28,7 +26,7 @@ |
508 | |
509 | if (myObject instanceof TimedInputArcComponent && !(myObject instanceof TimedTransportArcComponent)) { |
510 | |
511 | - if (!CreateGui.getModel().netType().equals(NetType.UNTIMED) && !(myObject instanceof TimedInhibitorArcComponent)) { |
512 | + if (!(myObject instanceof TimedInhibitorArcComponent)) { |
513 | menuItem = new JMenuItem("Properties"); |
514 | menuItem.addActionListener(e1 -> ((TimedInputArcComponent) myObject).showTimeIntervalEditor()); |
515 | popup.insert(menuItem, popupIndex++); |
516 | |
517 | === modified file 'src/pipe/gui/widgets/ConstantsPane.java' |
518 | --- src/pipe/gui/widgets/ConstantsPane.java 2020-05-03 11:28:45 +0000 |
519 | +++ src/pipe/gui/widgets/ConstantsPane.java 2020-05-18 07:40:41 +0000 |
520 | @@ -73,7 +73,7 @@ |
521 | Timer timer; |
522 | |
523 | |
524 | - public ConstantsPane(boolean enableAddButton, TabContent currentTab) { |
525 | + public ConstantsPane(TabContent currentTab) { |
526 | parent = currentTab; |
527 | |
528 | constantsPanel = new JPanel(new GridBagLayout()); |
529 | @@ -188,7 +188,7 @@ |
530 | }); |
531 | |
532 | addConstantsComponents(); |
533 | - addConstantsButtons(enableAddButton); |
534 | + addConstantsButtons(); |
535 | |
536 | constantsList.addFocusListener(new FocusAdapter() { |
537 | @Override |
538 | @@ -291,7 +291,7 @@ |
539 | timer.restart(); |
540 | } |
541 | |
542 | - private void addConstantsButtons(boolean enableAddButton) { |
543 | + private void addConstantsButtons() { |
544 | editBtn = new JButton("Edit"); |
545 | editBtn.setEnabled(false); |
546 | editBtn.setToolTipText(toolTipEditConstant); |
547 | @@ -318,7 +318,7 @@ |
548 | |
549 | JButton addConstantButton = new JButton("New"); |
550 | addConstantButton.setToolTipText(toolTipNewConstant); |
551 | - addConstantButton.setEnabled(enableAddButton); |
552 | + addConstantButton.setEnabled(true); |
553 | addConstantButton.addActionListener(e -> showEditConstantDialog(null)); |
554 | gbc = new GridBagConstraints(); |
555 | gbc.gridx = 2; |
556 | |
557 | === modified file 'src/pipe/gui/widgets/NewTAPNPanel.java' |
558 | --- src/pipe/gui/widgets/NewTAPNPanel.java 2020-04-18 12:27:02 +0000 |
559 | +++ src/pipe/gui/widgets/NewTAPNPanel.java 2020-05-18 07:40:41 +0000 |
560 | @@ -14,7 +14,6 @@ |
561 | import javax.swing.JTextField; |
562 | |
563 | import dk.aau.cs.gui.TabContent; |
564 | -import pipe.dataLayer.NetType; |
565 | import pipe.gui.CreateGui; |
566 | import pipe.gui.GuiFrame; |
567 | |
568 | @@ -65,7 +64,7 @@ |
569 | gbc.anchor = GridBagConstraints.EAST; |
570 | buttonPanel.add(cancelButton,gbc); |
571 | |
572 | - okButton.addActionListener(e -> createNewTAPNBasedOnSelection(nameTextBox.getText(), NetType.TAPN)); |
573 | + okButton.addActionListener(e -> createNewTAPNBasedOnSelection(nameTextBox.getText())); |
574 | |
575 | rootPane.setDefaultButton(okButton); |
576 | |
577 | @@ -83,7 +82,7 @@ |
578 | rootPane.getParent().setVisible(false); |
579 | } |
580 | |
581 | - protected void createNewTAPNBasedOnSelection(String name, NetType type) { |
582 | + protected void createNewTAPNBasedOnSelection(String name) { |
583 | if (!name.endsWith(".tapn")) { |
584 | name = name + ".tapn"; |
585 | } |
586 | @@ -96,7 +95,7 @@ |
587 | } |
588 | |
589 | try { |
590 | - TabContent tab = TabContent.createNewEmptyTab(name, type); |
591 | + TabContent tab = TabContent.createNewEmptyTab(name); |
592 | CreateGui.openNewTabFromStream(tab); |
593 | } catch (Exception e) { |
594 | JOptionPane |
The net type was always TAPN, type UNTIMED was never set any place, so this change should have no effect on features.