Merge lp:~tapaal-contributor/tapaal/save-file-browser-location-3.9 into lp:tapaal

Proposed by Lena Ernstsen
Status: Superseded
Proposed branch: lp:~tapaal-contributor/tapaal/save-file-browser-location-3.9
Merge into: lp:tapaal
Diff against target: 308 lines (+61/-41) (has conflicts)
6 files modified
src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNExporter.java (+22/-20)
src/net/tapaal/Preferences.java (+14/-0)
src/net/tapaal/TAPAAL.java (+1/-1)
src/pipe/gui/GuiFrameController.java (+4/-4)
src/pipe/gui/widgets/filebrowser/NativeFileBrowser.java (+10/-8)
src/pipe/gui/widgets/filebrowser/NativeFileBrowserFallback.java (+10/-8)
Text conflict in src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNExporter.java
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/save-file-browser-location-3.9
Reviewer Review Type Date Requested Status
TAPAAL Reviewers Pending
Review via email: mp+427686@code.launchpad.net

This proposal has been superseded by a proposal from 2022-08-01.

Commit message

Stores the location of the file browser

To post a comment you must log in.

Unmerged revisions

1173. By Lena Ernstsen

Loads file browser location when starting the application

1172. By Jiri Srba

merged in a fix for resting LTL queries

1171. By Jiri Srba

merged in a bug fix for LTL manual edit of queries ( E .. and .. and ...) did not allow manual edit and removing the last conjunct

1170. By Jiri Srba

merged in lp:~yrke/tapaal/fix1976494 fixing a problem with copying components that contain environmental transitions

1169. By Jiri Srba

merged in src/pipe/gui/widgets/QueryDialog.java fixing problem with and and or in query dialog

1168. By Jiri Srba <email address hidden>

merged in lp:~tapaal-contributor/tapaal/foxTAPNdi-39 fixing problem with passing inclusion places to verifytapn engine

1167. By <email address hidden>

version number to 3.9.2 and copyright to 2022

1166. By Jiri Srba

merged in lp:~tapaal-contributor/tapaal/fixApprox-39 fixing over/under-approximation for verifydtapn

1165. By Jiri Srba <email address hidden>

merged in lp:~yrke/tapaal/fix1947835 fixing problem with delay/fire in simulator

1164. By Jiri Srba

merged in lp:~tapaal-contributor/tapaal/fix-transition-name-highlighting-1952520 fixing problem with label highligting for transitions (dark mode on ubuntu should be checked)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNExporter.java'
2--- src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNExporter.java 2021-12-27 08:26:55 +0000
3+++ src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNExporter.java 2022-08-01 13:38:30 +0000
4@@ -1,33 +1,21 @@
5 package dk.aau.cs.verification.VerifyTAPN;
6
7-import java.io.File;
8-import java.io.FileNotFoundException;
9-import java.io.IOException;
10-import java.io.PrintStream;
11-import java.util.Collection;
12-import java.util.List;
13-
14+import dk.aau.cs.TCTL.visitors.CTLQueryVisitor;
15 import dk.aau.cs.TCTL.visitors.LTLQueryVisitor;
16 import dk.aau.cs.gui.TabContent;
17+import dk.aau.cs.model.tapn.*;
18 import dk.aau.cs.verification.NameMapping;
19 import pipe.dataLayer.DataLayer;
20 import pipe.dataLayer.TAPNQuery.QueryCategory;
21-
22-import dk.aau.cs.model.tapn.TAPNQuery;
23-import dk.aau.cs.model.tapn.TimedArcPetriNet;
24-import dk.aau.cs.model.tapn.TimedInhibitorArc;
25-import dk.aau.cs.model.tapn.TimedInputArc;
26-import dk.aau.cs.model.tapn.TimedOutputArc;
27-import dk.aau.cs.model.tapn.TimedPlace;
28-import dk.aau.cs.model.tapn.TimedTransition;
29-import dk.aau.cs.model.tapn.TransportArc;
30-
31-import dk.aau.cs.TCTL.visitors.CTLQueryVisitor;
32 import pipe.gui.CreateGui;
33 import pipe.gui.graphicElements.Place;
34 import pipe.gui.graphicElements.Transition;
35
36-import javax.xml.crypto.Data;
37+import java.io.File;
38+import java.io.FileNotFoundException;
39+import java.io.IOException;
40+import java.io.PrintStream;
41+import java.util.Collection;
42
43 public class VerifyTAPNExporter {
44 public ExportedVerifyTAPNModel export(TimedArcPetriNet model, TAPNQuery query, TabContent.TAPNLens lens, NameMapping mapping) {
45@@ -140,9 +128,15 @@
46
47 private void outputTransition(TimedTransition t, PrintStream modelStream, Collection<DataLayer> guiModels, NameMapping mapping) {
48 //remove the net prefix from the transition name
49+<<<<<<< TREE
50 var m = mapping.map(t.name());
51
52+=======
53+ var m = mapping.map(t.name());
54+ String transitionName;
55+>>>>>>> MERGE-SOURCE
56 Transition guiTransition = null;
57+<<<<<<< TREE
58 if (m != null) {
59 String transitionName = m.value2();
60 for(DataLayer guiModel : guiModels){
61@@ -150,11 +144,19 @@
62 if(guiTransition != null){
63 break;
64 }
65+=======
66+ if (m != null) {
67+ transitionName = m.value2();
68+ for (DataLayer guiModel : guiModels) {
69+ guiTransition = guiModel.getTransitionById(transitionName);
70+ if (guiTransition != null) {
71+ break;
72+ }
73+>>>>>>> MERGE-SOURCE
74 }
75 }
76
77 modelStream.append("<transition ");
78-
79 modelStream.append("player=\"" + (t.isUncontrollable() ? "1" : "0") + "\" ");
80 modelStream.append("id=\"" + t.name() + "\" ");
81 modelStream.append("name=\"" + t.name() + "\" ");
82
83=== modified file 'src/net/tapaal/Preferences.java'
84--- src/net/tapaal/Preferences.java 2016-11-14 09:58:40 +0000
85+++ src/net/tapaal/Preferences.java 2022-08-01 13:38:30 +0000
86@@ -329,4 +329,18 @@
87
88 return object;
89 }
90+
91+ public void setFileBrowserLocation(String location) {
92+ final String key = "file.location";
93+
94+ if (location == null || location.equals("")){
95+ pref.remove(key);
96+ } else {
97+ pref.put(key, location);
98+ }
99+ }
100+
101+ public String getFileBrowserLocation() {
102+ return pref.get("file.location", null);
103+ }
104 }
105
106=== modified file 'src/net/tapaal/TAPAAL.java'
107--- src/net/tapaal/TAPAAL.java 2021-11-23 22:09:14 +0000
108+++ src/net/tapaal/TAPAAL.java 2022-08-01 13:38:30 +0000
109@@ -39,7 +39,7 @@
110 public class TAPAAL {
111
112 public static final String TOOLNAME = "TAPAAL";
113- public static final String VERSION = "DEV";
114+ public static final String VERSION = "3.9.2";
115
116 public static String getProgramName(){
117 return "" + TAPAAL.TOOLNAME + " " + TAPAAL.VERSION;
118
119=== modified file 'src/pipe/gui/GuiFrameController.java'
120--- src/pipe/gui/GuiFrameController.java 2021-10-17 18:41:49 +0000
121+++ src/pipe/gui/GuiFrameController.java 2022-08-01 13:38:30 +0000
122@@ -248,16 +248,16 @@
123 buffer.append("Lasse Jacobsen, Morten Jacobsen,\nThomas S. Jacobsen, Jacob J. Jensen, Peter G. Jensen, ");
124 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");
125
126- buffer.append("Aalborg University 2008-2021\n\n");
127+ buffer.append("Aalborg University 2008-2022\n\n");
128
129 buffer.append("TAPAAL Continuous Engine (verifytapn):\n");
130 buffer.append("Alexandre David, Lasse Jacobsen, Morten Jacobsen and Jiri Srba\n");
131- buffer.append("Aalborg University 2011-2021\n\n");
132+ buffer.append("Aalborg University 2011-2022\n\n");
133
134 buffer.append("TAPAAL Discrete Engine (verifydtapn):\n");
135 buffer.append("Mathias Andersen, Peter G. Jensen, Heine G. Larsen, Jiri Srba,\n");
136 buffer.append("Mathias G. Soerensen and Jakob H. Taankvist\n");
137- buffer.append("Aalborg University 2012-2021\n\n");
138+ buffer.append("Aalborg University 2012-2022\n\n");
139
140 buffer.append("TAPAAL Untimed Engine (verifypn):\n");
141 buffer.append("Alexander Bilgram, Frederik M. Boenneland, Jakob Dyhr, Peter Fogh, ");
142@@ -265,7 +265,7 @@
143 buffer.append("Tobias S. Jepsen, Kenneth Y. Joergensen,\nMads Johannsen, Isabella Kaufmann, ");
144 buffer.append("Andreas H. Klostergaard, Soeren M. Nielsen,\nThomas S. Nielsen, Lars K. Oestergaard, ");
145 buffer.append("Samuel Pastva, Thomas Pedersen, Jiri Srba,\nPeter H. Taankvist, Nikolaj J. Ulrik and Simon M. Virenfeldt\n");
146- buffer.append("Aalborg University 2014-2021\n\n");
147+ buffer.append("Aalborg University 2014-2022\n\n");
148
149
150 buffer.append("\n");
151
152=== modified file 'src/pipe/gui/widgets/filebrowser/NativeFileBrowser.java'
153--- src/pipe/gui/widgets/filebrowser/NativeFileBrowser.java 2020-11-27 12:35:35 +0000
154+++ src/pipe/gui/widgets/filebrowser/NativeFileBrowser.java 2022-08-01 13:38:30 +0000
155@@ -8,6 +8,8 @@
156 import java.util.regex.Pattern;
157
158 import javax.swing.*;
159+
160+import net.tapaal.Preferences;
161 import pipe.gui.CreateGui;
162
163 class NativeFileBrowser extends FileBrowser {
164@@ -56,7 +58,7 @@
165
166
167 public File openFile() {
168- if(specifiedPath == null) specifiedPath = lastOpenPath;
169+ if(specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();
170 fc.setDirectory(specifiedPath);
171 //This is needed for Windows
172 if(optionalExt.equals("")) fc.setFile(ext.equals("")? "":("*."+ext));
173@@ -66,13 +68,13 @@
174 fc.setVisible(true);
175 String selectedFile = fc.getFile();
176 String selectedDir = fc.getDirectory();
177- lastOpenPath = selectedDir;
178+ Preferences.getInstance().setFileBrowserLocation(selectedDir);
179 File file = selectedFile == null? null:new File(selectedDir + selectedFile);
180 return file;
181 }
182
183 public File[] openFiles() {
184- if(specifiedPath == null) specifiedPath = lastOpenPath;
185+ if(specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();;
186 fc.setDirectory(specifiedPath);
187 //This is needed for Windows
188 if(optionalExt.equals("")) fc.setFile(ext.equals("")? "":("*."+ext));
189@@ -81,12 +83,12 @@
190 fc.setMode(FileDialog.LOAD);
191 fc.setVisible(true);
192 File[] selectedFiles = fc.getFiles();
193- lastOpenPath = fc.getDirectory();
194+ Preferences.getInstance().setFileBrowserLocation(fc.getDirectory());
195 return selectedFiles;
196 }
197
198 public String saveFile(String suggestedName) {
199- if(specifiedPath == null) specifiedPath = lastSavePath;
200+ if(specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();
201 fc.setDirectory(specifiedPath);
202 fc.setFile(suggestedName + (suggestedName.endsWith("."+ext)? "":"."+ext));
203 fc.setMode(FileDialog.SAVE);
204@@ -103,7 +105,7 @@
205 }
206
207 String file = fc.getFile() == null? null: fc.getDirectory() + fc.getFile();
208- lastSavePath = fc.getDirectory();
209+ Preferences.getInstance().setFileBrowserLocation(fc.getDirectory());
210
211 if(file == null){
212 return file;
213@@ -150,14 +152,14 @@
214 //So we make a JFileChooser in which we can control it
215 if(System.getProperty("os.name").startsWith("Windows")) {
216 File selectedDir = null;
217- if (specifiedPath == null) specifiedPath = lastSavePath;
218+ if (specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();;
219 JFileChooser c = new JFileChooser(specifiedPath);
220 c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
221 c.setDialogTitle("Choose target directory for export");
222 int rVal = c.showSaveDialog(c);
223 if (rVal == JFileChooser.APPROVE_OPTION) {
224 selectedDir = c.getSelectedFile();
225- lastSavePath = selectedDir.getPath();
226+ Preferences.getInstance().setFileBrowserLocation(selectedDir.getPath());
227 }
228
229 return selectedDir;
230
231=== modified file 'src/pipe/gui/widgets/filebrowser/NativeFileBrowserFallback.java'
232--- src/pipe/gui/widgets/filebrowser/NativeFileBrowserFallback.java 2020-05-05 18:17:52 +0000
233+++ src/pipe/gui/widgets/filebrowser/NativeFileBrowserFallback.java 2022-08-01 13:38:30 +0000
234@@ -10,6 +10,8 @@
235 import javax.swing.JFileChooser;
236 import javax.swing.JOptionPane;
237 import javax.swing.filechooser.FileNameExtensionFilter;
238+
239+import net.tapaal.Preferences;
240 import pipe.gui.CreateGui;
241
242 class NativeFileBrowserFallback extends FileBrowser {
243@@ -75,7 +77,7 @@
244 }
245
246 public File openFile() {
247- if(specifiedPath == null) specifiedPath = lastOpenPath;
248+ if(specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();;
249 fc.setDirectory(specifiedPath);
250 //This is needed for windows
251 if(optionalExt.equals("")) fc.setFile(ext.equals("")? "":("*."+ext));
252@@ -84,13 +86,13 @@
253 fc.setVisible(true);
254 String selectedFile = fc.getFile();
255 String selectedDir = fc.getDirectory();
256- lastOpenPath = selectedDir;
257+ Preferences.getInstance().setFileBrowserLocation(selectedDir);
258 File file = selectedFile == null? null:new File(selectedDir + selectedFile);
259 return file;
260 }
261
262 public File[] openFiles() {
263- if(specifiedPath == null) specifiedPath = lastOpenPath;
264+ if(specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();;
265 if(new File(specifiedPath).exists()) fileChooser.setCurrentDirectory(new File(specifiedPath));
266 /*if (lastPath != null) {
267 File path = new File(lastPath);
268@@ -104,20 +106,20 @@
269 filesArray = fileChooser.getSelectedFiles();
270 }
271 //They should all come from the same directory so we just take one
272- lastOpenPath = filesArray[0].getAbsolutePath();
273+ Preferences.getInstance().setFileBrowserLocation(filesArray[0].getAbsolutePath());
274 return filesArray;
275 }
276
277
278 public String saveFile(String suggestedName) {
279- if(specifiedPath == null) specifiedPath = lastSavePath;
280+ if(specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();;
281 fc.setDirectory(specifiedPath);
282 fc.setFile(suggestedName + (suggestedName.endsWith("."+ext)? "":"."+ext));
283 fc.setMode(FileDialog.SAVE);
284 fc.setVisible(true);
285
286 String file = fc.getFile() == null? null: fc.getDirectory() + fc.getFile();
287- lastSavePath = fc.getDirectory();
288+ Preferences.getInstance().setFileBrowserLocation(fc.getDirectory());
289
290 if(file == null){
291 return file;
292@@ -163,14 +165,14 @@
293 //So we make a JFileChooser in which we can control it
294 if(System.getProperty("os.name").startsWith("Windows")) {
295 File selectedDir = null;
296- if (specifiedPath == null) specifiedPath = lastSavePath;
297+ if (specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();;
298 JFileChooser c = new JFileChooser(specifiedPath);
299 c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
300 c.setDialogTitle("Choose target directory for export");
301 int rVal = c.showSaveDialog(c);
302 if (rVal == JFileChooser.APPROVE_OPTION) {
303 selectedDir = c.getSelectedFile();
304- lastSavePath = selectedDir.getPath();
305+ Preferences.getInstance().setFileBrowserLocation(selectedDir.getPath());
306 }
307
308 return selectedDir;

Subscribers

People subscribed via source and target branches