Class ConfusionMatrix
- 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
-
- adams.flow.transformer.pdfproclet.ConfusionMatrix
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,PdfProclet,PdfProcletWithAbsolutePosition,PdfProcletWithFilenameOutput,PdfProcletWithOptionalAbsolutePosition,PdfProcletWithPageBreaks,PdfProcletWithVariableFileExtension,Serializable
public class ConfusionMatrix 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:
-background-diagonal <java.awt.Color> (property: backgroundDiagonal) The background color to use for the diagonal. default: #c0c0c0
-value-based-background <boolean> (property: valueBasedBackground) If enabled, the background of the cells gets colored in based on their value. default: false
-background-color-generator <adams.gui.visualization.core.ColorGradientGenerator> (property: backgroundColorGenerator) The color generator to use for obtaining the colors for coloring in the backgrounds. default: adams.gui.visualization.core.BiColorGenerator -first-color #ffffff -second-color #ff0000
- 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 ColorGradientGeneratorm_BackgroundColorGeneratorthe color provider to use for the background.protected Colorm_BackgroundDiagonalthe background color for the diagonal.protected Map<Integer,Color>m_Colorsthe color values (starting at 0).protected booleanm_ValueBasedBackgroundwhether to color background based on value.-
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 ConfusionMatrix()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbackgroundColorGeneratorTipText()Returns the tip text for this property.StringbackgroundDiagonalTipText()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.ColorgetBackgroundColor(SpreadSheet sheet, int row, int column)For customizing the background color of a spreadsheet cell.ColorGradientGeneratorgetBackgroundColorGenerator()Returns the color generator for obtaining the colors used for coloring in the background.ColorgetBackgroundDiagonal()Returns the background color to use for the diagonal.protected ColorGradientGeneratorgetDefaultBackgroundColorGenerator()Returns the default background color generator.booleangetValueBasedBackground()Returns whether to color in backgrounds based on their values.StringglobalInfo()Returns a short description of the writer.protected voidinitColors()Initializes the color lookup table.protected voidreset()Resets the scheme.voidsetBackgroundColorGenerator(ColorGradientGenerator value)Sets the color generator for obtaining the colors used for coloring in the background.voidsetBackgroundDiagonal(Color value)Sets the background color to use for the diagonal.voidsetValueBasedBackground(boolean value)Sets whether to color in backgrounds based on their values.protected com.itextpdf.text.BaseColortoBaseColor(Color color)Converts the color into itextpdf color.StringvalueBasedBackgroundTipText()Returns the tip text for this property.-
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, 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, 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_BackgroundDiagonal
protected Color m_BackgroundDiagonal
the background color for the diagonal.
-
m_ValueBasedBackground
protected boolean m_ValueBasedBackground
whether to color background based on value.
-
m_BackgroundColorGenerator
protected ColorGradientGenerator m_BackgroundColorGenerator
the color provider to use for the background.
-
-
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
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classAbstractOptionHandler
-
setBackgroundDiagonal
public void setBackgroundDiagonal(Color value)
Sets the background color to use for the diagonal.- Parameters:
value- the color
-
getBackgroundDiagonal
public Color getBackgroundDiagonal()
Returns the background color to use for the diagonal.- Returns:
- the color
-
backgroundDiagonalTipText
public String backgroundDiagonalTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setValueBasedBackground
public void setValueBasedBackground(boolean value)
Sets whether to color in backgrounds based on their values.- Parameters:
value- true if to color in background
-
getValueBasedBackground
public boolean getValueBasedBackground()
Returns whether to color in backgrounds based on their values.- Returns:
- true if to color in background
-
valueBasedBackgroundTipText
public String valueBasedBackgroundTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
getDefaultBackgroundColorGenerator
protected ColorGradientGenerator getDefaultBackgroundColorGenerator()
Returns the default background color generator.- Returns:
- the generator
-
setBackgroundColorGenerator
public void setBackgroundColorGenerator(ColorGradientGenerator value)
Sets the color generator for obtaining the colors used for coloring in the background.- Parameters:
value- the generator
-
getBackgroundColorGenerator
public ColorGradientGenerator getBackgroundColorGenerator()
Returns the color generator for obtaining the colors used for coloring in the background.- Returns:
- the generator
-
backgroundColorGeneratorTipText
public String backgroundColorGeneratorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
initColors
protected void initColors()
Initializes the color lookup table.
-
getBackgroundColor
public Color getBackgroundColor(SpreadSheet sheet, int row, int column)
For customizing the background color of a spreadsheet cell.- Parameters:
sheet- the spreadsheetrow- the current rowcolumn- the current column- Returns:
- the color
-
toBaseColor
protected com.itextpdf.text.BaseColor toBaseColor(Color color)
Converts the color into itextpdf color.- Overrides:
toBaseColorin classAbstractSpreadSheetPdfProclet- Parameters:
color- the color to convert- Returns:
- the converted color
-
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
-
-