Merge lp:~tapaal-contributor/tapaal/add-export-options into lp:tapaal

Proposed by Lena Ernstsen
Status: Merged
Approved by: Jiri Srba
Approved revision: 1120
Merged at revision: 1114
Proposed branch: lp:~tapaal-contributor/tapaal/add-export-options
Merge into: lp:tapaal
Diff against target: 497 lines (+176/-125)
6 files modified
src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNExporter.java (+9/-9)
src/pipe/gui/Export.java (+114/-83)
src/pipe/gui/ExportBatchDialog.java (+46/-26)
src/pipe/gui/GuiFrame.java (+4/-4)
src/pipe/gui/widgets/QueryDialog.java (+2/-2)
src/pipe/gui/widgets/filebrowser/NativeFileBrowser.java (+1/-1)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/add-export-options
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Lena Ernstsen (community) Needs Resubmitting
Kenneth Yrke Jørgensen code Approve
Review via email: mp+394850@code.launchpad.net

Commit message

Added different export formats in the batch dialog

Description of the change

Added the options to export to verifyTAPN and verifyDTAPN by selecting the engine in a drop down menu

To post a comment you must log in.
Revision history for this message
Kenneth Yrke Jørgensen (yrke) wrote :

I don't seen any major issues, but I added a few code styling comments that could be fixed.

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

Two other things to fix:

1. when exporting to verifytapn and verifydtapn and model that has more than one query, it creates a single query.q file that does not parse by the engines (each query needs to get a separate query file, number them for example as query-1.q query-2.q etc).

2. In the batch export dropdown menu, add "model and queries" for the verifytapn and verifydtapn description.

3. The Export menu name should be: "Batch export of models and queries"

review: Needs Fixing
1120. By Lena Ernstsen

Fixed names and query files + cleaned up

Revision history for this message
Lena Ernstsen (lsaid) :
Revision history for this message
Lena Ernstsen (lsaid) wrote :

Fixed code styling and naming of elements in the UI. Also changed the way the queries are saved, so each query gets a query file

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

Tested and works very well.

review: Approve

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 2020-08-06 13:48:04 +0000
+++ src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNExporter.java 2020-12-14 17:15:10 +0000
@@ -30,10 +30,10 @@
30 }30 }
31 31
3232
33 return export(model, query, modelFile, queryFile, null, lens);33 return export(model, query, modelFile, queryFile, lens);
34 }34 }
3535
36 public ExportedVerifyTAPNModel export(TimedArcPetriNet model, TAPNQuery query, File modelFile, File queryFile, pipe.dataLayer.TAPNQuery dataLayerQuery, TabContent.TAPNLens lens) {36 public ExportedVerifyTAPNModel export(TimedArcPetriNet model, TAPNQuery query, File modelFile, File queryFile, TabContent.TAPNLens lens) {
37 if (modelFile == null || queryFile == null)37 if (modelFile == null || queryFile == null)
38 return null;38 return null;
3939
@@ -44,16 +44,16 @@
44 modelStream.close();44 modelStream.close();
4545
46 PrintStream queryStream = new PrintStream(queryFile);46 PrintStream queryStream = new PrintStream(queryFile);
47 if (query.getCategory() == QueryCategory.CTL){47 if (query == null) {
48 CTLQueryVisitor XMLVisitor = new CTLQueryVisitor();48 throw new FileNotFoundException(null);
49 queryStream.append(XMLVisitor.getXMLQueryFor(query.getProperty(), null));49 } else if (query.getCategory() == QueryCategory.CTL) {
50 } else if (lens != null && lens.isGame()) {50 CTLQueryVisitor XMLVisitor = new CTLQueryVisitor();
51 queryStream.append("control: " + query.getProperty().toString());51 queryStream.append(XMLVisitor.getXMLQueryFor(query.getProperty(), null));
52 } else if (lens != null && lens.isGame()) {
53 queryStream.append("control: " + query.getProperty().toString());
52 } else {54 } else {
53 queryStream.append(query.getProperty().toString());55 queryStream.append(query.getProperty().toString());
54 }56 }
55
56
57 queryStream.close();57 queryStream.close();
58 } catch(FileNotFoundException e) {58 } catch(FileNotFoundException e) {
59 System.err.append("An error occurred while exporting the model to verifytapn. Verification cancelled.");59 System.err.append("An error occurred while exporting the model to verifytapn. Verification cancelled.");
6060
=== modified file 'src/pipe/gui/Export.java'
--- src/pipe/gui/Export.java 2020-04-18 13:45:34 +0000
+++ src/pipe/gui/Export.java 2020-12-14 17:15:10 +0000
@@ -19,7 +19,8 @@
19import java.io.FileOutputStream;19import java.io.FileOutputStream;
20import java.io.IOException;20import java.io.IOException;
21import java.io.PrintStream;21import java.io.PrintStream;
22import java.util.Iterator;22import java.lang.reflect.Array;
23import java.util.*;
2324
24import javax.imageio.ImageIO;25import javax.imageio.ImageIO;
25import javax.imageio.ImageWriter;26import javax.imageio.ImageWriter;
@@ -33,6 +34,13 @@
33import javax.xml.transform.TransformerConfigurationException;34import javax.xml.transform.TransformerConfigurationException;
34import javax.xml.transform.TransformerException;35import javax.xml.transform.TransformerException;
3536
37import dk.aau.cs.model.tapn.TimedArcPetriNet;
38import dk.aau.cs.util.Tuple;
39import dk.aau.cs.verification.VerifyTAPN.ExportedVerifyTAPNModel;
40import dk.aau.cs.verification.VerifyTAPN.VerifyPNExporter;
41import dk.aau.cs.verification.VerifyTAPN.VerifyTAPN;
42import dk.aau.cs.verification.VerifyTAPN.VerifyTAPNExporter;
43import org.jetbrains.annotations.NotNull;
36import org.w3c.dom.DOMException;44import org.w3c.dom.DOMException;
3745
38import dk.aau.cs.TCTL.visitors.CTLQueryVisitor;46import dk.aau.cs.TCTL.visitors.CTLQueryVisitor;
@@ -49,6 +57,7 @@
49import pipe.dataLayer.NetWriter;57import pipe.dataLayer.NetWriter;
50import pipe.dataLayer.TAPNQuery;58import pipe.dataLayer.TAPNQuery;
51import pipe.gui.canvas.DrawingSurfaceImpl;59import pipe.gui.canvas.DrawingSurfaceImpl;
60import pipe.gui.widgets.QueryDialog;
52import pipe.gui.widgets.filebrowser.FileBrowser;61import pipe.gui.widgets.filebrowser.FileBrowser;
5362
54/**63/**
@@ -58,69 +67,92 @@
58 */67 */
59public class Export {68public class Export {
6069
61 public static final int PNG = 1;70 public static final int PNG = 1;
62 public static final int POSTSCRIPT = 2;71 public static final int POSTSCRIPT = 2;
63 public static final int PRINTER = 3;72 public static final int PRINTER = 3;
64 public static final int TIKZ = 5;73 public static final int TIKZ = 5;
65 public static final int PNML = 6;74 public static final int PNML = 6;
66 public static final int QUERY = 7; 75 public static final int QUERY = 7;
6776
68 private static void toPnml(DrawingSurfaceImpl g, String filename)77 private static void toPnml(DrawingSurfaceImpl g, String filename)
69 throws NullPointerException, DOMException, TransformerConfigurationException, 78 throws NullPointerException, DOMException, TransformerConfigurationException,
70 IOException, ParserConfigurationException, TransformerException {79 IOException, ParserConfigurationException, TransformerException {
71 TabContent currentTab = CreateGui.getCurrentTab();80 TabContent currentTab = CreateGui.getCurrentTab();
72 NetworkMarking currentMarking = null;81 NetworkMarking currentMarking = null;
73 if(CreateGui.getCurrentTab().isInAnimationMode()){82 if (CreateGui.getCurrentTab().isInAnimationMode()) {
74 currentMarking = currentTab.network().marking();83 currentMarking = currentTab.network().marking();
75 currentTab.network().setMarking(CreateGui.getAnimator().getInitialMarking());84 currentTab.network().setMarking(CreateGui.getAnimator().getInitialMarking());
76 }85 }
7786
78 NetWriter tapnWriter = new PNMLWriter(87 NetWriter tapnWriter = new PNMLWriter(
79 currentTab.network(),88 currentTab.network(),
80 currentTab.getGuiModels()89 currentTab.getGuiModels()
81 );90 );
8291
83 tapnWriter.savePNML(new File(filename));92 tapnWriter.savePNML(new File(filename));
8493
85 if(CreateGui.getCurrentTab().isInAnimationMode()){94 if (CreateGui.getCurrentTab().isInAnimationMode()) {
86 currentTab.network().setMarking(currentMarking);95 currentTab.network().setMarking(currentMarking);
87 }96 }
88 }97 }
89 98
90 private static void toQueryXML(String filename){99 private static void toQueryXML(String filename) {
91 toQueryXML(CreateGui.getCurrentTab().network(), filename, CreateGui.getCurrentTab().queries());100 toQueryXML(CreateGui.getCurrentTab().network(), filename, CreateGui.getCurrentTab().queries());
92 101
93 }102 }
94 103
95 public static void toQueryXML(TimedArcPetriNetNetwork network, String filename, Iterable<TAPNQuery> queries){104 public static void toQueryXML(TimedArcPetriNetNetwork network, String filename, Iterable<TAPNQuery> queries) {
96 try{105 try {
97 ITAPNComposer composer = new TAPNComposer(new MessengerImpl(), true);106 ITAPNComposer composer = new TAPNComposer(new MessengerImpl(), true);
98 NameMapping mapping = composer.transformModel(network).value2();107 NameMapping mapping = composer.transformModel(network).value2();
99 Iterator<TAPNQuery> queryIterator = queries.iterator();108 Iterator<TAPNQuery> queryIterator = queries.iterator();
100 PrintStream queryStream = new PrintStream(filename);109 PrintStream queryStream = new PrintStream(filename);
101 CTLQueryVisitor XMLVisitor = new CTLQueryVisitor();110 CTLQueryVisitor XMLVisitor = new CTLQueryVisitor();
102 111
103 while(queryIterator.hasNext()){112 while (queryIterator.hasNext()) {
104 TAPNQuery clonedQuery = queryIterator.next().copy();113 TAPNQuery clonedQuery = queryIterator.next().copy();
105114
106 // Attempt to parse and possibly transform the string query using the manual edit parser115 // Attempt to parse and possibly transform the string query using the manual edit parser
107 TCTLAbstractProperty newProperty;116 TCTLAbstractProperty newProperty;
108 try {117 try {
109 newProperty = TAPAALCTLQueryParser.parse(clonedQuery.getProperty().toString());118 newProperty = TAPAALCTLQueryParser.parse(clonedQuery.getProperty().toString());
110 } catch (Throwable ex) {119 } catch (Throwable ex) {
111 newProperty = clonedQuery == null ? new TCTLPathPlaceHolder() : clonedQuery.getProperty();120 newProperty = clonedQuery == null ? new TCTLPathPlaceHolder() : clonedQuery.getProperty();
112 }121 }
113 newProperty.accept(new RenameAllPlacesVisitor(mapping), null);122 newProperty.accept(new RenameAllPlacesVisitor(mapping), null);
114 newProperty.accept(new RenameAllTransitionsVisitor(mapping), null);123 newProperty.accept(new RenameAllTransitionsVisitor(mapping), null);
115 XMLVisitor.buildXMLQuery(newProperty, clonedQuery.getName());124 XMLVisitor.buildXMLQuery(newProperty, clonedQuery.getName());
116 }125 }
117 queryStream.print(XMLVisitor.getFormatted());126 queryStream.print(XMLVisitor.getFormatted());
118 127
119 queryStream.close();128 queryStream.close();
120 } catch(FileNotFoundException e) {129 } catch (FileNotFoundException e) {
121 System.err.append("An error occurred while exporting the queries to XML.");130 System.err.append("An error occurred while exporting the queries to XML.");
122 }131 }
123 }132 }
133
134 public static void toVerifyTAPN(TimedArcPetriNetNetwork network, Iterable<TAPNQuery> queries, String modelFile, String queryFile, boolean isDTAPN) {
135 VerifyTAPNExporter exporter = new VerifyTAPNExporter();
136
137 ITAPNComposer composer = new TAPNComposer(new MessengerImpl(), false);
138 Tuple<TimedArcPetriNet, NameMapping> transformedModel = composer.transformModel(network);
139 TimedArcPetriNet model = transformedModel.value1();
140
141 TabContent.TAPNLens lens = new TabContent.TAPNLens(!model.isUntimed(), model.hasUncontrollableTransitions());
142
143 RenameAllPlacesVisitor visitor = new RenameAllPlacesVisitor(transformedModel.value2());
144 int i = 0;
145 for (TAPNQuery query : queries) {
146 query.getProperty().accept(visitor, null);
147 i++;
148
149 if (lens.isGame() && isDTAPN) {
150 exporter.export(model, new dk.aau.cs.model.tapn.TAPNQuery(query.getProperty(), 0), new File(modelFile), new File(queryFile + i + ".q"), lens);
151 } else {
152 exporter.export(model, new dk.aau.cs.model.tapn.TAPNQuery(query.getProperty(), 0), new File(modelFile), new File(queryFile + i + ".q"), new TabContent.TAPNLens(true, false));
153 }
154 }
155 }
124156
125 public static void toPostScript(Object g, String filename)157 public static void toPostScript(Object g, String filename)
126 throws PrintException, IOException {158 throws PrintException, IOException {
@@ -187,24 +219,23 @@
187 // dot is for extension219 // dot is for extension
188 filename = filename.substring(0, dotpos + 1);220 filename = filename.substring(0, dotpos + 1);
189 switch (format) {221 switch (format) {
190 case PNG:222 case PNG:
191 filename += "png";223 filename += "png";
192 break;224 break;
193 case POSTSCRIPT:225 case POSTSCRIPT:
194 filename += "ps";226 filename += "ps";
195 break;227 break;
196 case TIKZ:228 case TIKZ:
197 filename += "tex";229 filename += "tex";
198 break;230 break;
199 case PNML:231 case PNML:
200 filename += "pnml";232 filename += "pnml";
201 break;233 break;
202 case QUERY:234 case QUERY:
203 filename = filename.substring(0, dotpos);235 filename = filename.substring(0, dotpos);
204 filename += "-queries.xml";236 filename += "-queries.xml";
205 break;237 break;
206 }238 }
207
208 }239 }
209 }240 }
210241
@@ -266,7 +297,7 @@
266 }297 }
267 break;298 break;
268 }299 }
269 } catch (Exception e) {300 } catch (Exception e) {
270 // There was some problem with the action301 // There was some problem with the action
271 JOptionPane.showMessageDialog(CreateGui.getApp(),302 JOptionPane.showMessageDialog(CreateGui.getApp(),
272 "There were errors performing the requested action:\n" + e,303 "There were errors performing the requested action:\n" + e,
273304
=== modified file 'src/pipe/gui/ExportBatchDialog.java'
--- src/pipe/gui/ExportBatchDialog.java 2020-07-20 08:09:36 +0000
+++ src/pipe/gui/ExportBatchDialog.java 2020-12-14 17:15:10 +0000
@@ -24,19 +24,7 @@
24import java.util.Comparator;24import java.util.Comparator;
25import java.util.HashMap;25import java.util.HashMap;
26import java.util.List;26import java.util.List;
27import javax.swing.BorderFactory;27import javax.swing.*;
28import javax.swing.DefaultListModel;
29import javax.swing.JButton;
30import javax.swing.JCheckBox;
31import javax.swing.JDialog;
32import javax.swing.JLabel;
33import javax.swing.JList;
34import javax.swing.JPanel;
35import javax.swing.JProgressBar;
36import javax.swing.JScrollPane;
37import javax.swing.JTable;
38import javax.swing.JTextField;
39import javax.swing.ListSelectionModel;
40import javax.swing.border.Border;28import javax.swing.border.Border;
41import javax.swing.event.DocumentEvent;29import javax.swing.event.DocumentEvent;
42import javax.swing.event.DocumentListener;30import javax.swing.event.DocumentListener;
@@ -46,6 +34,7 @@
46import javax.xml.parsers.ParserConfigurationException;34import javax.xml.parsers.ParserConfigurationException;
47import javax.xml.transform.TransformerConfigurationException;35import javax.xml.transform.TransformerConfigurationException;
48import javax.xml.transform.TransformerException;36import javax.xml.transform.TransformerException;
37
49import org.w3c.dom.DOMException;38import org.w3c.dom.DOMException;
50import dk.aau.cs.gui.FileNameCellRenderer;39import dk.aau.cs.gui.FileNameCellRenderer;
51import dk.aau.cs.gui.components.ExportBatchResultTableModel;40import dk.aau.cs.gui.components.ExportBatchResultTableModel;
@@ -55,6 +44,7 @@
55import dk.aau.cs.model.tapn.TimedArcPetriNet;44import dk.aau.cs.model.tapn.TimedArcPetriNet;
56import dk.aau.cs.util.StringComparator;45import dk.aau.cs.util.StringComparator;
57import pipe.dataLayer.DataLayer;46import pipe.dataLayer.DataLayer;
47import pipe.dataLayer.TAPNQuery;
58import pipe.gui.widgets.filebrowser.FileBrowser;48import pipe.gui.widgets.filebrowser.FileBrowser;
5949
60public class ExportBatchDialog extends JDialog {50public class ExportBatchDialog extends JDialog {
@@ -62,8 +52,9 @@
62 private final static String TOOL_TIP_AddFilesButton = "Press to add nets to batch export";52 private final static String TOOL_TIP_AddFilesButton = "Press to add nets to batch export";
63 private final static String TOOL_TIP_RemoveFilesButton = "Press to remove the currently selected nets";53 private final static String TOOL_TIP_RemoveFilesButton = "Press to remove the currently selected nets";
64 private final static String TOOL_TIP_ClearFilesButton = "Press to remove all nets from list";54 private final static String TOOL_TIP_ClearFilesButton = "Press to remove all nets from list";
65 private final static String TOOL_TIP_ExportFilesButton = "Press to export all nets in PNML and XML format";55 private final static String TOOL_TIP_ExportFilesButton = "Press to export all nets in the selected format";
66 private final static String TOOL_TIP_UniqueQueryNamesCheckbox = "Give queries unique names when exporting";56 private final static String TOOL_TIP_SelectedEngineComboBox = "Select the engine in which the format of the net should be compatible with";
57 private final static String TOOL_TIP_UniqueQueryNamesCheckbox = "Give queries unique names when exporting";
67 private final static String NAME_SuccesString = "Succeeded";58 private final static String NAME_SuccesString = "Succeeded";
68 private final static String NAME_SuccesStringOrphanTransitionsRemoved = "Succeeded, orphan transitions removed";59 private final static String NAME_SuccesStringOrphanTransitionsRemoved = "Succeeded, orphan transitions removed";
69 private final static String NAME_FailStringFolderExists = "Failed as the subfolder already exists";60 private final static String NAME_FailStringFolderExists = "Failed as the subfolder already exists";
@@ -83,7 +74,8 @@
83 private final List<File> files = new ArrayList<File>();74 private final List<File> files = new ArrayList<File>();
84 private String lastExportPath;75 private String lastExportPath;
85 private String lastSelectPath;76 private String lastSelectPath;
86 private JCheckBox uniqueQueryNames;77 private JCheckBox uniqueQueryNames;
78 private JComboBox selectedEngine;
87 private File destinationFile;79 private File destinationFile;
88 private ExportBatchResultTableModel tableModel;80 private ExportBatchResultTableModel tableModel;
89 81
@@ -243,14 +235,28 @@
243 enableButtons();235 enableButtons();
244 });236 });
245 chooserPanel.add(destinationPathSelector, gbc);237 chooserPanel.add(destinationPathSelector, gbc);
246 238
239 final String[] options = new String[] {
240 "PNML and XML queries (verifypn)",
241 "Continuous Engine model and queries (verifytapn)",
242 "Discrete Engine model and queries (verifydtapn)"
243 };
244 selectedEngine = new JComboBox(options);
245 selectedEngine.setToolTipText(TOOL_TIP_SelectedEngineComboBox);
246
247 gbc = new GridBagConstraints();
248 gbc.gridx = 0;
249 gbc.gridy = 1;
250 gbc.anchor = GridBagConstraints.NORTHWEST;
251 gbc.insets = new Insets(10, 0, 0, 0);
252 chooserPanel.add(selectedEngine, gbc);
247253
248 uniqueQueryNames = new JCheckBox("Use unique query names", true);254 uniqueQueryNames = new JCheckBox("Use unique query names", true);
249 uniqueQueryNames.setToolTipText(TOOL_TIP_UniqueQueryNamesCheckbox);255 uniqueQueryNames.setToolTipText(TOOL_TIP_UniqueQueryNamesCheckbox);
250 256
251 gbc = new GridBagConstraints();257 gbc = new GridBagConstraints();
252 gbc.gridx = 0;258 gbc.gridx = 0;
253 gbc.gridy = 1;259 gbc.gridy = 2;
254 gbc.anchor = GridBagConstraints.NORTHWEST;260 gbc.anchor = GridBagConstraints.NORTHWEST;
255 gbc.insets = new Insets(10, 0, 0, 0);261 gbc.insets = new Insets(10, 0, 0, 0);
256 chooserPanel.add(uniqueQueryNames, gbc);262 chooserPanel.add(uniqueQueryNames, gbc);
@@ -459,7 +465,7 @@
459 }465 }
460 else return;466 else return;
461 }467 }
462 468
463 private void exportFiles() {469 private void exportFiles() {
464 //loading bar470 //loading bar
465 initProgressBar();471 initProgressBar();
@@ -509,13 +515,27 @@
509 }515 }
510 516
511 private void exportModel(File file, Path path) throws Exception {517 private void exportModel(File file, Path path) throws Exception {
512 LoadedModel loadedModel = loader.load(file);518 LoadedModel loadedModel = loader.load(file);
513 exportPNML(path, loadedModel);519 Collection<TAPNQuery> queries;
514 if(!uniqueQueryNames.isSelected())520
515 Export.toQueryXML(loadedModel.network(), path.toString() + "/query.xml", loadedModel.queries());521 if (uniqueQueryNames.isSelected()) {
516 else {522 queries = renameQueries(file.getName(), loadedModel.queries());
517 Export.toQueryXML(loadedModel.network(), path.toString() + "/query.xml", renameQueries(file.getName(), loadedModel.queries()));523 } else {
518 }524 queries = loadedModel.queries();
525 }
526
527 switch (selectedEngine.getSelectedIndex()) {
528 case 0:
529 exportPNML(path, loadedModel);
530 Export.toQueryXML(loadedModel.network(), path.toString() + "/query.xml", queries);
531 break;
532 case 1:
533 Export.toVerifyTAPN(loadedModel.network(), queries, path.toString() + "/model.xml", path.toString() + "/query", false);
534 break;
535 case 2:
536 Export.toVerifyTAPN(loadedModel.network(), queries, path.toString() + "/model.xml", path.toString() + "/query", true);
537 break;
538 }
519 }539 }
520 540
521 private void exportPNML(Path path, LoadedModel loadedModel) throws DOMException, TransformerConfigurationException, IOException, ParserConfigurationException, TransformerException {541 private void exportPNML(Path path, LoadedModel loadedModel) throws DOMException, TransformerConfigurationException, IOException, ParserConfigurationException, TransformerException {
522542
=== modified file 'src/pipe/gui/GuiFrame.java'
--- src/pipe/gui/GuiFrame.java 2020-10-30 12:24:35 +0000
+++ src/pipe/gui/GuiFrame.java 2020-12-14 17:15:10 +0000
@@ -18,8 +18,10 @@
1818
19import com.sun.jna.Platform;19import com.sun.jna.Platform;
20import dk.aau.cs.gui.*;20import dk.aau.cs.gui.*;
21import dk.aau.cs.model.tapn.TimedArcPetriNet;
21import dk.aau.cs.util.JavaUtil;22import dk.aau.cs.util.JavaUtil;
22import dk.aau.cs.verification.VerifyTAPN.VerifyPN;23import dk.aau.cs.verification.VerifyTAPN.VerifyPN;
24import dk.aau.cs.verification.VerifyTAPN.VerifyTAPNExporter;
23import net.tapaal.Preferences;25import net.tapaal.Preferences;
24import net.tapaal.TAPAAL;26import net.tapaal.TAPAAL;
25import net.tapaal.helpers.Reference.MutableReference;27import net.tapaal.helpers.Reference.MutableReference;
@@ -27,6 +29,7 @@
27import net.tapaal.swinghelpers.ExtendedJTabbedPane;29import net.tapaal.swinghelpers.ExtendedJTabbedPane;
28import net.tapaal.swinghelpers.ToggleButtonWithoutText;30import net.tapaal.swinghelpers.ToggleButtonWithoutText;
29import org.jetbrains.annotations.NotNull;31import org.jetbrains.annotations.NotNull;
32import pipe.dataLayer.TAPNQuery;
30import pipe.gui.Pipe.ElementType;33import pipe.gui.Pipe.ElementType;
31import pipe.gui.action.GuiAction;34import pipe.gui.action.GuiAction;
32import pipe.gui.widgets.WorkflowDialog;35import pipe.gui.widgets.WorkflowDialog;
@@ -173,7 +176,7 @@
173 currentTab.ifPresent(TabContentActions::importTrace);176 currentTab.ifPresent(TabContentActions::importTrace);
174 }177 }
175 };178 };
176 private final GuiAction exportBatchAction = new GuiAction("Batch Export to PNML and XML Queries", "Export multiple nets into PNML together with the XML queries, while removing the timing information", KeyStroke.getKeyStroke('D', (shortcutkey + InputEvent.SHIFT_DOWN_MASK))) {179 private final GuiAction exportBatchAction = new GuiAction("Batch Export of model and queries", "Export multiple nets into PNML together with the XML queries, while removing the timing information", KeyStroke.getKeyStroke('D', (shortcutkey + InputEvent.SHIFT_DOWN_MASK))) {
177 public void actionPerformed(ActionEvent e) {180 public void actionPerformed(ActionEvent e) {
178 ExportBatchDialog.ShowExportBatchDialog();181 ExportBatchDialog.ShowExportBatchDialog();
179 }182 }
@@ -1380,13 +1383,10 @@
13801383
1381 exportMenu.add(exportPSAction);1384 exportMenu.add(exportPSAction);
13821385
1383
1384 exportMenu.add(exportToTikZAction);1386 exportMenu.add(exportToTikZAction);
13851387
1386
1387 exportMenu.add(exportToPNMLAction);1388 exportMenu.add(exportToPNMLAction);
13881389
1389
1390 exportMenu.add(exportToXMLAction);1390 exportMenu.add(exportToXMLAction);
13911391
1392 exportMenu.add(exportBatchAction);1392 exportMenu.add(exportBatchAction);
13931393
=== modified file 'src/pipe/gui/widgets/QueryDialog.java'
--- src/pipe/gui/widgets/QueryDialog.java 2020-11-06 13:15:11 +0000
+++ src/pipe/gui/widgets/QueryDialog.java 2020-12-14 17:15:10 +0000
@@ -3049,10 +3049,10 @@
3049 }3049 }
3050 if(reduction == ReductionOption.VerifyTAPN || reduction == ReductionOption.VerifyTAPNdiscreteVerification) {3050 if(reduction == ReductionOption.VerifyTAPN || reduction == ReductionOption.VerifyTAPNdiscreteVerification) {
3051 VerifyTAPNExporter exporter = new VerifyTAPNExporter();3051 VerifyTAPNExporter exporter = new VerifyTAPNExporter();
3052 exporter.export(transformedModel.value1(), clonedQuery, new File(xmlFile), new File(queryFile), tapnQuery, lens);3052 exporter.export(transformedModel.value1(), clonedQuery, new File(xmlFile), new File(queryFile), lens);
3053 } else if(reduction == ReductionOption.VerifyPN){3053 } else if(reduction == ReductionOption.VerifyPN){
3054 VerifyPNExporter exporter = new VerifyPNExporter();3054 VerifyPNExporter exporter = new VerifyPNExporter();
3055 exporter.export(transformedModel.value1(), clonedQuery, new File(xmlFile), new File(queryFile), tapnQuery, lens);3055 exporter.export(transformedModel.value1(), clonedQuery, new File(xmlFile), new File(queryFile), lens);
3056 } else {3056 } else {
3057 UppaalExporter exporter = new UppaalExporter();3057 UppaalExporter exporter = new UppaalExporter();
3058 try {3058 try {
30593059
=== modified file 'src/pipe/gui/widgets/filebrowser/NativeFileBrowser.java'
--- src/pipe/gui/widgets/filebrowser/NativeFileBrowser.java 2020-05-05 18:15:47 +0000
+++ src/pipe/gui/widgets/filebrowser/NativeFileBrowser.java 2020-12-14 17:15:10 +0000
@@ -29,7 +29,7 @@
29 //if(path == null) path = lastPath;29 //if(path == null) path = lastPath;
3030
31 this.ext = ext;31 this.ext = ext;
32 this.optionalExt = optionalExt;32 this.optionalExt = optionalExt;
33 //fc.setDirectory(path);33 //fc.setDirectory(path);
3434
35 // Setup filter if extension specified35 // Setup filter if extension specified

Subscribers

People subscribed via source and target branches