Package jline.io.tikz

Class TikZExporter

java.lang.Object
jline.io.tikz.TikZExporter

public class TikZExporter extends Object
Exports a queueing network model as a TikZ diagram. Can generate LaTeX code, compile to PDF, and display the result.
  • Constructor Details

    • TikZExporter

      public TikZExporter(Network model)
      Creates a TikZ exporter with default options.
    • TikZExporter

      public TikZExporter(Network model, TikZOptions options)
      Creates a TikZ exporter with custom options.
  • Method Details

    • generateTikZ

      public String generateTikZ()
      Generates TikZ code for the network.
      Returns:
      Complete LaTeX document with TikZ diagram
    • exportToFile

      public void exportToFile(String filePath) throws IOException
      Exports the TikZ code to a file.
      Parameters:
      filePath - Path to the output .tex file
      Throws:
      IOException
    • exportToPNG

      public void exportToPNG(String filePath, int dpi) throws IOException
      Exports the network diagram to a PNG file. Requires pdflatex and pdftoppm (from poppler-utils) to be installed.
      Parameters:
      filePath - Path to the output .png file
      dpi - Resolution in dots per inch (default 150)
      Throws:
      IOException - If file operations fail
      RuntimeException - If conversion fails
    • exportToPNG

      public void exportToPNG(String filePath) throws IOException
      Exports the network diagram to a PNG file with default 150 DPI.
      Parameters:
      filePath - Path to the output .png file
      Throws:
      IOException
    • exportToPDF

      public File exportToPDF() throws IOException
      Compiles the TikZ code to PDF using pdflatex.
      Returns:
      The generated PDF file
      Throws:
      IOException - If file operations fail
      RuntimeException - If pdflatex fails
    • display

      public void display()
      Displays the network diagram. Compiles to PDF and opens in the system viewer.
    • isPdfLatexAvailable

      public static boolean isPdfLatexAvailable()
      Checks if pdflatex is available on the system.
    • getOptions

      public TikZOptions getOptions()
      Gets the options used by this exporter.
    • generateEnvironmentTikZ

      public String generateEnvironmentTikZ(String[] stageNames, double[][] transitionRates)
      Generates TikZ code for a combined network + Markov chain diagram. The Markov chain represents the environment states.
      Parameters:
      stageNames - Names of the environment stages
      transitionRates - Matrix of transition rates between stages
      Returns:
      TikZ code for the Markov chain placed to the right of the network
    • exportEnvironmentToPNG

      public void exportEnvironmentToPNG(String filePath, int dpi, String[] stageNames, double[][] transitionRates) throws IOException
      Exports a combined network + Markov chain diagram to PNG.
      Throws:
      IOException