Class MetaHeadline
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,PdfProclet,PdfProcletWithPageBreaks,PdfProcletWithVariableFileExtension,Serializable
public class MetaHeadline extends AbstractMetaPdfProclet implements PdfProcletWithPageBreaks, PdfProcletWithVariableFileExtension
Adds a simple headline before applying the base proclet.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-regexp-filename <adams.core.base.BaseRegExp> (property: regExpFilename) The regular expression that the filename must match. default: .*
-proclet <adams.flow.transformer.pdfproclet.PdfProclet> (property: proclet) The base PDF proclet to use. default: adams.flow.transformer.pdfproclet.PlainText
-page-break-before <boolean> (property: pageBreakBefore) If true, then a page-break is added before the content of the file is inserted. default: false
-page-break-after <boolean> (property: pageBreakAfter) If true, then a page-break is added after the content of the file is inserted. default: false
-num-files <int> (property: numFilesPerPage) The number of files to put on a page before adding an automatic page break; use -1 for unlimited. default: -1 minimum: -1
-headline <adams.core.base.BaseText> (property: headline) The headline to add, can be multi-line. default: Fill in headline
-font-headline <adams.core.io.PdfFont> (property: fontHeadline) The font to use for the headline. default: Helvetica-Bold-14
-color-headline <java.awt.Color> (property: colorHeadline) The color to use for the headline. default: #000000
-extension <adams.core.base.BaseString> [-extension ...] (property: extensions) The file extension(s) that the processor will be used for. default: *
-first-page-only <boolean> (property: firstPageOnly) If set to true, then the headline is only added to the first page. default: false
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Colorm_ColorHeadlinethe color for the headline.protected BaseString[]m_Extensionsthe file extensions.protected booleanm_FirstPageOnlywhether to add it only on the first page.protected PdfFontm_FontHeadlinethe font for the headline.protected BaseTextm_Headlinethe headline to add.protected intm_NumFilesPerPagethe number of files per page.protected booleanm_PageBreakAfterwhether to add a page-break after adding the file.protected booleanm_PageBreakBeforewhether to add a page-break before adding the file.-
Fields inherited from class adams.flow.transformer.pdfproclet.AbstractMetaPdfProclet
m_Proclet
-
Fields inherited from class adams.flow.transformer.pdfproclet.AbstractPdfProclet
m_RegExpFilename, MATCH_ALL_EXTENSION
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description MetaHeadline()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanProcess(PDFGenerator generator, File file)Whether the processor can handle this particular file.booleancanProcess(PDFGenerator generator, Object obj)Whether the processor can handle this particular object.StringcolorHeadlineTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected booleandoProcess(PDFGenerator generator, File file)The actual processing of the document.protected booleandoProcess(PDFGenerator generator, Object obj)The actual processing of the document.StringextensionsTipText()Returns the tip text for this property.StringfirstPageOnlyTipText()Returns the tip text for this property.StringfontHeadlineTipText()Returns the tip text for this property.ColorgetColorHeadline()Returns the color to use for the headline.BaseString[]getExtensions()Returns the extensions that the processor can process.booleangetFirstPageOnly()Returns whether to add the headline only on the first page.PdfFontgetFontHeadline()Returns the font to use for the headline.BaseTextgetHeadline()Returns the headline to add.intgetNumFilesPerPage()Returns the number of files to put on a single page.booleangetPageBreakAfter()Returns whether a page break is added after the file is inserted.booleangetPageBreakBefore()Returns whether a page break is added before the file is inserted.StringglobalInfo()Returns a short description of the writer.StringheadlineTipText()Returns the tip text for this property.StringnumFilesPerPageTipText()Returns the tip text for this property.StringpageBreakAfterTipText()Returns the tip text for this property.StringpageBreakBeforeTipText()Returns the tip text for this property.protected booleanpostProcess(PDFGenerator generator, File file)For post-processing the document.protected booleanpostProcess(PDFGenerator generator, Object obj)For post-processing the document.protected booleanpreProcess(PDFGenerator generator, File file)For pre-processing the document.protected booleanpreProcess(PDFGenerator generator, Object obj)For pre-processing the document.voidsetColorHeadline(Color value)Sets the color to use for the headline.voidsetExtensions(BaseString[] value)Sets the extensions that the processor can process.voidsetFirstPageOnly(boolean value)Sets whether to add the headline only on the first page.voidsetFontHeadline(PdfFont value)Sets the font to use for the headline.voidsetHeadline(BaseText value)Sets the headline to add.voidsetNumFilesPerPage(int value)Sets the number of files per page.voidsetPageBreakAfter(boolean value)Whether to add a page break after the file is inserted.voidsetPageBreakBefore(boolean value)Whether to add a page break before the file is inserted.-
Methods inherited from class adams.flow.transformer.pdfproclet.AbstractMetaPdfProclet
getProclet, procletTipText, setProclet
-
Methods inherited from class adams.flow.transformer.pdfproclet.AbstractPdfProclet
addColumnTextAt, addElement, getRegExpFilename, process, process, regExpFilenameTipText, setRegExpFilename
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.flow.transformer.pdfproclet.PdfProclet
getRegExpFilename, process, process, regExpFilenameTipText, setRegExpFilename
-
-
-
-
Field Detail
-
m_PageBreakBefore
protected boolean m_PageBreakBefore
whether to add a page-break before adding the file.
-
m_PageBreakAfter
protected boolean m_PageBreakAfter
whether to add a page-break after adding the file.
-
m_NumFilesPerPage
protected int m_NumFilesPerPage
the number of files per page.
-
m_Headline
protected BaseText m_Headline
the headline to add.
-
m_FontHeadline
protected PdfFont m_FontHeadline
the font for the headline.
-
m_ColorHeadline
protected Color m_ColorHeadline
the color for the headline.
-
m_Extensions
protected BaseString[] m_Extensions
the file extensions.
-
m_FirstPageOnly
protected boolean m_FirstPageOnly
whether to add it only on the first page.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a short description of the writer.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description of the writer
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractMetaPdfProclet
-
setPageBreakBefore
public void setPageBreakBefore(boolean value)
Whether to add a page break before the file is inserted.- Specified by:
setPageBreakBeforein interfacePdfProcletWithPageBreaks- Parameters:
value- if true then a page-break is added before the file is inserted
-
getPageBreakBefore
public boolean getPageBreakBefore()
Returns whether a page break is added before the file is inserted.- Specified by:
getPageBreakBeforein interfacePdfProcletWithPageBreaks- Returns:
- true if a page break is added before the file is inserted
-
pageBreakBeforeTipText
public String pageBreakBeforeTipText()
Returns the tip text for this property.- Specified by:
pageBreakBeforeTipTextin interfacePdfProcletWithPageBreaks- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPageBreakAfter
public void setPageBreakAfter(boolean value)
Whether to add a page break after the file is inserted.- Specified by:
setPageBreakAfterin interfacePdfProcletWithPageBreaks- Parameters:
value- if true then a page-break is added after the file is inserted
-
getPageBreakAfter
public boolean getPageBreakAfter()
Returns whether a page break is added after the file is inserted.- Specified by:
getPageBreakAfterin interfacePdfProcletWithPageBreaks- Returns:
- true if a page break is added after the file is inserted
-
pageBreakAfterTipText
public String pageBreakAfterTipText()
Returns the tip text for this property.- Specified by:
pageBreakAfterTipTextin interfacePdfProcletWithPageBreaks- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumFilesPerPage
public void setNumFilesPerPage(int value)
Sets the number of files per page.- Specified by:
setNumFilesPerPagein interfacePdfProcletWithPageBreaks- Parameters:
value- the number of files
-
getNumFilesPerPage
public int getNumFilesPerPage()
Returns the number of files to put on a single page.- Specified by:
getNumFilesPerPagein interfacePdfProcletWithPageBreaks- Returns:
- the number of files
-
numFilesPerPageTipText
public String numFilesPerPageTipText()
Returns the tip text for this property.- Specified by:
numFilesPerPageTipTextin interfacePdfProcletWithPageBreaks- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setHeadline
public void setHeadline(BaseText value)
Sets the headline to add.- Parameters:
value- the headline
-
getHeadline
public BaseText getHeadline()
Returns the headline to add.- Returns:
- the headline
-
headlineTipText
public String headlineTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFontHeadline
public void setFontHeadline(PdfFont value)
Sets the font to use for the headline.- Parameters:
value- the font
-
getFontHeadline
public PdfFont getFontHeadline()
Returns the font to use for the headline.- Returns:
- the font
-
fontHeadlineTipText
public String fontHeadlineTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColorHeadline
public void setColorHeadline(Color value)
Sets the color to use for the headline.- Parameters:
value- the color
-
getColorHeadline
public Color getColorHeadline()
Returns the color to use for the headline.- Returns:
- the color
-
colorHeadlineTipText
public String colorHeadlineTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getExtensions
public BaseString[] getExtensions()
Returns the extensions that the processor can process.- Specified by:
getExtensionsin interfacePdfProclet- Specified by:
getExtensionsin interfacePdfProcletWithVariableFileExtension- Specified by:
getExtensionsin classAbstractPdfProclet- Returns:
- the extensions (no dot)
-
setExtensions
public void setExtensions(BaseString[] value)
Sets the extensions that the processor can process.- Specified by:
setExtensionsin interfacePdfProcletWithVariableFileExtension- Parameters:
value- the extensions (no dot)
-
extensionsTipText
public String extensionsTipText()
Returns the tip text for this property.- Specified by:
extensionsTipTextin interfacePdfProcletWithVariableFileExtension- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFirstPageOnly
public void setFirstPageOnly(boolean value)
Sets whether to add the headline only on the first page.- Parameters:
value- if true then the headline is only added on the first page
-
getFirstPageOnly
public boolean getFirstPageOnly()
Returns whether to add the headline only on the first page.- Returns:
- true if the headline is only on the first page
-
firstPageOnlyTipText
public String firstPageOnlyTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
canProcess
public boolean canProcess(PDFGenerator generator, File file)
Whether the processor can handle this particular file.- Specified by:
canProcessin interfacePdfProclet- Overrides:
canProcessin classAbstractPdfProclet- Parameters:
generator- the contextfile- the file to check- Returns:
- true if the file can be handled
-
preProcess
protected boolean preProcess(PDFGenerator generator, File file) throws Exception
For pre-processing the document.- Overrides:
preProcessin classAbstractPdfProclet- Parameters:
generator- the contextfile- the file to add- Returns:
- true if successfully added
- Throws:
Exception- if something goes wrong
-
doProcess
protected boolean doProcess(PDFGenerator generator, File file) throws Exception
The actual processing of the document.- Specified by:
doProcessin classAbstractPdfProclet- Parameters:
generator- the contextfile- the file to add- Returns:
- true if successfully added
- Throws:
Exception- if something goes wrong
-
postProcess
protected boolean postProcess(PDFGenerator generator, File file) throws Exception
For post-processing the document.- Overrides:
postProcessin classAbstractPdfProclet- Parameters:
generator- the contextfile- the file to add- Returns:
- true if successfully added
- Throws:
Exception- if something goes wrong
-
canProcess
public boolean canProcess(PDFGenerator generator, Object obj)
Whether the processor can handle this particular object.- Specified by:
canProcessin interfacePdfProclet- Specified by:
canProcessin classAbstractPdfProclet- Parameters:
generator- the contextobj- the object to check- Returns:
- true if the object can be handled
-
preProcess
protected boolean preProcess(PDFGenerator generator, Object obj) throws Exception
For pre-processing the document.- Overrides:
preProcessin classAbstractPdfProclet- Parameters:
generator- the contextobj- the object to add- Returns:
- true if successfully added
- Throws:
Exception- if something goes wrong
-
doProcess
protected boolean doProcess(PDFGenerator generator, Object obj) throws Exception
The actual processing of the document.- Specified by:
doProcessin classAbstractPdfProclet- Parameters:
generator- the contextobj- the object to add- Returns:
- true if successfully added
- Throws:
Exception- if something goes wrong
-
postProcess
protected boolean postProcess(PDFGenerator generator, Object obj) throws Exception
For post-processing the document.- Overrides:
postProcessin classAbstractPdfProclet- Parameters:
generator- the contextobj- the object to add- Returns:
- true if successfully added
- Throws:
Exception- if something goes wrong
-
-