Class SpreadSheet
- java.lang.Object
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,PdfProclet,PdfProcletWithAbsolutePosition,PdfProcletWithFilenameOutput,PdfProcletWithOptionalAbsolutePosition,PdfProcletWithPageBreaks,PdfProcletWithVariableFileExtension,Serializable
public class SpreadSheet extends AbstractSpreadSheetPdfProclet
Adds CSV files (or any spreadsheet files that is supported) as table.
-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: .* more: https://docs.oracle.com/javase/tutorial/essential/regex/ https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html
-add-filename <boolean> (property: addFilename) Whether to add the file name before the actual file content as separate paragraph. default: false
-font-filename <adams.core.io.PdfFont> (property: fontFilename) The font to use for printing the file name header. default: Helvetica-Bold-12
-color-filename <java.awt.Color> (property: colorFilename) The color to use for printing the file name header. default: #000000
-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
-font-table-header <adams.core.io.PdfFont> (property: fontTableHeader) The font to use for the table header. default: Helvetica-Bold-12
-color-table-header <java.awt.Color> (property: colorTableHeader) The color to use for the table header. default: #000000
-background-table-header <java.awt.Color> (property: backgroundTableHeader) The background color to use for the table header. default: #c0c0c0
-font-general-content <adams.core.io.PdfFont> (property: fontGeneralContent) The font to use for non-numeric content in the table. default: Helvetica-Normal-12
-color-general-content <java.awt.Color> (property: colorGeneralContent) The color to use for general content. default: #000000
-font-numeric-content <adams.core.io.PdfFont> (property: fontNumericContent) The font to use for numeric content in the table. default: Helvetica-Normal-12
-color-numeric-content <java.awt.Color> (property: colorNumericContent) The color to use for numeric content. default: #000000
-num-decimals <int> (property: numDecimals) The number of decimals for numeric values in the table. default: 1 minimum: 0
-extension <adams.core.base.BaseString> [-extension ...] (property: extensions) The file extension(s) that the processor will be used for. default: csv
-reader <adams.data.io.input.SpreadSheetReader> (property: reader) The reader to use for loading the spreadsheet files. default: adams.data.io.input.CsvSpreadSheetReader -data-row-type adams.data.spreadsheet.DenseDataRow -spreadsheet-type adams.data.spreadsheet.DefaultSpreadSheet
-width-percentage <float> (property: widthPercentage) The percentage of the page width to occupy. default: 100.0 minimum: 0.0 maximum: 100.0
-horizontal-alignment <LEFT|CENTER|RIGHT> (property: horizontalAlignment) How to align the table on the page horizontally when not 100% wide. default: CENTER
-use-absolute-position <boolean> (property: useAbsolutePosition) If enabled, the absolute position is used (from bottom-left corner). default: false
-x <float> (property: X) The absolute X position. default: 0.0 minimum: 0.0
-y <float> (property: Y) The absolute Y position. default: 0.0 minimum: 0.0
-rel-col-width <adams.core.base.BaseFloat> [-rel-col-width ...] (property: relativeColumnWidths) The relative column widths (0-1), ignored if not provided, uses 1 by default. default:
-add-comments <boolean> (property: addComments) If enabled, the spreadsheet comments (if any) get added before the table. default: false
-font-comments <adams.core.io.PdfFont> (property: fontComments) The font to use for the comments. default: Helvetica-Italic-12
-color-comments <java.awt.Color> (property: colorComments) The color to use for the comments. default: #404040
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.flow.transformer.pdfproclet.AbstractSpreadSheetPdfProclet
AbstractSpreadSheetPdfProclet.HorizontalAlignment
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_AddCommentswhether to add the comments.protected Colorm_ColorCommentsthe color for the comments.protected PdfFontm_FontCommentsthe font for the comments.-
Fields inherited from class adams.flow.transformer.pdfproclet.AbstractSpreadSheetPdfProclet
m_BackgroundTableHeader, m_ColorGeneralContent, m_ColorNumericContent, m_ColorTableHeader, m_Extensions, m_FontGeneralContent, m_FontNumericContent, m_FontTableHeader, m_HorizontalAlignment, m_NumDecimals, m_Reader, m_RelativeColumnWidths, m_UseAbsolutePosition, m_WidthPercentage, m_X, m_Y
-
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 SpreadSheet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddCommentsTipText()Returns the tip text for this property.StringcolorCommentsTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected booleandoProcess(PDFGenerator generator, SpreadSheet sheet)The actual processing of the document.StringfontCommentsTipText()Returns the tip text for this property.booleangetAddComments()Returns whether to add the comments.ColorgetColorComments()Returns the color to use for the comments.PdfFontgetFontComments()Returns the font to use for the comments.StringglobalInfo()Returns a short description of the writer.voidsetAddComments(boolean value)Sets whether to add the comments.voidsetColorComments(Color value)Sets the color to use for the comments.voidsetFontComments(PdfFont value)Sets the font to use for the comments.-
Methods inherited from class adams.flow.transformer.pdfproclet.AbstractSpreadSheetPdfProclet
backgroundTableHeaderTipText, canProcess, colorGeneralContentTipText, colorNumericContentTipText, colorTableHeaderTipText, doProcess, doProcess, extensionsTipText, fontGeneralContentTipText, fontNumericContentTipText, fontTableHeaderTipText, getBackgroundTableHeader, getColorGeneralContent, getColorNumericContent, getColorTableHeader, getExtensions, getFontGeneralContent, getFontNumericContent, getFontTableHeader, getHorizontalAlignment, getNumDecimals, getReader, getRelativeColumnWidths, getUseAbsolutePosition, getWidthPercentage, getX, getY, horizontalAlignmentTipText, numDecimalsTipText, readerTipText, relativeColumnsWidths, relativeColumnWidthsTipText, setBackgroundTableHeader, setColorGeneralContent, setColorNumericContent, setColorTableHeader, setExtensions, setFontGeneralContent, setFontNumericContent, setFontTableHeader, setHorizontalAlignment, setNumDecimals, setReader, setRelativeColumnWidths, setUseAbsolutePosition, setWidthPercentage, setX, setY, toBaseColor, useAbsolutePositionTipText, widthPercentageTipText, XTipText, YTipText
-
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, 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
-
-
-
-
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 classAbstractSpreadSheetPdfProclet
-
setAddComments
public void setAddComments(boolean value)
Sets whether to add the comments.- Parameters:
value- true if to add
-
getAddComments
public boolean getAddComments()
Returns whether to add the comments.- Returns:
- true if to add
-
addCommentsTipText
public String addCommentsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFontComments
public void setFontComments(PdfFont value)
Sets the font to use for the comments.- Parameters:
value- the font
-
getFontComments
public PdfFont getFontComments()
Returns the font to use for the comments.- Returns:
- the font
-
fontCommentsTipText
public String fontCommentsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColorComments
public void setColorComments(Color value)
Sets the color to use for the comments.- Parameters:
value- the color
-
getColorComments
public Color getColorComments()
Returns the color to use for the comments.- Returns:
- the color
-
colorCommentsTipText
public String colorCommentsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doProcess
protected boolean doProcess(PDFGenerator generator, SpreadSheet sheet) throws Exception
The actual processing of the document.- Specified by:
doProcessin classAbstractSpreadSheetPdfProclet- Parameters:
generator- the contextsheet- the spreadsheet to add- Returns:
- true if successfully added
- Throws:
Exception- if something goes wrong
-
-