code: public static Writer createDotWriter(final boolean modal) {
          return new StringWriter() {
  
              @Override
              public void close() throws IOException {
                  renderDOT(toString(), modal);
                  super.close();
              }
          };
      }
docs: Creates a Writer that can be used to write a DOT description to. Upon closing the writer, a window with the
  rendering result appears.
  
  @param modal
  whether or not this window is modal (if set to {@code true}, calls to {@link Writer#close()} will
  block.
  
  @return the writer