Пример #1
0
 public boolean concurrentState() {
   final Group cur = getCurrentGroup();
   if (cur != null && cur.getType() == GroupType.CONCURRENT_STATE) {
     super.endGroup();
   }
   final Group conc1 =
       getOrCreateGroup(
           "CONC" + UniqueSequence.getValue(),
           "",
           null,
           GroupType.CONCURRENT_STATE,
           getCurrentGroup());
   conc1.setDashed(true);
   if (cur != null && cur.getType() == GroupType.STATE) {
     cur.moveEntitiesTo(conc1);
     super.endGroup();
     final Group conc2 =
         getOrCreateGroup(
             "CONC" + UniqueSequence.getValue(),
             "",
             null,
             GroupType.CONCURRENT_STATE,
             getCurrentGroup());
     conc2.setDashed(true);
   }
   return true;
 }
  public CucaDiagramSimplifier2(CucaDiagram diagram, List<String> dotStrings)
      throws IOException, InterruptedException {
    this.diagram = diagram;
    boolean changed;
    do {
      changed = false;
      final Collection<Group> groups = new ArrayList<Group>(diagram.getGroups(false));
      for (Group g : groups) {
        if (diagram.isAutarkic(g)) {
          final EntityType type;
          if (g.getType() == GroupType.CONCURRENT_STATE) {
            type = EntityType.STATE_CONCURRENT;
          } else if (g.getType() == GroupType.STATE) {
            type = EntityType.STATE;
          } else if (g.getType() == GroupType.INNER_ACTIVITY) {
            type = EntityType.ACTIVITY;
          } else if (g.getType() == GroupType.CONCURRENT_ACTIVITY) {
            type = EntityType.ACTIVITY_CONCURRENT;
          } else {
            throw new IllegalStateException();
          }
          final Entity proxy =
              new Entity(
                  "#" + g.getCode(), g.getDisplay(), type, g.getParent(), diagram.getHides());
          // if (type == EntityType.STATE) {
          // manageBackColorForState(diagram, g, proxy);
          // }
          for (Member field : g.getEntityCluster().getFieldsToDisplay()) {
            proxy.addField(field);
          }
          computeImageGroup(g, proxy, dotStrings);
          diagram.overideGroup(g, proxy);
          if (proxy.getImageFile() != null) {
            diagram.ensureDelete(proxy.getImageFile());
          }

          // final IEntity entityCluster = g.getEntityCluster();
          // if (entityCluster != null && entityCluster.getImageFile()
          // != null) {
          // proxy.addSubImage(entityCluster.getImageFile());
          // }
          // if (entityCluster != null) {
          // proxy.addSubImage((Entity) entityCluster);
          // }

          for (IEntity sub : g.entities().values()) {
            final DrawFile subImage = sub.getImageFile();
            if (subImage != null) {
              proxy.addSubImage(subImage);
            }
          }

          changed = true;
        }
      }
    } while (changed);
  }
Пример #3
0
 @Override
 public void endGroup() {
   final Group cur = getCurrentGroup();
   if (cur != null && cur.getType() == GroupType.CONCURRENT_STATE) {
     super.endGroup();
   }
   super.endGroup();
 }