java.lang.Object
org.rrd4j.graph.BufferedImageWorker.Builder
- Enclosing class:
BufferedImageWorker
Builder class for creating BufferedImageWorker instances with configurable parameters. Supports fluent API for setting image properties, writer, and output format.
Use BufferedImageWorker.getBuilder() to create a new builder instance.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RrdGraphDefGraph definition set in the builder.private intImage height set in the builder.private ImageWriteParamImage write parameters selected in the builder.private intImage width set in the builder.private ImageWriterImage writer selected in the builder.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescription(package private) BufferedImageWorkerbuild()Creates the worker from the builder's settings.private ImageWriteParamFinds the write parameters for the image format.setGdef(RrdGraphDef gdef) Sets the graph definition for this worker.setHeight(int height) Sets the height of the image.setImageWriteParam(ImageWriteParam imageWriteParam) Sets the image write parameters for encoding.setWidth(int width) Sets the width of the image.setWriter(ImageWriter writer) Sets the image writer for encoding the image.
Field Details
width
private int widthImage width set in the builder.height
private int heightImage height set in the builder.gdef
Graph definition set in the builder.writer
Image writer selected in the builder.imageWriteParam
Image write parameters selected in the builder.
Constructor Details
Builder
Builder()UseBufferedImageWorker.getBuilder()to obtain an instance.
Method Details
build
BufferedImageWorker build()Creates the worker from the builder's settings.- Returns:
- a new BufferedImageWorker
getImageParams
Finds the write parameters for the image format.- Returns:
- the parameters for the writer in use
setWidth
Sets the width of the image.- Parameters:
width- The width in pixels.- Returns:
- This builder for method chaining.
setHeight
Sets the height of the image.- Parameters:
height- The height in pixels.- Returns:
- This builder for method chaining.
setGdef
Sets the graph definition for this worker.- Parameters:
gdef- The RRD graph definition.- Returns:
- This builder for method chaining.
setWriter
Sets the image writer for encoding the image.- Parameters:
writer- The image writer to use.- Returns:
- This builder for method chaining.
setImageWriteParam
Sets the image write parameters for encoding.- Parameters:
imageWriteParam- The image write parameters.- Returns:
- This builder for method chaining.