diff --git a/org.jhotdraw8.draw/src/main/java/org.jhotdraw8.draw/org/jhotdraw8/draw/io/SimpleXmlReader.java b/org.jhotdraw8.draw/src/main/java/org.jhotdraw8.draw/org/jhotdraw8/draw/io/SimpleXmlReader.java index d40d42878..ec6313159 100644 --- a/org.jhotdraw8.draw/src/main/java/org.jhotdraw8.draw/org/jhotdraw8/draw/io/SimpleXmlReader.java +++ b/org.jhotdraw8.draw/src/main/java/org.jhotdraw8.draw/org/jhotdraw8/draw/io/SimpleXmlReader.java @@ -173,8 +173,13 @@ private Figure read(AutoCloseable in, @Nullable Drawing drawing, @Nullable URI d if (figure == null) { throw new IOException("Input file is empty."); } - if ((figure instanceof Drawing)) { + if ((figure instanceof Drawing d)) { figure.set(Drawing.DOCUMENT_HOME, documentHome); + + for (Figure f : figure.preorderIterable()) { + f.addedToDrawing(d); + } + } workState.updateProgress(1.0); return figure; diff --git a/org.jhotdraw8.grapher/src/main/java/org.jhotdraw8.grapher/org/jhotdraw8/grapher/GrapherActivity.java b/org.jhotdraw8.grapher/src/main/java/org.jhotdraw8.grapher/org/jhotdraw8/grapher/GrapherActivity.java index a03e0c184..7be993062 100755 --- a/org.jhotdraw8.grapher/src/main/java/org.jhotdraw8.grapher/org/jhotdraw8/grapher/GrapherActivity.java +++ b/org.jhotdraw8.grapher/src/main/java/org.jhotdraw8.grapher/org/jhotdraw8/grapher/GrapherActivity.java @@ -483,7 +483,6 @@ public CompletionStage read(URI uri, DataFormat format, ImmutableMap FigureFactory factory = new DefaultFigureFactory(idFactory); SimpleXmlReader io = new SimpleXmlReader(factory, idFactory, GRAPHER_NAMESPACE_URI); AbstractDrawing drawing = (AbstractDrawing) io.read(uri, null, workState); - System.out.println("READING..." + uri); applyUserAgentStylesheet(drawing); return drawing; }).thenApply(drawing -> {