~cpn-gui/tapaal/TACPN

« back to all changes in this revision

Viewing changes to src/dk/aau/cs/model/tapn/Colored/ColoredArcPetriNetNetwork.java

  • Committer: Mark Glavind
  • Date: 2019-05-23 06:39:50 UTC
  • Revision ID: mglavi14@student.aau.dk-20190523063950-u8nbf7zzycyoz11m
Fixed an issue where loading a document would sometimes create two dot colortypes

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
    public ColoredArcPetriNetNetwork() { //TODO: all the TACPN functionality in TAPN should be moved here
9
9
        super();
10
 
        initialize();
 
10
        initialize(true);
 
11
    }
 
12
 
 
13
    public ColoredArcPetriNetNetwork(boolean makeDot) {
 
14
        super();
 
15
        initialize(makeDot);
11
16
    }
12
17
 
13
18
    public ColoredArcPetriNetNetwork(ConstantStore constants) {
14
19
        super(constants);
15
 
        initialize();
16
 
    }
17
 
 
18
 
    private void initialize() {
 
20
        initialize(true);
 
21
    }
 
22
 
 
23
    public ColoredArcPetriNetNetwork(ConstantStore constants, boolean makeDot) {
 
24
        super(constants);
 
25
        initialize(makeDot);
 
26
    }
 
27
 
 
28
    private void initialize(boolean makeDot) {
19
29
        netType = NetType.CPN;
20
30
        setMarking(new ColoredNetworkMarking());
21
 
        ColorType dotDefaultColorType = ColorType.COLORTYPE_DOT;
22
 
        super.add(dotDefaultColorType);
 
31
        if (makeDot) {
 
32
            ColorType dotDefaultColorType = ColorType.COLORTYPE_DOT;
 
33
            super.add(dotDefaultColorType);
 
34
        }
23
35
    }
24
36
}
 
 
b'\\ No newline at end of file'