Beispiel #1
0
  @Override
  public void draw(Drawing context) {
    all = new LinkedHashSet<>();
    this.breadthFirst(this.both())
        .forEach(
            x -> {
              Rect r = x.properties.get(frame);

              {
                Map<String, Function<Box, FLine>> drawing =
                    x.properties.computeIfAbsent(interactiveDrawing, k -> new LinkedHashMap<>());

                if (drawing != null && drawing.size() > 0) {
                  Iterator<Function<Box, FLine>> it = drawing.values().iterator();
                  while (it.hasNext()) {
                    Function<Box, FLine> f = it.next();
                    FLine fl = f.apply(x);
                    if (fl == null) it.remove();
                    else all.add(fl);
                  }
                }
              }
              {
                Map<String, Supplier<FLine>> drawing =
                    x.properties.computeIfAbsent(
                        interactiveLines, k -> new LinkedHashMapAndArrayList<>());
                if (drawing != null && drawing.size() > 0) {
                  Iterator<Supplier<FLine>> it = drawing.values().iterator();
                  while (it.hasNext()) {
                    Supplier<FLine> f = it.next();
                    FLine fl = f.get();
                    if (fl == null) it.remove();
                    else all.add(fl);
                  }
                }
              }
            });
    for (FLine f : all)
      f.attributes.computeIfAbsent(
          projectedArea,
          (k) ->
              new Cached<FLine, Object, Area>(
                  (fline, previously) -> projectFLineToArea(fline),
                  (fline) -> new Object[] {fline, fline.getModCount()}));
  }