Class BlendedBackgroundPainter

All Implemented Interfaces:
ICellPainter

public class BlendedBackgroundPainter extends TextPainter

A cell painter that can blend multiple background colours together when more than one has been registered for a given cell.

For example, if using the alternating row colour style, when multiple rows are selected, with a normal painter, a single selection colour is applied to all the selected cell's backgrounds.

With this painter, the selection background colour blends with the alternating colour rather than just replacing it leaving two alternating selection colours.

Author:
Stefan Bolton
  • Constructor Details

    • BlendedBackgroundPainter

      public BlendedBackgroundPainter(org.eclipse.swt.graphics.RGB gridBackgroundColour)
  • Method Details

    • getBackgroundColour

      protected org.eclipse.swt.graphics.Color getBackgroundColour(ILayerCell cell, IConfigRegistry configRegistry)
      Description copied from class: BackgroundPainter
      Get the background color for the given cell.
      Overrides:
      getBackgroundColour in class BackgroundPainter
      Parameters:
      cell - The ILayerCell to get the background color for.
      configRegistry - The ConfigRegistry needed to retrieve the color.
      Returns:
      The background color.
    • blendBackgroundColour

      public static org.eclipse.swt.graphics.Color blendBackgroundColour(ILayerCell cell, IConfigRegistry configRegistry, org.eclipse.swt.graphics.RGB baseColor)
      Returns a background colour for the specified cell. If multiple colours have been registered, they are all blended together.
      Parameters:
      cell - the LayerCell to get a background colour for.
      configRegistry - an IConfigRegistry .
      baseColor - Colours are not blended with this colour.
      Returns:
      A blended background colour.