|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdesktop.swingx.decorator.AbstractHighlighter
org.jdesktop.swingx.decorator.ColorHighlighter
org.jdesktop.swingx.decorator.ResetDTCRColorHighlighter
public class ResetDTCRColorHighlighter
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
| Field Summary |
|---|
| Fields inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter |
|---|
listenerList |
| Constructor Summary | |
|---|---|
ResetDTCRColorHighlighter()
|
|
| Method Summary | |
|---|---|
protected void |
applyBackground(java.awt.Component renderer,
ComponentAdapter adapter)
Applies a suitable background for the renderer component within the specified adapter. |
protected void |
applyForeground(java.awt.Component renderer,
ComponentAdapter adapter)
Applies a suitable foreground for the renderer component within the specified adapter. |
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 |
|---|
doHighlight, getBackground, getForeground, getSelectedBackground, getSelectedForeground, isLegacy, setBackground, setForeground, setLegacy, setSelectedBackground, setSelectedForeground |
| Methods inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter |
|---|
addChangeListener, areEqual, canHighlight, fireStateChanged, getChangeListeners, getHighlightPredicate, removeChangeListener, setHighlightPredicate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResetDTCRColorHighlighter()
| Method Detail |
|---|
public java.awt.Component highlight(java.awt.Component renderer,
ComponentAdapter adapter)
highlight in interface Highlighterhighlight in class AbstractHighlighterrenderer - the component to highlightadapter - the renderee's component state.
AbstractHighlighter.canHighlight(Component, ComponentAdapter),
AbstractHighlighter.doHighlight(Component, ComponentAdapter),
AbstractHighlighter.getHighlightPredicate()
protected void applyBackground(java.awt.Component renderer,
ComponentAdapter adapter)
ColorHighlighterThis implementation applies its background or selectedBackground color (depending on the adapter's selected state) if != null. Otherwise it does nothing.
applyBackground in class ColorHighlighterrenderer - the cell renderer component that is to be decoratedadapter - the ComponentAdapter for this decorate operation
protected void applyForeground(java.awt.Component renderer,
ComponentAdapter adapter)
ColorHighlighterThis implementation applies its foreground or selectedfForeground color (depending on the adapter's selected state) if != null. Otherwise it does nothing.
applyForeground in class ColorHighlighterrenderer - the cell renderer component that is to be decoratedadapter - the ComponentAdapter for this decorate operation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||