Package atessera.templ
Class GNUPlotTemplate
java.lang.Object
atessera.templ.GNUPlotTemplate
Velocity template for generating GNUPlot chart source.
This class populates the gnuplot.vm template with the plot
commands, producing an executable GNUPlot script. The resulting script
can be compiled with GNUPlot.
Typical usage:
GNUPlotTemplate t = new GNUPlotTemplate(factory);
t.setText(gnuplotCommands);
List<String> gpSource = t.renderToStringList();
- See Also:
-
BaseGNUPlot
-
Constructor Summary
ConstructorsConstructorDescriptionGNUPlotTemplate(EngineFactory engineFactory) Constructs a new GNUPlot template. -
Method Summary
Modifier and TypeMethodDescriptionvoidMerges the context into the template and writes the result to the given writer.Renders the template and returns the result split into lines.Sets the GNUPlot commands.
-
Constructor Details
-
GNUPlotTemplate
Constructs a new GNUPlot template.- Parameters:
engineFactory- the factory for obtaining a Velocity engine; must not benull- Throws:
org.apache.velocity.exception.ResourceNotFoundException- ifgnuplot.vmcannot be loaded
-
-
Method Details
-
setText
Sets the GNUPlot commands.- Parameters:
text- the GNUPlot script lines; may benullor empty- Returns:
- this template (for fluent chaining)
-
render
Merges the context into the template and writes the result to the given writer.- Parameters:
wr- the writer to receive the rendered output; must not benull
-
renderToStringList
Renders the template and returns the result split into lines.- Returns:
- the rendered output as a list of lines (trailing empty lines are preserved)
-