Class AbstractSpreadSheetPdfProclet
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.pdfproclet.AbstractPdfProclet
-
- adams.flow.transformer.pdfproclet.AbstractPdfProcletWithFilenameOutput
-
- adams.flow.transformer.pdfproclet.AbstractPdfProcletWithPageBreaks
-
- adams.flow.transformer.pdfproclet.AbstractSpreadSheetPdfProclet
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,PdfProclet,PdfProcletWithAbsolutePosition,PdfProcletWithFilenameOutput,PdfProcletWithOptionalAbsolutePosition,PdfProcletWithPageBreaks,PdfProcletWithVariableFileExtension,Serializable
- Direct Known Subclasses:
ConfusionMatrix,SpreadSheet
public abstract class AbstractSpreadSheetPdfProclet extends AbstractPdfProcletWithPageBreaks implements PdfProcletWithVariableFileExtension, PdfProcletWithOptionalAbsolutePosition
Ancestor for proclets that use spreadsheets.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractSpreadSheetPdfProclet.HorizontalAlignmentThe horizontal alignment for the table
-
Field Summary
Fields Modifier and Type Field Description protected Colorm_BackgroundTableHeaderthe background color for the table header.protected Colorm_ColorGeneralContentthe color for general content.protected Colorm_ColorNumericContentthe color for the numeric content.protected Colorm_ColorTableHeaderthe color for the table header.protected BaseString[]m_Extensionsthe file extensions.protected PdfFontm_FontGeneralContentthe font for general content.protected PdfFontm_FontNumericContentthe font for numeric content.protected PdfFontm_FontTableHeaderthe font for the table header.protected AbstractSpreadSheetPdfProclet.HorizontalAlignmentm_HorizontalAlignmentthe horizontal alignment (if not 100% wide).protected intm_NumDecimalsthe number of decimals for numbers in tables.protected SpreadSheetReaderm_Readerthe reader to use for loading the csv files.protected BaseFloat[]m_RelativeColumnWidthsthe relative column widths (ignored if not provided).protected booleanm_UseAbsolutePositionwhether to use absolute position.protected floatm_WidthPercentagethe percentage of the page width to occupy.protected floatm_Xthe absolute X position.protected floatm_Ythe absolute Y position.-
Fields inherited from class adams.flow.transformer.pdfproclet.AbstractPdfProcletWithPageBreaks
m_NumFilesPerPage, m_PageBreakAfter, m_PageBreakBefore
-
Fields inherited from class adams.flow.transformer.pdfproclet.AbstractPdfProcletWithFilenameOutput
m_AddFilename, m_ColorFilename, m_FontFilename
-
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 AbstractSpreadSheetPdfProclet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringbackgroundTableHeaderTipText()Returns the tip text for this property.booleancanProcess(PDFGenerator generator, Object obj)Whether the processor can handle this particular object.StringcolorGeneralContentTipText()Returns the tip text for this property.StringcolorNumericContentTipText()Returns the tip text for this property.StringcolorTableHeaderTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected abstract booleandoProcess(PDFGenerator generator, SpreadSheet sheet)The actual processing of the document.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.StringfontGeneralContentTipText()Returns the tip text for this property.StringfontNumericContentTipText()Returns the tip text for this property.StringfontTableHeaderTipText()Returns the tip text for this property.ColorgetBackgroundTableHeader()Returns the background color to use for the table header.ColorgetColorGeneralContent()Returns the color to use for general content.ColorgetColorNumericContent()Returns the color to use for numeric content.ColorgetColorTableHeader()Returns the color to use for the table header.BaseString[]getExtensions()Returns the extensions that the processor can process.PdfFontgetFontGeneralContent()Returns the font to use for adding the content.PdfFontgetFontNumericContent()Returns the font to use for adding the content.PdfFontgetFontTableHeader()Returns the font to use for the table header.AbstractSpreadSheetPdfProclet.HorizontalAlignmentgetHorizontalAlignment()Returns how to align the table on the page when not 100% wide.intgetNumDecimals()Returns the number of decimals for numbers in tables.SpreadSheetReadergetReader()Returns the reader for the spreadsheets.BaseFloat[]getRelativeColumnWidths()Returns the relative column widths (0-1), ignored if not provided, uses 1 by default.booleangetUseAbsolutePosition()Returns whether absolute positioning is used (from bottom-left corner).floatgetWidthPercentage()Returns the percentage of the page with to occupy.floatgetX()Returns the absolute X position.floatgetY()Returns the absolute Y position.StringhorizontalAlignmentTipText()Returns the tip text for this property.StringnumDecimalsTipText()Returns the tip text for this property.StringreaderTipText()Returns the tip text for this property.protected float[]relativeColumnsWidths(SpreadSheet sheet)Computes the relative column widths.StringrelativeColumnWidthsTipText()Returns the tip text for this property.voidsetBackgroundTableHeader(Color value)Sets the background color to use for the table header.voidsetColorGeneralContent(Color value)Sets the color to use for general content.voidsetColorNumericContent(Color value)Sets the color to use for numeric content.voidsetColorTableHeader(Color value)Sets the color to use for the table header.voidsetExtensions(BaseString[] value)Sets the extensions that the processor can process.voidsetFontGeneralContent(PdfFont value)Sets the font to use for adding general content.voidsetFontNumericContent(PdfFont value)Sets the font to use for adding general content.voidsetFontTableHeader(PdfFont value)Sets the font to use for the table header.voidsetHorizontalAlignment(AbstractSpreadSheetPdfProclet.HorizontalAlignment value)Sets how to align the table on the page when not 100% wide.voidsetNumDecimals(int value)Sets the number of decimals for numbers in tables.voidsetReader(SpreadSheetReader value)Sets the reader for the spreadsheets.voidsetRelativeColumnWidths(BaseFloat[] value)Sets the relative column widths (0-1), ignored if not provided, uses 1 by default.voidsetUseAbsolutePosition(boolean value)Sets whether to use absolute positioning (from bottom-left corner).voidsetWidthPercentage(float value)Sets the percentage of the page width to occupy.voidsetX(float value)Sets the absolute X position.voidsetY(float value)Sets the absolute Y position.protected com.itextpdf.text.BaseColortoBaseColor(Color color)Converts the color into itextpdf color.StringuseAbsolutePositionTipText()Returns the tip text for this property.StringwidthPercentageTipText()Returns the tip text for this property.StringXTipText()Returns the tip text for this property.StringYTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.transformer.pdfproclet.AbstractPdfProcletWithPageBreaks
getNumFilesPerPage, getPageBreakAfter, getPageBreakBefore, numFilesPerPageTipText, pageBreakAfterTipText, pageBreakBeforeTipText, postProcess, postProcess, preProcess, preProcess, setNumFilesPerPage, setPageBreakAfter, setPageBreakBefore
-
Methods inherited from class adams.flow.transformer.pdfproclet.AbstractPdfProcletWithFilenameOutput
addFilename, addFilenameTipText, colorFilenameTipText, fontFilenameTipText, getAddFilename, getColorFilename, getFontFilename, setAddFilename, setColorFilename, setFontFilename
-
Methods inherited from class adams.flow.transformer.pdfproclet.AbstractPdfProclet
addColumnTextAt, addElement, canProcess, getRegExpFilename, process, process, regExpFilenameTipText, setRegExpFilename
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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
canProcess, getRegExpFilename, process, process, regExpFilenameTipText, setRegExpFilename
-
-
-
-
Field Detail
-
m_FontTableHeader
protected PdfFont m_FontTableHeader
the font for the table header.
-
m_ColorTableHeader
protected Color m_ColorTableHeader
the color for the table header.
-
m_BackgroundTableHeader
protected Color m_BackgroundTableHeader
the background color for the table header.
-
m_FontGeneralContent
protected PdfFont m_FontGeneralContent
the font for general content.
-
m_ColorGeneralContent
protected Color m_ColorGeneralContent
the color for general content.
-
m_FontNumericContent
protected PdfFont m_FontNumericContent
the font for numeric content.
-
m_ColorNumericContent
protected Color m_ColorNumericContent
the color for the numeric content.
-
m_Extensions
protected BaseString[] m_Extensions
the file extensions.
-
m_NumDecimals
protected int m_NumDecimals
the number of decimals for numbers in tables.
-
m_Reader
protected SpreadSheetReader m_Reader
the reader to use for loading the csv files.
-
m_WidthPercentage
protected float m_WidthPercentage
the percentage of the page width to occupy.
-
m_HorizontalAlignment
protected AbstractSpreadSheetPdfProclet.HorizontalAlignment m_HorizontalAlignment
the horizontal alignment (if not 100% wide).
-
m_UseAbsolutePosition
protected boolean m_UseAbsolutePosition
whether to use absolute position.
-
m_X
protected float m_X
the absolute X position.
-
m_Y
protected float m_Y
the absolute Y position.
-
m_RelativeColumnWidths
protected BaseFloat[] m_RelativeColumnWidths
the relative column widths (ignored if not provided).
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractPdfProcletWithPageBreaks
-
setFontTableHeader
public void setFontTableHeader(PdfFont value)
Sets the font to use for the table header.- Parameters:
value- the font
-
getFontTableHeader
public PdfFont getFontTableHeader()
Returns the font to use for the table header.- Returns:
- the font
-
fontTableHeaderTipText
public String fontTableHeaderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColorTableHeader
public void setColorTableHeader(Color value)
Sets the color to use for the table header.- Parameters:
value- the color
-
getColorTableHeader
public Color getColorTableHeader()
Returns the color to use for the table header.- Returns:
- the color
-
colorTableHeaderTipText
public String colorTableHeaderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setBackgroundTableHeader
public void setBackgroundTableHeader(Color value)
Sets the background color to use for the table header.- Parameters:
value- the color
-
getBackgroundTableHeader
public Color getBackgroundTableHeader()
Returns the background color to use for the table header.- Returns:
- the color
-
backgroundTableHeaderTipText
public String backgroundTableHeaderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFontGeneralContent
public void setFontGeneralContent(PdfFont value)
Sets the font to use for adding general content.- Parameters:
value- the font
-
getFontGeneralContent
public PdfFont getFontGeneralContent()
Returns the font to use for adding the content.- Returns:
- the font
-
fontGeneralContentTipText
public String fontGeneralContentTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColorGeneralContent
public void setColorGeneralContent(Color value)
Sets the color to use for general content.- Parameters:
value- the color
-
getColorGeneralContent
public Color getColorGeneralContent()
Returns the color to use for general content.- Returns:
- the color
-
colorGeneralContentTipText
public String colorGeneralContentTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFontNumericContent
public void setFontNumericContent(PdfFont value)
Sets the font to use for adding general content.- Parameters:
value- the font
-
getFontNumericContent
public PdfFont getFontNumericContent()
Returns the font to use for adding the content.- Returns:
- the font
-
fontNumericContentTipText
public String fontNumericContentTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColorNumericContent
public void setColorNumericContent(Color value)
Sets the color to use for numeric content.- Parameters:
value- the color
-
getColorNumericContent
public Color getColorNumericContent()
Returns the color to use for numeric content.- Returns:
- the color
-
colorNumericContentTipText
public String colorNumericContentTipText()
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.
-
setNumDecimals
public void setNumDecimals(int value)
Sets the number of decimals for numbers in tables.- Parameters:
value- the number of decimals
-
getNumDecimals
public int getNumDecimals()
Returns the number of decimals for numbers in tables.- Returns:
- the number of decimals
-
numDecimalsTipText
public String numDecimalsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setReader
public void setReader(SpreadSheetReader value)
Sets the reader for the spreadsheets.- Parameters:
value- the reader
-
getReader
public SpreadSheetReader getReader()
Returns the reader for the spreadsheets.- Returns:
- the reader
-
readerTipText
public String readerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setWidthPercentage
public void setWidthPercentage(float value)
Sets the percentage of the page width to occupy.- Parameters:
value- the percentage
-
getWidthPercentage
public float getWidthPercentage()
Returns the percentage of the page with to occupy.- Returns:
- the percentage
-
widthPercentageTipText
public String widthPercentageTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setHorizontalAlignment
public void setHorizontalAlignment(AbstractSpreadSheetPdfProclet.HorizontalAlignment value)
Sets how to align the table on the page when not 100% wide.- Parameters:
value- the alignment
-
getHorizontalAlignment
public AbstractSpreadSheetPdfProclet.HorizontalAlignment getHorizontalAlignment()
Returns how to align the table on the page when not 100% wide.- Returns:
- the alignment
-
horizontalAlignmentTipText
public String horizontalAlignmentTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUseAbsolutePosition
public void setUseAbsolutePosition(boolean value)
Sets whether to use absolute positioning (from bottom-left corner).- Specified by:
setUseAbsolutePositionin interfacePdfProcletWithOptionalAbsolutePosition- Parameters:
value- true if absolute
-
getUseAbsolutePosition
public boolean getUseAbsolutePosition()
Returns whether absolute positioning is used (from bottom-left corner).- Specified by:
getUseAbsolutePositionin interfacePdfProcletWithOptionalAbsolutePosition- Returns:
- true if absolute
-
useAbsolutePositionTipText
public String useAbsolutePositionTipText()
Returns the tip text for this property.- Specified by:
useAbsolutePositionTipTextin interfacePdfProcletWithOptionalAbsolutePosition- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setX
public void setX(float value)
Sets the absolute X position.- Specified by:
setXin interfacePdfProcletWithAbsolutePosition- Specified by:
setXin interfacePdfProcletWithOptionalAbsolutePosition- Parameters:
value- the X position
-
getX
public float getX()
Returns the absolute X position.- Specified by:
getXin interfacePdfProcletWithAbsolutePosition- Specified by:
getXin interfacePdfProcletWithOptionalAbsolutePosition- Returns:
- the X position
-
XTipText
public String XTipText()
Returns the tip text for this property.- Specified by:
XTipTextin interfacePdfProcletWithAbsolutePosition- Specified by:
XTipTextin interfacePdfProcletWithOptionalAbsolutePosition- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setY
public void setY(float value)
Sets the absolute Y position.- Specified by:
setYin interfacePdfProcletWithAbsolutePosition- Specified by:
setYin interfacePdfProcletWithOptionalAbsolutePosition- Parameters:
value- the Y position
-
getY
public float getY()
Returns the absolute Y position.- Specified by:
getYin interfacePdfProcletWithAbsolutePosition- Specified by:
getYin interfacePdfProcletWithOptionalAbsolutePosition- Returns:
- the Y position
-
YTipText
public String YTipText()
Returns the tip text for this property.- Specified by:
YTipTextin interfacePdfProcletWithAbsolutePosition- Specified by:
YTipTextin interfacePdfProcletWithOptionalAbsolutePosition- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRelativeColumnWidths
public void setRelativeColumnWidths(BaseFloat[] value)
Sets the relative column widths (0-1), ignored if not provided, uses 1 by default.- Parameters:
value- the widths
-
getRelativeColumnWidths
public BaseFloat[] getRelativeColumnWidths()
Returns the relative column widths (0-1), ignored if not provided, uses 1 by default.- Returns:
- the widths
-
relativeColumnWidthsTipText
public String relativeColumnWidthsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
toBaseColor
protected com.itextpdf.text.BaseColor toBaseColor(Color color)
Converts the color into itextpdf color.- Parameters:
color- the color to convert- Returns:
- the converted color
-
relativeColumnsWidths
protected float[] relativeColumnsWidths(SpreadSheet sheet)
Computes the relative column widths.- Parameters:
sheet- the sheet to determine the number of columns from- Returns:
- the widths
-
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
-
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
-
doProcess
protected abstract boolean doProcess(PDFGenerator generator, SpreadSheet sheet) throws Exception
The actual processing of the document.- Parameters:
generator- the contextsheet- the spreadsheet 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
-
-