Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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;
 }