Class BlendedBackgroundPainter
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.painter.cell.AbstractCellPainter
-
- org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
-
- org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundPainter
-
- org.eclipse.nebula.widgets.nattable.painter.cell.AbstractTextPainter
-
- org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter
-
- org.eclipse.nebula.widgets.nattable.painter.cell.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
-
-
Field Summary
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.AbstractTextPainter
calculateByTextHeight, calculateByTextLength, DOT, EMPTY, LINE_SEPARATOR, lineSpacing, NEW_LINE_REGEX, paintBg, paintFg, spacing, wordWrapping, wrapText
-
-
Constructor Summary
Constructors Constructor Description BlendedBackgroundPainter(org.eclipse.swt.graphics.RGB gridBackgroundColour)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected org.eclipse.swt.graphics.Color
getBackgroundColour(ILayerCell cell, IConfigRegistry configRegistry)
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter
calculatePadding, getPreferredHeight, getPreferredWidth, isCalculateWrappedHeight, paintCell, performRowResize, setCalculateWrappedHeight, setNewMinLength
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.AbstractTextPainter
convertDataType, getLengthFromCache, getLineSpacing, getNumberOfNewLines, getTextToDisplay, isCalculateByTextHeight, isCalculateByTextLength, isTrimText, isWordWrapping, isWrapText, paintDecoration, renderStrikethrough, renderUnderlined, resetGC, setCalculateByTextHeight, setCalculateByTextLength, setLineSpacing, setStrikethrough, setTrimText, setUnderline, setupGCFromConfig, setWordWrapping, setWrapText
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
getCellPainterAt, getWrappedPainter, getWrappedPainterBounds, setWrappedPainter
-
-
-
-
Method Detail
-
getBackgroundColour
protected org.eclipse.swt.graphics.Color getBackgroundColour(ILayerCell cell, IConfigRegistry configRegistry)
- Overrides:
getBackgroundColour
in classBackgroundPainter
-
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
- theLayerCell
to get a background colour for.configRegistry
- anIConfigRegistry
.baseColor
- Colours are not blended with this colour.- Returns:
- A blended background colour.
-
-