~tapaal-contributor/tapaal/unselect-objects-after-undo-1894108

« back to all changes in this revision

Viewing changes to src/dk/aau/cs/io/TapnLegacyXmlLoader.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:
13
13
import javax.xml.parsers.DocumentBuilderFactory;
14
14
import javax.xml.parsers.ParserConfigurationException;
15
15
 
 
16
import dk.aau.cs.gui.TabContent;
16
17
import org.w3c.dom.Document;
17
18
import org.w3c.dom.Element;
18
19
import org.w3c.dom.Node;
83
84
        private final IdResolver idResolver = new IdResolver();
84
85
 
85
86
    private final Collection<String> messages = new ArrayList<>(10);
86
 
 
87
 
 
88
 
        public TapnLegacyXmlLoader() {}
 
87
    private final TabContent.TAPNLens lens = new TabContent.TAPNLens(true, false);
 
88
 
 
89
 
 
90
    public TapnLegacyXmlLoader() {}
89
91
        
90
92
        public LoadedModel load(InputStream file) throws FormatException {
91
93
                Require.that(file != null, "file must be non-null and exist");
278
280
                                         PlaceTransitionObject targetIn,
279
281
                                         int _endx, int _endy) throws FormatException {
280
282
 
281
 
            TimedInputArcComponent tempArc = new TimedInputArcComponent(new TimedOutputArcComponent(sourceIn, targetIn, 1, idInput));
 
283
            TimedInputArcComponent tempArc = new TimedInputArcComponent(new TimedOutputArcComponent(sourceIn, targetIn, 1, idInput), lens);
282
284
 
283
285
                TimedPlace place = tapn.getPlaceByName(sourceIn.getName());
284
286
                TimedTransition transition = tapn.getTransitionByName(targetIn.getName());
523
525
                TimedTransitionComponent transition = new TimedTransitionComponent(
524
526
                                positionXInput, positionYInput, idInput,
525
527
                                nameOffsetXInput, nameOffsetYInput, timedTransition,
526
 
                                infiniteServer, angle, priority);
 
528
                                infiniteServer, angle, priority, lens);
527
529
                transition.setUnderlyingTransition(t);
528
530
                guiModel.addPetriNetObject(transition);
529
531
                tapn.add(t);
556
558
        }
557
559
        idResolver.add(tapn.name(), idInput, nameInput);
558
560
 
559
 
        TimedPlaceComponent place = new TimedPlaceComponent(positionXInput, positionYInput, idInput, nameOffsetXInput, nameOffsetYInput);
 
561
        TimedPlaceComponent place = new TimedPlaceComponent(positionXInput, positionYInput, idInput, nameOffsetXInput, nameOffsetYInput, lens);
560
562
 
561
563
        LocalTimedPlace p = new LocalTimedPlace(nameInput, TimeInvariant.parse(invariant, constants));
562
564
        tapn.add(p);
615
617
 
616
618
                } else {
617
619
                        if (type.equals("timed")) {
618
 
                                tempArc = parseAndAddTimedInputArc(idInput, taggedArc,
619
 
                                                inscriptionTempStorage, sourceIn, targetIn,
620
 
                    aEndx, aEndy);
 
620
                                tempArc = parseAndAddTimedInputArc(idInput, taggedArc, inscriptionTempStorage, sourceIn, targetIn, aEndx, aEndy);
621
621
 
622
622
                        } else if (type.equals("transport")) {
623
623
                                tempArc = parseAndAddTransportArc(idInput, taggedArc,