Package jline.io

Class LQN2UML

java.lang.Object
jline.io.LQN2UML

public class LQN2UML extends Object
Converts a LayeredNetwork (LQN) model to a UML sequence diagram.

Default behavior exports to TEX (LaTeX/TikZ). Use options to specify other formats.

Example usage:

 // Export to TEX (default)
 File tex = LQN2UML.export(model);

 // Export to PDF
 LQN2UML.export(model, new LQN2UML.Options().setFormat(Format.PDF).setOutputPath("/tmp/diagram.pdf"));

 // Export to PNG
 LQN2UML.export(model, new LQN2UML.Options().setFormat(Format.PNG).setOutputPath("/tmp/diagram.png"));
 
  • Constructor Details

    • LQN2UML

      public LQN2UML()
  • Method Details

    • export

      public static File export(LayeredNetwork model) throws IOException
      Exports a LayeredNetwork model to a UML sequence diagram (TEX format by default).
      Parameters:
      model - The LayeredNetwork model to convert
      Returns:
      The generated TEX file
      Throws:
      IOException - If export fails
    • export

      public static File export(LayeredNetwork model, LQN2UML.Options options) throws IOException
      Exports a LayeredNetwork model to a UML sequence diagram with custom options.
      Parameters:
      model - The LayeredNetwork model to convert
      options - Export options (format, output path, etc.)
      Returns:
      The generated file (TEX, PDF, or PNG)
      Throws:
      IOException - If export fails
    • toTikZ

      public static String toTikZ(LayeredNetwork model)
      Generates the TikZ/LaTeX source code for the sequence diagram.
      Parameters:
      model - The LayeredNetwork model to convert
      Returns:
      The TikZ source code as a string
    • toTikZ

      public static String toTikZ(LayeredNetwork model, SequenceDiagramOptions diagramOptions)
      Generates the TikZ/LaTeX source code with custom diagram options.
      Parameters:
      model - The LayeredNetwork model to convert
      diagramOptions - Options for the diagram layout
      Returns:
      The TikZ source code as a string
    • view

      public static void view(LayeredNetwork model)
      Displays the sequence diagram in a PDF viewer.
      Parameters:
      model - The LayeredNetwork model to display
    • view

      public static void view(LayeredNetwork model, SequenceDiagramOptions diagramOptions)
      Displays the sequence diagram in a PDF viewer with custom options.
      Parameters:
      model - The LayeredNetwork model to display
      diagramOptions - Options for the diagram layout