Class 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 Detail

      • ResetDTCRColorHighlighter

        public ResetDTCRColorHighlighter()
    • Method Detail

      • applyBackground

        protected void applyBackground​(java.awt.Component renderer,
                                       ComponentAdapter adapter)
        Description copied from class: ColorHighlighter
        Applies 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:
        applyBackground in class ColorHighlighter
        Parameters:
        renderer - the cell renderer component that is to be decorated
        adapter - the ComponentAdapter for this decorate operation
      • applyForeground

        protected void applyForeground​(java.awt.Component renderer,
                                       ComponentAdapter adapter)
        Description copied from class: ColorHighlighter
        Applies 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:
        applyForeground in class ColorHighlighter
        Parameters:
        renderer - the cell renderer component that is to be decorated
        adapter - the ComponentAdapter for this decorate operation