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
=== modified file 'src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNExporter.java'
--- src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNExporter.java 2021-12-27 08:26:55 +0000
+++ src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNExporter.java 2022-08-01 13:38:30 +0000
@@ -1,33 +1,21 @@
1package dk.aau.cs.verification.VerifyTAPN;1package dk.aau.cs.verification.VerifyTAPN;
22
3import java.io.File;3import dk.aau.cs.TCTL.visitors.CTLQueryVisitor;
4import java.io.FileNotFoundException;
5import java.io.IOException;
6import java.io.PrintStream;
7import java.util.Collection;
8import java.util.List;
9
10import dk.aau.cs.TCTL.visitors.LTLQueryVisitor;4import dk.aau.cs.TCTL.visitors.LTLQueryVisitor;
11import dk.aau.cs.gui.TabContent;5import dk.aau.cs.gui.TabContent;
6import dk.aau.cs.model.tapn.*;
12import dk.aau.cs.verification.NameMapping;7import dk.aau.cs.verification.NameMapping;
13import pipe.dataLayer.DataLayer;8import pipe.dataLayer.DataLayer;
14import pipe.dataLayer.TAPNQuery.QueryCategory;9import pipe.dataLayer.TAPNQuery.QueryCategory;
15
16import dk.aau.cs.model.tapn.TAPNQuery;
17import dk.aau.cs.model.tapn.TimedArcPetriNet;
18import dk.aau.cs.model.tapn.TimedInhibitorArc;
19import dk.aau.cs.model.tapn.TimedInputArc;
20import dk.aau.cs.model.tapn.TimedOutputArc;
21import dk.aau.cs.model.tapn.TimedPlace;
22import dk.aau.cs.model.tapn.TimedTransition;
23import dk.aau.cs.model.tapn.TransportArc;
24
25import dk.aau.cs.TCTL.visitors.CTLQueryVisitor;
26import pipe.gui.CreateGui;10import pipe.gui.CreateGui;
27import pipe.gui.graphicElements.Place;11import pipe.gui.graphicElements.Place;
28import pipe.gui.graphicElements.Transition;12import pipe.gui.graphicElements.Transition;
2913
30import javax.xml.crypto.Data;14import java.io.File;
15import java.io.FileNotFoundException;
16import java.io.IOException;
17import java.io.PrintStream;
18import java.util.Collection;
3119
32public class VerifyTAPNExporter {20public class VerifyTAPNExporter {
33 public ExportedVerifyTAPNModel export(TimedArcPetriNet model, TAPNQuery query, TabContent.TAPNLens lens, NameMapping mapping) {21 public ExportedVerifyTAPNModel export(TimedArcPetriNet model, TAPNQuery query, TabContent.TAPNLens lens, NameMapping mapping) {
@@ -140,9 +128,15 @@
140128
141 private void outputTransition(TimedTransition t, PrintStream modelStream, Collection<DataLayer> guiModels, NameMapping mapping) {129 private void outputTransition(TimedTransition t, PrintStream modelStream, Collection<DataLayer> guiModels, NameMapping mapping) {
142 //remove the net prefix from the transition name130 //remove the net prefix from the transition name
131<<<<<<< TREE
143 var m = mapping.map(t.name());132 var m = mapping.map(t.name());
144133
134=======
135 var m = mapping.map(t.name());
136 String transitionName;
137>>>>>>> MERGE-SOURCE
145 Transition guiTransition = null;138 Transition guiTransition = null;
139<<<<<<< TREE
146 if (m != null) {140 if (m != null) {
147 String transitionName = m.value2();141 String transitionName = m.value2();
148 for(DataLayer guiModel : guiModels){142 for(DataLayer guiModel : guiModels){
@@ -150,11 +144,19 @@
150 if(guiTransition != null){144 if(guiTransition != null){
151 break;145 break;
152 }146 }
147=======
148 if (m != null) {
149 transitionName = m.value2();
150 for (DataLayer guiModel : guiModels) {
151 guiTransition = guiModel.getTransitionById(transitionName);
152 if (guiTransition != null) {
153 break;
154 }
155>>>>>>> MERGE-SOURCE
153 }156 }
154 }157 }
155158
156 modelStream.append("<transition ");159 modelStream.append("<transition ");
157
158 modelStream.append("player=\"" + (t.isUncontrollable() ? "1" : "0") + "\" ");160 modelStream.append("player=\"" + (t.isUncontrollable() ? "1" : "0") + "\" ");
159 modelStream.append("id=\"" + t.name() + "\" ");161 modelStream.append("id=\"" + t.name() + "\" ");
160 modelStream.append("name=\"" + t.name() + "\" ");162 modelStream.append("name=\"" + t.name() + "\" ");
161163
=== modified file 'src/net/tapaal/Preferences.java'
--- src/net/tapaal/Preferences.java 2016-11-14 09:58:40 +0000
+++ src/net/tapaal/Preferences.java 2022-08-01 13:38:30 +0000
@@ -329,4 +329,18 @@
329329
330 return object;330 return object;
331 }331 }
332
333 public void setFileBrowserLocation(String location) {
334 final String key = "file.location";
335
336 if (location == null || location.equals("")){
337 pref.remove(key);
338 } else {
339 pref.put(key, location);
340 }
341 }
342
343 public String getFileBrowserLocation() {
344 return pref.get("file.location", null);
345 }
332}346}
333347
=== modified file 'src/net/tapaal/TAPAAL.java'
--- src/net/tapaal/TAPAAL.java 2021-11-23 22:09:14 +0000
+++ src/net/tapaal/TAPAAL.java 2022-08-01 13:38:30 +0000
@@ -39,7 +39,7 @@
39public class TAPAAL {39public class TAPAAL {
4040
41 public static final String TOOLNAME = "TAPAAL";41 public static final String TOOLNAME = "TAPAAL";
42 public static final String VERSION = "DEV";42 public static final String VERSION = "3.9.2";
4343
44 public static String getProgramName(){44 public static String getProgramName(){
45 return "" + TAPAAL.TOOLNAME + " " + TAPAAL.VERSION;45 return "" + TAPAAL.TOOLNAME + " " + TAPAAL.VERSION;
4646
=== modified file 'src/pipe/gui/GuiFrameController.java'
--- src/pipe/gui/GuiFrameController.java 2021-10-17 18:41:49 +0000
+++ src/pipe/gui/GuiFrameController.java 2022-08-01 13:38:30 +0000
@@ -248,16 +248,16 @@
248 buffer.append("Lasse Jacobsen, Morten Jacobsen,\nThomas S. Jacobsen, Jacob J. Jensen, Peter G. Jensen, ");248 buffer.append("Lasse Jacobsen, Morten Jacobsen,\nThomas S. Jacobsen, Jacob J. Jensen, Peter G. Jensen, ");
249 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");249 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");
250250
251 buffer.append("Aalborg University 2008-2021\n\n");251 buffer.append("Aalborg University 2008-2022\n\n");
252252
253 buffer.append("TAPAAL Continuous Engine (verifytapn):\n");253 buffer.append("TAPAAL Continuous Engine (verifytapn):\n");
254 buffer.append("Alexandre David, Lasse Jacobsen, Morten Jacobsen and Jiri Srba\n");254 buffer.append("Alexandre David, Lasse Jacobsen, Morten Jacobsen and Jiri Srba\n");
255 buffer.append("Aalborg University 2011-2021\n\n");255 buffer.append("Aalborg University 2011-2022\n\n");
256256
257 buffer.append("TAPAAL Discrete Engine (verifydtapn):\n");257 buffer.append("TAPAAL Discrete Engine (verifydtapn):\n");
258 buffer.append("Mathias Andersen, Peter G. Jensen, Heine G. Larsen, Jiri Srba,\n");258 buffer.append("Mathias Andersen, Peter G. Jensen, Heine G. Larsen, Jiri Srba,\n");
259 buffer.append("Mathias G. Soerensen and Jakob H. Taankvist\n");259 buffer.append("Mathias G. Soerensen and Jakob H. Taankvist\n");
260 buffer.append("Aalborg University 2012-2021\n\n");260 buffer.append("Aalborg University 2012-2022\n\n");
261261
262 buffer.append("TAPAAL Untimed Engine (verifypn):\n");262 buffer.append("TAPAAL Untimed Engine (verifypn):\n");
263 buffer.append("Alexander Bilgram, Frederik M. Boenneland, Jakob Dyhr, Peter Fogh, ");263 buffer.append("Alexander Bilgram, Frederik M. Boenneland, Jakob Dyhr, Peter Fogh, ");
@@ -265,7 +265,7 @@
265 buffer.append("Tobias S. Jepsen, Kenneth Y. Joergensen,\nMads Johannsen, Isabella Kaufmann, ");265 buffer.append("Tobias S. Jepsen, Kenneth Y. Joergensen,\nMads Johannsen, Isabella Kaufmann, ");
266 buffer.append("Andreas H. Klostergaard, Soeren M. Nielsen,\nThomas S. Nielsen, Lars K. Oestergaard, ");266 buffer.append("Andreas H. Klostergaard, Soeren M. Nielsen,\nThomas S. Nielsen, Lars K. Oestergaard, ");
267 buffer.append("Samuel Pastva, Thomas Pedersen, Jiri Srba,\nPeter H. Taankvist, Nikolaj J. Ulrik and Simon M. Virenfeldt\n");267 buffer.append("Samuel Pastva, Thomas Pedersen, Jiri Srba,\nPeter H. Taankvist, Nikolaj J. Ulrik and Simon M. Virenfeldt\n");
268 buffer.append("Aalborg University 2014-2021\n\n");268 buffer.append("Aalborg University 2014-2022\n\n");
269269
270270
271 buffer.append("\n");271 buffer.append("\n");
272272
=== modified file 'src/pipe/gui/widgets/filebrowser/NativeFileBrowser.java'
--- src/pipe/gui/widgets/filebrowser/NativeFileBrowser.java 2020-11-27 12:35:35 +0000
+++ src/pipe/gui/widgets/filebrowser/NativeFileBrowser.java 2022-08-01 13:38:30 +0000
@@ -8,6 +8,8 @@
8import java.util.regex.Pattern;8import java.util.regex.Pattern;
99
10import javax.swing.*;10import javax.swing.*;
11
12import net.tapaal.Preferences;
11import pipe.gui.CreateGui;13import pipe.gui.CreateGui;
1214
13class NativeFileBrowser extends FileBrowser {15class NativeFileBrowser extends FileBrowser {
@@ -56,7 +58,7 @@
56 58
5759
58 public File openFile() {60 public File openFile() {
59 if(specifiedPath == null) specifiedPath = lastOpenPath;61 if(specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();
60 fc.setDirectory(specifiedPath);62 fc.setDirectory(specifiedPath);
61 //This is needed for Windows63 //This is needed for Windows
62 if(optionalExt.equals("")) fc.setFile(ext.equals("")? "":("*."+ext));64 if(optionalExt.equals("")) fc.setFile(ext.equals("")? "":("*."+ext));
@@ -66,13 +68,13 @@
66 fc.setVisible(true);68 fc.setVisible(true);
67 String selectedFile = fc.getFile();69 String selectedFile = fc.getFile();
68 String selectedDir = fc.getDirectory();70 String selectedDir = fc.getDirectory();
69 lastOpenPath = selectedDir;71 Preferences.getInstance().setFileBrowserLocation(selectedDir);
70 File file = selectedFile == null? null:new File(selectedDir + selectedFile);72 File file = selectedFile == null? null:new File(selectedDir + selectedFile);
71 return file;73 return file;
72 }74 }
73 75
74 public File[] openFiles() {76 public File[] openFiles() {
75 if(specifiedPath == null) specifiedPath = lastOpenPath;77 if(specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();;
76 fc.setDirectory(specifiedPath);78 fc.setDirectory(specifiedPath);
77 //This is needed for Windows79 //This is needed for Windows
78 if(optionalExt.equals("")) fc.setFile(ext.equals("")? "":("*."+ext));80 if(optionalExt.equals("")) fc.setFile(ext.equals("")? "":("*."+ext));
@@ -81,12 +83,12 @@
81 fc.setMode(FileDialog.LOAD);83 fc.setMode(FileDialog.LOAD);
82 fc.setVisible(true);84 fc.setVisible(true);
83 File[] selectedFiles = fc.getFiles();85 File[] selectedFiles = fc.getFiles();
84 lastOpenPath = fc.getDirectory();86 Preferences.getInstance().setFileBrowserLocation(fc.getDirectory());
85 return selectedFiles;87 return selectedFiles;
86 }88 }
8789
88 public String saveFile(String suggestedName) {90 public String saveFile(String suggestedName) {
89 if(specifiedPath == null) specifiedPath = lastSavePath;91 if(specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();
90 fc.setDirectory(specifiedPath);92 fc.setDirectory(specifiedPath);
91 fc.setFile(suggestedName + (suggestedName.endsWith("."+ext)? "":"."+ext));93 fc.setFile(suggestedName + (suggestedName.endsWith("."+ext)? "":"."+ext));
92 fc.setMode(FileDialog.SAVE);94 fc.setMode(FileDialog.SAVE);
@@ -103,7 +105,7 @@
103 }105 }
104106
105 String file = fc.getFile() == null? null: fc.getDirectory() + fc.getFile();107 String file = fc.getFile() == null? null: fc.getDirectory() + fc.getFile();
106 lastSavePath = fc.getDirectory();108 Preferences.getInstance().setFileBrowserLocation(fc.getDirectory());
107 109
108 if(file == null){110 if(file == null){
109 return file;111 return file;
@@ -150,14 +152,14 @@
150 //So we make a JFileChooser in which we can control it152 //So we make a JFileChooser in which we can control it
151 if(System.getProperty("os.name").startsWith("Windows")) {153 if(System.getProperty("os.name").startsWith("Windows")) {
152 File selectedDir = null;154 File selectedDir = null;
153 if (specifiedPath == null) specifiedPath = lastSavePath;155 if (specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();;
154 JFileChooser c = new JFileChooser(specifiedPath);156 JFileChooser c = new JFileChooser(specifiedPath);
155 c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);157 c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
156 c.setDialogTitle("Choose target directory for export");158 c.setDialogTitle("Choose target directory for export");
157 int rVal = c.showSaveDialog(c);159 int rVal = c.showSaveDialog(c);
158 if (rVal == JFileChooser.APPROVE_OPTION) {160 if (rVal == JFileChooser.APPROVE_OPTION) {
159 selectedDir = c.getSelectedFile();161 selectedDir = c.getSelectedFile();
160 lastSavePath = selectedDir.getPath();162 Preferences.getInstance().setFileBrowserLocation(selectedDir.getPath());
161 }163 }
162164
163 return selectedDir;165 return selectedDir;
164166
=== modified file 'src/pipe/gui/widgets/filebrowser/NativeFileBrowserFallback.java'
--- src/pipe/gui/widgets/filebrowser/NativeFileBrowserFallback.java 2020-05-05 18:17:52 +0000
+++ src/pipe/gui/widgets/filebrowser/NativeFileBrowserFallback.java 2022-08-01 13:38:30 +0000
@@ -10,6 +10,8 @@
10import javax.swing.JFileChooser;10import javax.swing.JFileChooser;
11import javax.swing.JOptionPane;11import javax.swing.JOptionPane;
12import javax.swing.filechooser.FileNameExtensionFilter;12import javax.swing.filechooser.FileNameExtensionFilter;
13
14import net.tapaal.Preferences;
13import pipe.gui.CreateGui;15import pipe.gui.CreateGui;
1416
15class NativeFileBrowserFallback extends FileBrowser {17class NativeFileBrowserFallback extends FileBrowser {
@@ -75,7 +77,7 @@
75 }77 }
7678
77 public File openFile() {79 public File openFile() {
78 if(specifiedPath == null) specifiedPath = lastOpenPath;80 if(specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();;
79 fc.setDirectory(specifiedPath);81 fc.setDirectory(specifiedPath);
80 //This is needed for windows82 //This is needed for windows
81 if(optionalExt.equals("")) fc.setFile(ext.equals("")? "":("*."+ext));83 if(optionalExt.equals("")) fc.setFile(ext.equals("")? "":("*."+ext));
@@ -84,13 +86,13 @@
84 fc.setVisible(true);86 fc.setVisible(true);
85 String selectedFile = fc.getFile();87 String selectedFile = fc.getFile();
86 String selectedDir = fc.getDirectory();88 String selectedDir = fc.getDirectory();
87 lastOpenPath = selectedDir;89 Preferences.getInstance().setFileBrowserLocation(selectedDir);
88 File file = selectedFile == null? null:new File(selectedDir + selectedFile);90 File file = selectedFile == null? null:new File(selectedDir + selectedFile);
89 return file;91 return file;
90 }92 }
9193
92 public File[] openFiles() {94 public File[] openFiles() {
93 if(specifiedPath == null) specifiedPath = lastOpenPath;95 if(specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();;
94 if(new File(specifiedPath).exists()) fileChooser.setCurrentDirectory(new File(specifiedPath));96 if(new File(specifiedPath).exists()) fileChooser.setCurrentDirectory(new File(specifiedPath));
95 /*if (lastPath != null) {97 /*if (lastPath != null) {
96 File path = new File(lastPath);98 File path = new File(lastPath);
@@ -104,20 +106,20 @@
104 filesArray = fileChooser.getSelectedFiles();106 filesArray = fileChooser.getSelectedFiles();
105 }107 }
106 //They should all come from the same directory so we just take one108 //They should all come from the same directory so we just take one
107 lastOpenPath = filesArray[0].getAbsolutePath();109 Preferences.getInstance().setFileBrowserLocation(filesArray[0].getAbsolutePath());
108 return filesArray;110 return filesArray;
109 }111 }
110112
111113
112 public String saveFile(String suggestedName) {114 public String saveFile(String suggestedName) {
113 if(specifiedPath == null) specifiedPath = lastSavePath;115 if(specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();;
114 fc.setDirectory(specifiedPath);116 fc.setDirectory(specifiedPath);
115 fc.setFile(suggestedName + (suggestedName.endsWith("."+ext)? "":"."+ext));117 fc.setFile(suggestedName + (suggestedName.endsWith("."+ext)? "":"."+ext));
116 fc.setMode(FileDialog.SAVE);118 fc.setMode(FileDialog.SAVE);
117 fc.setVisible(true);119 fc.setVisible(true);
118120
119 String file = fc.getFile() == null? null: fc.getDirectory() + fc.getFile();121 String file = fc.getFile() == null? null: fc.getDirectory() + fc.getFile();
120 lastSavePath = fc.getDirectory();122 Preferences.getInstance().setFileBrowserLocation(fc.getDirectory());
121123
122 if(file == null){124 if(file == null){
123 return file;125 return file;
@@ -163,14 +165,14 @@
163 //So we make a JFileChooser in which we can control it165 //So we make a JFileChooser in which we can control it
164 if(System.getProperty("os.name").startsWith("Windows")) {166 if(System.getProperty("os.name").startsWith("Windows")) {
165 File selectedDir = null;167 File selectedDir = null;
166 if (specifiedPath == null) specifiedPath = lastSavePath;168 if (specifiedPath == null) specifiedPath = Preferences.getInstance().getFileBrowserLocation();;
167 JFileChooser c = new JFileChooser(specifiedPath);169 JFileChooser c = new JFileChooser(specifiedPath);
168 c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);170 c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
169 c.setDialogTitle("Choose target directory for export");171 c.setDialogTitle("Choose target directory for export");
170 int rVal = c.showSaveDialog(c);172 int rVal = c.showSaveDialog(c);
171 if (rVal == JFileChooser.APPROVE_OPTION) {173 if (rVal == JFileChooser.APPROVE_OPTION) {
172 selectedDir = c.getSelectedFile();174 selectedDir = c.getSelectedFile();
173 lastSavePath = selectedDir.getPath();175 Preferences.getInstance().setFileBrowserLocation(selectedDir.getPath());
174 }176 }
175177
176 return selectedDir;178 return selectedDir;

Subscribers

People subscribed via source and target branches