default String getTitleOrName() { return StringUtils.defaultString(this.getTitle(), this.getName()); }
default String getTitleOrName() { return StringUtils.defaultString(this.getTitle(), this.getName()); }
/** * Translates the placement tags (labels) to their normalized real tag counterparts. Returns a 2-item array; index 0 has the normal names, index 1 * the placement names. * * Due to bad design, the rules contain column and row titles for the graph, rather than technology tags. To make them fit into the tag system, * this translation is needed. See also the "place:..." tags in the report hierarchy definition. */ private static Set<String> getPlacementTags(GraphContext graphContext, Set<String> potentialPlaceTags) { final TagGraphService tagService = new TagGraphService(graphContext); Set<String> placeNames = new HashSet<>(); potentialPlaceTags.forEach(name -> { final TagModel placeTag = tagService.getTagByName("place:" + Tag.normalizeName(name)); if (null != placeTag) placeNames.add(placeTag.getName()); }); return placeNames; }
/** * Translates the placement tags (labels) to their normalized real tag counterparts. Returns a 2-item array; index 0 has the normal names, index 1 * the placement names. * * Due to bad design, the rules contain column and row titles for the graph, rather than technology tags. To make them fit into the tag system, * this translation is needed. See also the "place:..." tags in the report hierarchy definition. */ private static Set<String> getPlacementTags(GraphContext graphContext, Set<String> potentialPlaceTags) { final TagGraphService tagService = new TagGraphService(graphContext); Set<String> placeNames = new HashSet<>(); potentialPlaceTags.forEach(name -> { final TagModel placeTag = tagService.getTagByName("place:" + Tag.normalizeName(name)); if (null != placeTag) placeNames.add(placeTag.getName()); }); return placeNames; }
String tagName = techTag.getName();
String tagName = techTag.getName();
private static TagModel getNonPlaceParent(TagGraphService tagService, TagModel tag) { if (tag == null) return null; final TagModel placeRoot = tagService.getTagByName(MAPPING_OF_PLACEMENT_NAMES); final Iterator<TagModel> parents = tag.getDesignatedByTags().iterator(); if (!parents.hasNext()) throw new WindupException("Tag is not designated by any tags: " + tag); TagModel nonPlaceParent = null; while (parents.hasNext()) { TagModel parentTag = parents.next(); if (TagGraphService.isTagUnderTagOrSame(parentTag, placeRoot)) continue; if (nonPlaceParent != null) throw new WindupException( String.format("Tag %s has more than one non-placement parent: %s, %s", tag.getName(), nonPlaceParent, parentTag)); nonPlaceParent = parentTag; } return nonPlaceParent; }
private static TagModel getNonPlaceParent(TagGraphService tagService, TagModel tag) { if (tag == null) return null; final TagModel placeRoot = tagService.getTagByName(MAPPING_OF_PLACEMENT_NAMES); final Iterator<TagModel> parents = tag.getDesignatedByTags().iterator(); if (!parents.hasNext()) throw new WindupException("Tag is not designated by any tags: " + tag); TagModel nonPlaceParent = null; while (parents.hasNext()) { TagModel parentTag = parents.next(); if (TagGraphService.isTagUnderTagOrSame(parentTag, placeRoot)) continue; if (nonPlaceParent != null) throw new WindupException( String.format("Tag %s has more than one non-placement parent: %s, %s", tag.getName(), nonPlaceParent, parentTag)); nonPlaceParent = parentTag; } return nonPlaceParent; }
mergeToTheRightCell(map, placement.row.getName(), placement.box.getName(), 0L, stat.getName(), stat, false); mergeToTheRightCell(map, "", placement.box.getName(), 0L, "", stat, true); mergeToTheRightCell(map, placement.row.getName(), placement.box.getName(), appToCountTowards, stat.getName(), stat, false); mergeToTheRightCell(map, "", placement.box.getName(), appToCountTowards, "", stat, false);
mergeToTheRightCell(map, placement.row.getName(), placement.box.getName(), 0L, stat.getName(), stat, false); mergeToTheRightCell(map, "", placement.box.getName(), 0L, "", stat, true); mergeToTheRightCell(map, placement.row.getName(), placement.box.getName(), appToCountTowards, stat.getName(), stat, false); mergeToTheRightCell(map, "", placement.box.getName(), appToCountTowards, "", stat, false);