private Marking parsePlaces(MID mid, PrTPanel netModel) throws ParseException { DataLayerInterface net = netModel.getModel(); Marking initialMarking = new Marking(); PipePlace[] places = net.getPlaces(); for (int i = 0; i < places.length; i++) { // System.out.println("Place ID: "+places[i].getId()+" Name: "+places[i].getName()); String placeName = places[i].getName(); if (!MIDParser.isIdentifier(placeName)) throw new ParseException( modelNameMessage(netModel) + placeName + " - " + LocaleBundle.bundleString("should start with a letter")); if (!places[i].getConnectFromIterator().hasNext() && !places[i].getConnectToIterator().hasNext()) throw new ParseException( modelNameMessage(netModel) + placeName + " - " + LocaleBundle.bundleString("is not connected")); parseTokens(initialMarking, places[i]); mid.addPlace(placeName); } return initialMarking; }
private PipePlace pipePlaceInSubNet(String placeName, PrTPanel childNetPanel) { DataLayerInterface net = childNetPanel.getModel(); for (PipePlace pipePlace : net.getPlaces()) if (pipePlace.getName().equals(placeName)) return pipePlace; return null; }