Class ExportPresenter
- java.lang.Object
-
- com.inet.pdfc.presenter.BasePresenter
-
- com.inet.pdfc.presenter.ExportPresenter
-
- All Implemented Interfaces:
NamedExtension
,java.lang.Cloneable
- Direct Known Subclasses:
DifferencesPrintPresenter
,ExportFilePresenter
public abstract class ExportPresenter extends BasePresenter implements java.lang.Cloneable
Basic presenter for Exports which generates a graphical comparison result.
Contains some useful methods allowing some settings to be made and applied to the PrintPainter.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.inet.pdfc.presenter.BasePresenter
BasePresenter.ERROR_SOURCE
-
-
Field Summary
Fields Modifier and Type Field Description static byte
PAINT_BOTH
Toggle between Left/Right/Both Both document will be presentedstatic byte
PAINT_LEFT
Toggle between Left/Right/Both Left mean the first documentstatic byte
PAINT_RIGHT
Toggle between Left/Right/Both Right mean the second document-
Fields inherited from class com.inet.pdfc.presenter.BasePresenter
LOGGER, MAX_FILENAME_LENGTH
-
-
Constructor Summary
Constructors Constructor Description ExportPresenter()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected com.inet.pdfc.print.PrintPainter
createAndSetupPrintPainter()
Constructs a newPrintPainter
which can be used to export the result.
This method also sets options on thePrintPainter
.void
setAddHeaderFooter(boolean addHeaderFooter)
Deprecated.As of i-net PDFC 4.1, usePDFComparer.setSettings(Settings)
instead (Settings.setEnabled(boolean, VisibilitySetting...)
void
setBackgroundColor(java.awt.Color backgroundColor)
Set the background color of the print.void
setColorprovider(ColorProvider colorProvider)
Deprecated.As of i-net PDFC 4.1, usePDFComparer.setSettings(Settings)
instead (Settings.setColor(Color, ColorSetting)
)void
setOverlapAlpha(float overlapAlpha)
Set the alpha to use for overlapping export.void
setPaintOverlap(boolean paintOverlap)
Set to true if the compared documents must be exported in overlapping mode.void
setPaintSides(byte sides)
Set weather the first or the second of both compared documents must be painted.void
setScaleToFitPageHeight(boolean flag)
Deprecated.As of i-net PDFC 4.1, usePDFComparer.setSettings(Settings)
-
Methods inherited from class com.inet.pdfc.presenter.BasePresenter
canInformUserOnErrors, configure, createExportFilename, detachFromModel, executeImmediately, getDefaultExportName, getLastPresenterException, getModel, getParent, getPresenterExceptions, onClear, onComparisonDone, onDataUpdate, onError, onFilterChange, onFinish, onInit, onProgressUpdate, setModel, setParent, spawn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inet.plugin.NamedExtension
getExtensionName
-
-
-
-
Field Detail
-
PAINT_LEFT
public static final byte PAINT_LEFT
Toggle between Left/Right/Both Left mean the first document- See Also:
- Constant Field Values
-
PAINT_RIGHT
public static final byte PAINT_RIGHT
Toggle between Left/Right/Both Right mean the second document- See Also:
- Constant Field Values
-
PAINT_BOTH
public static final byte PAINT_BOTH
Toggle between Left/Right/Both Both document will be presented- See Also:
- Constant Field Values
-
-
Method Detail
-
createAndSetupPrintPainter
protected com.inet.pdfc.print.PrintPainter createAndSetupPrintPainter()
Constructs a newPrintPainter
which can be used to export the result.
This method also sets options on thePrintPainter
.This method is called once for each pair of PDFs for that a graphical result is exported for.
- Returns:
- the new constructed PrintPainter.
- Since:
- i-net PDFC 3.0
-
setColorprovider
@Deprecated public void setColorprovider(ColorProvider colorProvider)
Deprecated.As of i-net PDFC 4.1, usePDFComparer.setSettings(Settings)
instead (Settings.setColor(Color, ColorSetting)
)Set theColorProvider
used to paint the exported document.To define a custom color theme, override ColorProvider#getMarkerColor(GroupType) and ColorProvider#getOutlineColor(GroupType)
- Parameters:
colorProvider
- the ColorProvider used for the export- Since:
- i-net PDFC 3.2
-
setAddHeaderFooter
@Deprecated public void setAddHeaderFooter(boolean addHeaderFooter)
Deprecated.As of i-net PDFC 4.1, usePDFComparer.setSettings(Settings)
instead (Settings.setEnabled(boolean, VisibilitySetting...)
Set whether header and footer should be added to the document.
This includes date, compared document names and page-number.Default is: true.
- Parameters:
addHeaderFooter
- true to add header and footer, otherwise false.- Since:
- i-net PDFC 3.0
-
setScaleToFitPageHeight
@Deprecated public void setScaleToFitPageHeight(boolean flag)
Deprecated.As of i-net PDFC 4.1, usePDFComparer.setSettings(Settings)
Set that the Painter must scale the data to make the upper first page of both documents to fit on one (the first) exported page. This is useful if both documents have few and small differences and a landscape page layout is used or only one side (LEFT or RIGHT) is printed.
If
If this is false, the Painter will scale the document to take the full width of the page.setPaintSides(byte)
isPAINT_LEFT
orPAINT_RIGHT
andSettings.setEnabled(boolean, VisibilitySetting...)
with Settings.EXPORT#SCALETOPAGEHEIGHT is true, one exported page will always contain exactly one page of the original document. To export a document which looks like the original document plus differences highlighted you must additionally setsetAddHeaderFooter(boolean)
to false and make sure the page layout of the export corresponds to the layout of the original document.Default is: false.
- Parameters:
flag
- true to scale to make both pages of both documents to fit on one page, otherwise the default scale-to-width behavior is used.- Since:
- i-net PDFC 3.0
-
setBackgroundColor
public void setBackgroundColor(java.awt.Color backgroundColor)
Set the background color of the print. This color is used for the areas where to page is, between the pages. Set to null to skip painting a background.default is White for PDF and null for PNG or Print.
- Parameters:
backgroundColor
- the background color of the PrintPainter- Since:
- i-net PDFC 3.0
-
setPaintSides
public void setPaintSides(byte sides)
Set weather the first or the second of both compared documents must be painted.Default is
PAINT_BOTH
This option has no effect if
setPaintOverlap(boolean)
is set to true.- Parameters:
sides
- document sides to paint, can bePAINT_LEFT
,PAINT_RIGHT
orPAINT_BOTH
- Since:
- i-net PDFC 3.0
-
setPaintOverlap
public void setPaintOverlap(boolean paintOverlap)
Set to true if the compared documents must be exported in overlapping mode.Default is false.
If this is true, the option
setPaintSides(byte)
has no effect.- Parameters:
paintOverlap
- the paintOverlap of the PrintPainter- Since:
- i-net PDFC 3.0
-
setOverlapAlpha
public void setOverlapAlpha(float overlapAlpha)
Set the alpha to use for overlapping export. Has only an effect ifsetPaintOverlap(boolean)
is true. Must be between 0.0 and 1.0, where 0 means the right document completely overwrites the left document and 1 means the left document overwrites the right document.Default is 0.5.
- Parameters:
overlapAlpha
- the overlapAlpha of the PrintPainter- Throws:
java.lang.IllegalArgumentException
- if overlapAlpha is invalid- Since:
- i-net PDFC 3.0
-
-