Package com.inet.pdfc.presenter
Class DifferencesPNGPresenter
- java.lang.Object
-
- com.inet.pdfc.presenter.BasePresenter
-
- com.inet.pdfc.presenter.ExportPresenter
-
- com.inet.pdfc.presenter.ExportFilePresenter
-
- com.inet.pdfc.presenter.DifferencesPNGPresenter
-
- All Implemented Interfaces:
NamedExtension
,java.lang.Cloneable
public class DifferencesPNGPresenter extends ExportFilePresenter
This presenter generates images for a complete graphical representation of the comparison. Generates one images or if multiple files must be generated a zip file containing the images. The visual representation is similar to the one of the i-net PDFC GUI.
NOTE: In case you want to redirect the output to a non-file destination, please overwrite theExportFilePresenter.getExportStream()
method.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.inet.pdfc.presenter.ExportFilePresenter
ExportFilePresenter.HasPrintRange
-
Nested classes/interfaces inherited from class com.inet.pdfc.presenter.BasePresenter
BasePresenter.ERROR_SOURCE
-
-
Field Summary
-
Fields inherited from class com.inet.pdfc.presenter.ExportPresenter
PAINT_BOTH, PAINT_LEFT, PAINT_RIGHT
-
Fields inherited from class com.inet.pdfc.presenter.BasePresenter
LOGGER, MAX_FILENAME_LENGTH
-
-
Constructor Summary
Constructors Constructor Description DifferencesPNGPresenter(java.io.File rootFolder)
Creates the presenterDifferencesPNGPresenter(java.io.File target, boolean isFolder)
Creates the presenter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
getExtension()
Get the extension of the target filejava.lang.String
getExtensionName()
Returns the UNIQUE name of the extension.void
onComparisonDone()
Creates the actual result PDF Called to indicate that a comparison has finished.void
setSize(int width, int height)
Set the size of each image created.BasePresenter
spawn(boolean spawnWithParent)
Creates another presenter of the the same type as the current one.-
Methods inherited from class com.inet.pdfc.presenter.ExportFilePresenter
applyPrintRange, configure, getExportStream, setExportOnlyOnDifferences, setModel, setPrintRange
-
Methods inherited from class com.inet.pdfc.presenter.ExportPresenter
createAndSetupPrintPainter, setAddHeaderFooter, setBackgroundColor, setColorprovider, setOverlapAlpha, setPaintOverlap, setPaintSides, setScaleToFitPageHeight
-
Methods inherited from class com.inet.pdfc.presenter.BasePresenter
canInformUserOnErrors, createExportFilename, detachFromModel, executeImmediately, getDefaultExportName, getLastPresenterException, getModel, getParent, getPresenterExceptions, onClear, onDataUpdate, onError, onFilterChange, onFinish, onInit, onProgressUpdate, setParent
-
-
-
-
Constructor Detail
-
DifferencesPNGPresenter
public DifferencesPNGPresenter(java.io.File rootFolder)
Creates the presenter- Parameters:
rootFolder
- the folder to store the comparison results to.- Since:
- i-net PDFC 3.0
-
DifferencesPNGPresenter
public DifferencesPNGPresenter(java.io.File target, boolean isFolder)
Creates the presenter- Parameters:
target
- the folder or file to store the comparison results to.isFolder
- if the target is a folder or a file- Since:
- i-net PDFC 4.3
-
-
Method Detail
-
getExtensionName
public java.lang.String getExtensionName()
Returns the UNIQUE name of the extension. With UNIQUE referring to 'unique among all implementations of the same interface'- Returns:
- the UNIQUE name of the extension
-
onComparisonDone
public void onComparisonDone() throws java.lang.Exception
Creates the actual result PDF Called to indicate that a comparison has finished. This does not imply that any page data or differences are available.- Specified by:
onComparisonDone
in classBasePresenter
- Throws:
java.lang.Exception
- thrown in case the processing of the finish step fails
-
getExtension
protected java.lang.String getExtension()
Get the extension of the target file- Specified by:
getExtension
in classExportFilePresenter
- Returns:
- the file extension like .pdf or .png
-
setSize
public void setSize(int width, int height)
Set the size of each image created.Default value is 1000x1000 px.
- Parameters:
width
- the width of one image in px.height
- the height of one image in px.- Since:
- i-net PDFC 3.0
-
spawn
public BasePresenter spawn(boolean spawnWithParent)
Creates another presenter of the the same type as the current one. The spawned presenter may either have the same settings as the current one or it may be a child of the current one.- Overrides:
spawn
in classBasePresenter
- Parameters:
spawnWithParent
- if true, the presenter is allowed to keep a reference to it's parent to create a summary on onFinish()- Returns:
- a new presenter for the same batch comparison run as the current one
-
-