Exemplo n.º 1
0
 private void parseSubModelMarkingAnnotations(MID mid) throws ParseException {
   for (JPanel subModel : editor.getSubModels())
     if (subModel instanceof PrTPanel) {
       // deal with initial markings
       ArrayList<Marking> initMarkings =
           parseSubModelMarkingAnnotations((PrTPanel) subModel, XMIDProcessor.INIT_KEYWORD);
       Marking nonAnnotationInitMarking =
           subModelNonAnnotationInitialMarkings.get((PrTPanel) subModel);
       if (nonAnnotationInitMarking != null) initMarkings.add(0, nonAnnotationInitMarking);
       if (initMarkings.size() > 1)
         throw new ParseException(
             LocaleBundle.bundleString("Warning")
                 + ": "
                 + modelNameMessage((PrTPanel) subModel)
                 + LocaleBundle.bundleString("SUBMODEL_HAS_MORE_THAN_ONE_INITIAL_MARKINGS"));
       if (initMarkings.size() > 0) {
         if (mid.getInitialMarkings().size() == 0) mid.addInitialMarking(initMarkings.get(0));
         else mid.getInitialMarkings().get(0).merge(initMarkings.get(0));
       }
     }
 }