Package adams.gui.core.spreadsheettable
Class NumericRangeCellRenderingCustomizer
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.core.spreadsheettable.AbstractCellRenderingCustomizer
-
- adams.gui.core.spreadsheettable.NumericRangeCellRenderingCustomizer
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,CellRenderingCustomizer
,Serializable
public class NumericRangeCellRenderingCustomizer extends AbstractCellRenderingCustomizer
Uses the defined ranges to determine whether a numeric cells gets highlighted with the specified color.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SpreadSheetColumnRange
m_Columns
the columns to work on.protected Color
m_Highlight
the color to use for highlighting.protected BaseInterval[]
m_Ranges
the intervals.-
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 NumericRangeCellRenderingCustomizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
columnsTipText()
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.SpreadSheetColumnRange
getColumns()
Returns the range of columns to apply the renderer to.Color
getHighlight()
Returns the color to use as background for the matching cells.BaseInterval[]
getRanges()
Returns the intervals.String
globalInfo()
Returns a string describing the object.String
highlightTipText()
Returns the tip text for this property.String
rangesTipText()
Returns the tip text for this property.void
setColumns(SpreadSheetColumnRange value)
Sets the range of columns to apply the renderer to.void
setHighlight(Color value)
Sets the color to use as background for the matching cells.void
setRanges(BaseInterval[] value)
Sets the intervals.-
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_Columns
protected SpreadSheetColumnRange m_Columns
the columns to work on.
-
m_Ranges
protected BaseInterval[] m_Ranges
the intervals.
-
m_Highlight
protected Color m_Highlight
the color to use for highlighting.
-
-
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
-
setColumns
public void setColumns(SpreadSheetColumnRange value)
Sets the range of columns to apply the renderer to.- Parameters:
value
- the range
-
getColumns
public SpreadSheetColumnRange getColumns()
Returns the range of columns to apply the renderer to.- Returns:
- the range
-
columnsTipText
public String columnsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setRanges
public void setRanges(BaseInterval[] value)
Sets the intervals.- Parameters:
value
- the intervals
-
getRanges
public BaseInterval[] getRanges()
Returns the intervals.- Returns:
- the intervals
-
rangesTipText
public String rangesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setHighlight
public void setHighlight(Color value)
Sets the color to use as background for the matching cells.- Parameters:
value
- the color
-
getHighlight
public Color getHighlight()
Returns the color to use as background for the matching 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
-
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
-
-