~tapaal-contributor/tapaal/Typos-1896460

« back to all changes in this revision

Viewing changes to src/dk/aau/cs/io/TimedArcPetriNetNetworkWriter.java

  • Committer: srba.jiri at gmail
  • Date: 2020-08-19 12:02:28 UTC
  • mfrom: (1071.2.34 untimed-timed-gui)
  • Revision ID: srba.jiri@gmail.com-20200819120228-ktxdev3ou3kuj3l0
merged in lp:~tapaal-contributor/tapaal/untimed-timed-gui adding timed/untimed lens projection

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import javax.xml.transform.dom.DOMSource;
18
18
import javax.xml.transform.stream.StreamResult;
19
19
 
 
20
import dk.aau.cs.gui.TabContent;
20
21
import org.w3c.dom.Attr;
21
22
import org.w3c.dom.DOMException;
22
23
import org.w3c.dom.Document;
55
56
        private final Iterable<TAPNQuery> queries;
56
57
        private final Iterable<Constant> constants;
57
58
        private final TimedArcPetriNetNetwork network;
58
 
    private boolean isTimed;
59
 
    private boolean isGame;
 
59
    private final TabContent.TAPNLens lens;
60
60
 
61
61
        public TimedArcPetriNetNetworkWriter(
62
62
                        TimedArcPetriNetNetwork network, 
63
63
                        Iterable<Template> templates,
64
64
                        Iterable<TAPNQuery> queries,
65
 
                        Iterable<Constant> constants) {
 
65
                        Iterable<Constant> constants
 
66
    ) {
66
67
                this.network = network;
67
68
                this.templates = templates;
68
69
                this.queries = queries;
69
70
                this.constants = constants;
 
71
                this.lens = TabContent.TAPNLens.Default;
70
72
        }
71
73
 
72
74
    public TimedArcPetriNetNetworkWriter(
74
76
        Iterable<Template> templates,
75
77
        Iterable<TAPNQuery> queries,
76
78
        Iterable<Constant> constants,
77
 
        boolean isTimed,
78
 
        boolean isGame) {
 
79
        TabContent.TAPNLens lens
 
80
    ) {
79
81
        this.network = network;
80
82
        this.templates = templates;
81
83
        this.queries = queries;
82
84
        this.constants = constants;
83
 
        this.isTimed = isTimed;
84
 
        this.isGame = isGame;
 
85
        this.lens = lens;
85
86
    }
86
87
        
87
88
        public ByteArrayOutputStream savePNML() throws IOException, ParserConfigurationException, DOMException, TransformerConfigurationException, TransformerException {
161
162
    private void appendFeature(Document document, Element root) {
162
163
        String isTimed = "true";
163
164
        String isGame = "true";
164
 
        if (!this.isTimed) {
 
165
        if (!lens.isTimed()) {
165
166
            isTimed = "false";
166
167
        }
167
 
        if (!this.isGame) {
 
168
        if (!lens.isGame()) {
168
169
            isGame = "false";
169
170
        }
170
171