~tapaal-developers/tapaal/trunk

« back to all changes in this revision

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

  • Committer: srba.jiri at gmail
  • Date: 2019-03-09 17:40:57 UTC
  • mfrom: (978.3.12 MakeMultiShared)
  • Revision ID: srba.jiri@gmail.com-20190309174057-qfotipidayci6qff
merged in branch lp:~tapaal-contributor/tapaal/places-with-same-name-shared-1801728 that allows to share places/transitions with names that appear in several components

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
import java.util.List;
7
7
 
8
8
import pipe.gui.undo.AddArcPathPointEdit;
9
 
 
 
9
import pipe.gui.widgets.PlaceEditorPanel;
10
10
import dk.aau.cs.model.tapn.Bound.InfBound;
11
11
import dk.aau.cs.util.IntervalOperations;
12
12
import dk.aau.cs.util.Require;
49
49
        }
50
50
 
51
51
        public void add(TimedPlace place) {
 
52
                add(place, false);
 
53
        }
 
54
        public void add(TimedPlace place, boolean multiRemove) {
52
55
                Require.that(place != null, "Argument must be a non-null place");
53
 
                Require.that(!isNameUsed(place.name()) || (place.isShared() && !places.contains(place)), "A place or transition with the specified name already exists in the petri net.");
54
 
 
 
56
                if(!multiRemove)
 
57
                        Require.that(!isNameUsed(place.name()) || (place.isShared() && !places.contains(place)), "A place or transition with the specified name already exists in the petri net.");
55
58
                if(!place.isShared()) ((LocalTimedPlace)place).setModel(this);
56
59
                places.add(place);
57
60
                place.setCurrentMarking(currentMarking);