public IEntity getHistorical() { final Group g = getCurrentGroup(); if (g == null) { return getOrCreateEntity("*historical", EntityType.PSEUDO_STATE); } return getOrCreateEntity("*historical*" + g.getCode(), EntityType.PSEUDO_STATE); }
@Override protected CommandExecutionResult executeArg(List<String> arg) { final String code; final String display; if (arg.get(1) == null) { if (StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get(0)).length() == 0) { code = "##" + UniqueSequence.getValue(); display = null; } else { code = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get(0)); display = code; } } else { display = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get(0)); code = arg.get(1); } final Group currentPackage = getSystem().getCurrentGroup(); // if (getSystem().entityExist(code)) { // return CommandExecutionResult.error("Package cannot have the same // name as an existing class"); // } final Group p = getSystem().getOrCreateGroup(code, display, null, GroupType.PACKAGE, currentPackage); p.setBold(true); final String color = arg.get(2); if (color != null) { p.setBackColor(HtmlColor.getColorIfValid(color)); } return CommandExecutionResult.ok(); }
public IEntity getEnd() { final Group p = getCurrentGroup(); if (p == null) { return getOrCreateEntity("*end", EntityType.CIRCLE_END); } return getOrCreateEntity("*end*" + p.getCode(), EntityType.CIRCLE_END); }
public IEntity getStart() { final Group g = getCurrentGroup(); if (g == null) { return getOrCreateEntity("*start", EntityType.CIRCLE_START); } return getOrCreateEntity("*start*" + g.getCode(), EntityType.CIRCLE_START); }
@Override public void endGroup() { final Group cur = getCurrentGroup(); if (cur != null && cur.getType() == GroupType.CONCURRENT_STATE) { super.endGroup(); } super.endGroup(); }
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); }
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; }
protected final String getFullyQualifiedCode(String code) { if (code.startsWith("\\") || code.startsWith("~") || code.startsWith(".")) { return code.substring(1); } if (code.contains(".")) { return code; } final Group g = this.getCurrentGroup(); if (g == null) { return code; } final String namespace = g.getNamespace(); if (namespace == null) { return code; } return namespace + "." + code; }
public IEntity getHistorical(String codeGroup) { final Group g = getOrCreateGroup(codeGroup, null, null, GroupType.STATE, null); final IEntity result = getOrCreateEntity("*historical*" + g.getCode(), EntityType.PSEUDO_STATE); endGroup(); return result; }