Package adams.gui.core.spreadsheettable
Class HeatmapCellRenderingCustomizer
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.core.spreadsheettable.AbstractCellRenderingCustomizer
-
- adams.gui.core.spreadsheettable.HeatmapCellRenderingCustomizer
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,CellRenderingCustomizer,Serializable
public class HeatmapCellRenderingCustomizer extends AbstractCellRenderingCustomizer
Determines the min/max of numeric values in the table and colors the background using the specified generator.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ColorGradientGeneratorm_BackgroundColorGeneratorthe color provider to use for the background.protected Map<Integer,Color>m_Colorsthe color values (starting at 0).protected double[]m_LastMinMaxthe last min/max values.protected SpreadSheetm_LastSpreadSheetthe last spreadsheet that was used.-
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 HeatmapCellRenderingCustomizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbackgroundColorGeneratorTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.ColorgetBackgroundColor(SpreadSheetTable table, boolean isSelected, boolean hasFocus, int row, int column, Cell cell, Color defColor)For customizing the background color of a cell.ColorGradientGeneratorgetBackgroundColorGenerator()Returns the color generator for obtaining the colors used for coloring in the background.protected ColorGradientGeneratorgetDefaultBackgroundColorGenerator()Returns the default color generator.StringglobalInfo()Returns a string describing the object.protected voidinitColors()Initializes the color lookup table.voidsetBackgroundColorGenerator(ColorGradientGenerator value)Sets the color generator for obtaining the colors used for coloring in the background.-
Methods inherited from class adams.gui.core.spreadsheettable.AbstractCellRenderingCustomizer
getFont, getForegroundColor, getHorizontalAlignment, getToolTipText
-
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
-
-
-
-
Field Detail
-
m_BackgroundColorGenerator
protected ColorGradientGenerator m_BackgroundColorGenerator
the color provider to use for the background.
-
m_LastSpreadSheet
protected transient SpreadSheet m_LastSpreadSheet
the last spreadsheet that was used.
-
m_LastMinMax
protected transient double[] m_LastMinMax
the last min/max values.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
getDefaultBackgroundColorGenerator
protected ColorGradientGenerator getDefaultBackgroundColorGenerator()
Returns the default 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(SpreadSheetTable table, boolean isSelected, boolean hasFocus, int row, int column, Cell cell, Color defColor)
For customizing the background color of a cell.- Specified by:
getBackgroundColorin interfaceCellRenderingCustomizer- Overrides:
getBackgroundColorin 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
-
-