Package jline.io.tikz
Class TikZExporter
java.lang.Object
jline.io.tikz.TikZExporter
Exports a queueing network model as a TikZ diagram.
Can generate LaTeX code, compile to PDF, and display the result.
-
Constructor Summary
ConstructorsConstructorDescriptionTikZExporter(Network model) Creates a TikZ exporter with default options.TikZExporter(Network model, TikZOptions options) Creates a TikZ exporter with custom options. -
Method Summary
Modifier and TypeMethodDescriptionvoiddisplay()Displays the network diagram.voidexportEnvironmentToPNG(String filePath, int dpi, String[] stageNames, double[][] transitionRates) Exports a combined network + Markov chain diagram to PNG.voidexportToFile(String filePath) Exports the TikZ code to a file.Compiles the TikZ code to PDF using pdflatex.voidexportToPNG(String filePath) Exports the network diagram to a PNG file with default 150 DPI.voidexportToPNG(String filePath, int dpi) Exports the network diagram to a PNG file.generateEnvironmentTikZ(String[] stageNames, double[][] transitionRates) Generates TikZ code for a combined network + Markov chain diagram.Generates TikZ code for the network.Gets the options used by this exporter.static booleanChecks if pdflatex is available on the system.
-
Constructor Details
-
TikZExporter
Creates a TikZ exporter with default options. -
TikZExporter
Creates a TikZ exporter with custom options.
-
-
Method Details
-
generateTikZ
Generates TikZ code for the network.- Returns:
- Complete LaTeX document with TikZ diagram
-
exportToFile
Exports the TikZ code to a file.- Parameters:
filePath- Path to the output .tex file- Throws:
IOException
-
exportToPNG
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 filedpi- Resolution in dots per inch (default 150)- Throws:
IOException- If file operations failRuntimeException- If conversion fails
-
exportToPNG
Exports the network diagram to a PNG file with default 150 DPI.- Parameters:
filePath- Path to the output .png file- Throws:
IOException
-
exportToPDF
Compiles the TikZ code to PDF using pdflatex.- Returns:
- The generated PDF file
- Throws:
IOException- If file operations failRuntimeException- 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
Gets the options used by this exporter. -
generateEnvironmentTikZ
Generates TikZ code for a combined network + Markov chain diagram. The Markov chain represents the environment states.- Parameters:
stageNames- Names of the environment stagestransitionRates- 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
-