Package adams.gui.core.spreadsheettable
Class ConfusionMatrixCellRenderingCustomizer
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.core.spreadsheettable.AbstractCellRenderingCustomizer
-
- adams.gui.core.spreadsheettable.ConfusionMatrixCellRenderingCustomizer
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,CellRenderingCustomizer
,Serializable
public class ConfusionMatrixCellRenderingCustomizer extends AbstractCellRenderingCustomizer
Uses the specified color to highlight the cells on the diagonal.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ColorGradientGenerator
m_BackgroundColorGenerator
the color provider to use for the background.protected Map<Integer,Color>
m_Colors
the color values (starting at 0).protected Color
m_Highlight
the color to use for highlighting.protected boolean
m_ValueBasedBackground
whether to color background based on value.-
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 ConfusionMatrixCellRenderingCustomizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
backgroundColorGeneratorTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.Color
getBackgroundColor(SpreadSheetTable table, boolean isSelected, boolean hasFocus, int row, int column, Cell cell, Color defColor)
For customizing the background color of a cell.ColorGradientGenerator
getBackgroundColorGenerator()
Returns the color generator for obtaining the colors used for coloring in the background.Font
getFont(SpreadSheetTable table, boolean isSelected, boolean hasFocus, int row, int column, Cell cell, Font defFont)
For customizing the font of a cell.Color
getHighlight()
Returns the color to use as background for the diagonal cells.int
getHorizontalAlignment(SpreadSheetTable table, boolean isSelected, boolean hasFocus, int row, int column, Cell cell, int defAlign)
For customizing the horizontal alignment of a cell.boolean
getValueBasedBackground()
Returns whether to color in backgrounds based on their values.String
globalInfo()
Returns a string describing the object.String
highlightTipText()
Returns the tip text for this property.protected void
initColors()
Initializes the color lookup table.protected void
reset()
Resets the scheme.void
setBackgroundColorGenerator(ColorGradientGenerator value)
Sets the color generator for obtaining the colors used for coloring in the background.void
setHighlight(Color value)
Sets the color to use as background for the diagonal cells.void
setValueBasedBackground(boolean value)
Sets whether to color in backgrounds based on their values.String
valueBasedBackgroundTipText()
Returns the tip text for this property.-
Methods inherited from class adams.gui.core.spreadsheettable.AbstractCellRenderingCustomizer
getForegroundColor, getToolTipText
-
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
-
-
-
-
Field Detail
-
m_Highlight
protected Color m_Highlight
the color to use for highlighting.
-
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 string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
setHighlight
public void setHighlight(Color value)
Sets the color to use as background for the diagonal cells.- Parameters:
value
- the color
-
getHighlight
public Color getHighlight()
Returns the color to use as background for the diagonal cells.- Returns:
- the color
-
highlightTipText
public String highlightTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
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
-
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
-
getFont
public Font getFont(SpreadSheetTable table, boolean isSelected, boolean hasFocus, int row, int column, Cell cell, Font defFont)
For customizing the font of a cell.- Specified by:
getFont
in interfaceCellRenderingCustomizer
- Overrides:
getFont
in classAbstractCellRenderingCustomizer
- Parameters:
table
- the tableisSelected
- whether the cell is selectedhasFocus
- whether the cell is focusedrow
- the current rowcolumn
- the current columncell
- the actual celldefFont
- the default font- Returns:
- the font
-
initColors
protected void initColors()
Initializes the color lookup table.
-
getBackgroundColor
public Color getBackgroundColor(SpreadSheetTable table, boolean isSelected, boolean hasFocus, int row, int column, Cell cell, Color defColor)
For customizing the background color of a cell.- Specified by:
getBackgroundColor
in interfaceCellRenderingCustomizer
- Overrides:
getBackgroundColor
in classAbstractCellRenderingCustomizer
- Parameters:
table
- the tableisSelected
- whether the cell is selectedhasFocus
- whether the cell is focusedrow
- the current rowcolumn
- the current columncell
- the actual celldefColor
- the default color- Returns:
- the color
-
getHorizontalAlignment
public int getHorizontalAlignment(SpreadSheetTable table, boolean isSelected, boolean hasFocus, int row, int column, Cell cell, int defAlign)
For customizing the horizontal alignment of a cell.- Specified by:
getHorizontalAlignment
in interfaceCellRenderingCustomizer
- Overrides:
getHorizontalAlignment
in classAbstractCellRenderingCustomizer
- Parameters:
table
- the tableisSelected
- whether the cell is selectedhasFocus
- whether the cell is focusedrow
- the current rowcolumn
- the current columncell
- the actual celldefAlign
- the default alignment- Returns:
- the alignment
-
-