Class ResetDTCRColorHighlighter
- All Implemented Interfaces:
Highlighter
The issue is that the default has internal color management which is different from other types of renderers. The consequence of the internal color handling is that there's a color memory which must be reset somehow. The "old" hack around reset the xxColors of all types of renderers to the adapter's target XXColors, introducing #178-swingx (Highlighgters must not change any colors except those for which their color properties are explicitly set).
This hack limits the interference to renderers of type DefaultTableCellRenderer, applying a hacking highlighter which resets the renderers XXColors to a previously "memorized" color. Note that setting the color to null didn't have the desired effect.
PENDING: extend ColorHighlighter
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class AbstractHighlighter
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyBackground(Component renderer, ComponentAdapter adapter) Applies a suitable background for the renderer component within the specified adapter.protected voidapplyForeground(Component renderer, ComponentAdapter adapter) Applies a suitable foreground for the renderer component within the specified adapter.highlight(Component renderer, ComponentAdapter adapter) applies the memory hack for renderers of type DefaultTableCellRenderer, does nothing for other types.Methods inherited from class ColorHighlighter
doHighlight, getBackground, getForeground, getSelectedBackground, getSelectedForeground, setBackground, setForeground, setSelectedBackground, setSelectedForegroundMethods inherited from class AbstractHighlighter
addChangeListener, areEqual, canHighlight, fireStateChanged, getChangeListeners, getHighlightPredicate, removeChangeListener, setHighlightPredicate
-
Constructor Details
-
ResetDTCRColorHighlighter
public ResetDTCRColorHighlighter()
-
-
Method Details
-
highlight
applies the memory hack for renderers of type DefaultTableCellRenderer, does nothing for other types.- Specified by:
highlightin interfaceHighlighter- Overrides:
highlightin classAbstractHighlighter- Parameters:
renderer- the component to highlightadapter- the renderee's component state.- Returns:
- the decorated cell rendering component
- See Also:
-
applyBackground
Description copied from class:ColorHighlighterApplies a suitable background for the renderer component within the specified adapter.This implementation applies its background or selectedBackground color (depending on the adapter's selected state) if != null. Otherwise it does nothing.
- Overrides:
applyBackgroundin classColorHighlighter- Parameters:
renderer- the cell renderer component that is to be decoratedadapter- the ComponentAdapter for this decorate operation
-
applyForeground
Description copied from class:ColorHighlighterApplies a suitable foreground for the renderer component within the specified adapter.This implementation applies its foreground or selectedfForeground color (depending on the adapter's selected state) if != null. Otherwise it does nothing.
- Overrides:
applyForegroundin classColorHighlighter- Parameters:
renderer- the cell renderer component that is to be decoratedadapter- the ComponentAdapter for this decorate operation
-