()
| 128 | } |
| 129 | |
| 130 | private void checkPairs() { |
| 131 | |
| 132 | Set<Box> mainBoxes = new LinkedHashSet<>(); |
| 133 | Set<Box> frameBoxes = new LinkedHashSet<>(); |
| 134 | |
| 135 | this.breadthFirst(this.both()).filter(x -> x.properties.has(isPaired) && x.properties.isTrue(isPaired, false)).forEach(x -> { |
| 136 | if (x.properties.get(Box.name).length()>0) |
| 137 | { |
| 138 | mainBoxes.add(x); |
| 139 | } |
| 140 | else |
| 141 | { |
| 142 | frameBoxes.add(x); |
| 143 | } |
| 144 | }); |
| 145 | |
| 146 | |
| 147 | for(Box b : mainBoxes) |
| 148 | { |
| 149 | for(Box bb : b.children()) |
| 150 | { |
| 151 | if (bb.properties.get(Box.name).trim().length()==0) |
| 152 | { |
| 153 | b.properties.put(f, bb); |
| 154 | bb.properties.put(m, b); |
| 155 | b.properties.put(isPaired, true); |
| 156 | bb.properties.put(isPaired, true); |
| 157 | } |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | for(Box bb : frameBoxes) |
| 162 | { |
| 163 | bb.properties.put(name, ""); |
| 164 | // install decoration if there isn't any |
| 165 | bb.properties.put(isPaired, true); |
| 166 | } |
| 167 | |
| 168 | // callbacks for frame changed! |
| 169 | for(Box bb : frameBoxes) |
| 170 | { |
| 171 | IdempotencyMap<Supplier<Collection<? extends Supplier<FLine>>>> q = bb.properties.getOrConstruct(FLineDrawing.bulkLines); |
| 172 | Supplier<Collection<? extends Supplier<FLine>>> fr = q.get("__framemarking__"); |
| 173 | if (fr==null) |
| 174 | { |
| 175 | installFrameDecor(bb); |
| 176 | } |
| 177 | } |
| 178 | for(Box bb : mainBoxes) |
| 179 | { |
| 180 | IdempotencyMap<Supplier<Collection<? extends Supplier<FLine>>>> q = bb.properties.getOrConstruct(FLineDrawing.bulkLines); |
| 181 | Supplier<Collection<? extends Supplier<FLine>>> fr = q.get("__framemarking__"); |
| 182 | if (fr==null) |
| 183 | { |
| 184 | installMainDecor(bb); |
| 185 | } |
| 186 | } |
| 187 |
no test coverage detected