Class SimpleXmlReader

java.lang.Object
org.jhotdraw8.draw.io.AbstractInputFormat
org.jhotdraw8.draw.io.SimpleXmlReader
All Implemented Interfaces:
ClipboardInputFormat, InputFormat

public class SimpleXmlReader extends AbstractInputFormat implements ClipboardInputFormat
  • Constructor Details

    • SimpleXmlReader

      public SimpleXmlReader(FigureFactory figureFactory, org.jhotdraw8.base.converter.IdFactory idFactory, @Nullable String namespaceURI)
  • Method Details

    • getIdFactory

      public org.jhotdraw8.base.converter.IdFactory getIdFactory()
    • getLayerFactory

      public Supplier<Layer> getLayerFactory()
    • setLayerFactory

      public void setLayerFactory(Supplier<Layer> layerFactory)
    • read

      public Figure read(InputStream in, @Nullable Drawing drawing, @Nullable URI documentHome, WorkState<Void> workState) throws IOException
      Description copied from interface: InputFormat
      Reads figures from an input stream and adds them to the specified drawing.
      Specified by:
      read in interface InputFormat
      Parameters:
      in - The input stream.
      drawing - If you provide a non-null value, the contents of the file is added to the drawing. Otherwise a new drawing is created.
      documentHome - the URI used to resolve external references from the document
      workState - for progress monitoring and cancelling the operation
      Returns:
      the drawing
      Throws:
      IOException - if an IO error occurs
    • read

      public @Nullable Figure read(Reader in, @Nullable Drawing drawing, @Nullable URI documentHome, WorkState<Void> workState) throws IOException
      Throws:
      IOException
    • read

      public SequencedSet<Figure> read(javafx.scene.input.Clipboard clipboard, DrawingModel model, Drawing drawing, @Nullable Figure parent) throws IOException
      Description copied from interface: ClipboardInputFormat
      Reads a Drawing from the clipboard.
      Specified by:
      read in interface ClipboardInputFormat
      Parameters:
      clipboard - The clipboard.
      model - the drawing model over which updates of the drawing must be performed.
      drawing - The contents of the clipboard is added to this drawing.
      parent - If you provide a non-null value, the contents of the clipboard is added to this parent. Otherwise, the content is added into an unspecified layer.
      Returns:
      the figures that were read from the clipboard
      Throws:
      IOException - if an IO error occurs
    • setFigureFactory

      public void setFigureFactory(FigureFactory figureFactory)
    • setId

      protected void setId(Figure figure, String id)
    • setNamespaceURI

      public void setNamespaceURI(@Nullable String namespaceURI)