org.jdesktop.swingx.decorator
Class ResetDTCRColorHighlighter

java.lang.Object
  extended by org.jdesktop.swingx.decorator.AbstractHighlighter
      extended by org.jdesktop.swingx.decorator.ColorHighlighter
          extended by org.jdesktop.swingx.decorator.ResetDTCRColorHighlighter
All Implemented Interfaces:
Highlighter

public class ResetDTCRColorHighlighter
extends ColorHighlighter

This is a hack around DefaultTableCellRenderer color "memory", see Issue #258-swingx.

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


Constructor Summary
ResetDTCRColorHighlighter()
           
 
Method Summary
 java.awt.Component highlight(java.awt.Component renderer, ComponentAdapter adapter)
          applies the memory hack for renderers of type DefaultTableCellRenderer, does nothing for other types.
 
Methods inherited from class org.jdesktop.swingx.decorator.ColorHighlighter
getBackground, getForeground, getSelectedBackground, getSelectedForeground, setBackground, setForeground, setSelectedBackground, setSelectedForeground
 
Methods inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
addChangeListener, getChangeListeners, getHighlightPredicate, removeChangeListener, setHighlightPredicate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResetDTCRColorHighlighter

public ResetDTCRColorHighlighter()
Method Detail

highlight

public java.awt.Component highlight(java.awt.Component renderer,
                                    ComponentAdapter adapter)
applies the memory hack for renderers of type DefaultTableCellRenderer, does nothing for other types.

Specified by:
highlight in interface Highlighter
Overrides:
highlight in class AbstractHighlighter
Parameters:
renderer - the component to highlight
adapter - the renderee's component state.
Returns:
the decorated cell rendering component
See Also:
AbstractHighlighter.canHighlight(Component, ComponentAdapter), AbstractHighlighter.doHighlight(Component, ComponentAdapter), AbstractHighlighter.getHighlightPredicate()