Class BackgroundImagePainter
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.BackgroundImagePainter
- All Implemented Interfaces:
ICellPainter
Paints the cell background using an image. Image is repeated to cover the
background. Similar to HTML table painting.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBackgroundImagePainter(ICellPainter interiorPainter, org.eclipse.swt.graphics.Image bgImage) BackgroundImagePainter(ICellPainter interiorPainter, org.eclipse.swt.graphics.Image bgImage, org.eclipse.swt.graphics.Color separatorColor) BackgroundImagePainter(org.eclipse.swt.graphics.Image bgImage) BackgroundImagePainter(org.eclipse.swt.graphics.Image bgImage, org.eclipse.swt.graphics.Color separatorColor) -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.swt.graphics.ImageintgetPreferredHeight(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry) Get the preferred height of the cell when rendered by this painter.intgetPreferredWidth(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry) Get the preferred width of the cell when rendered by this painter.voidpaintCell(ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry) voidsetBackgroundImage(org.eclipse.swt.graphics.Image bgImage) Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
getCellPainterAt, getWrappedPainter, getWrappedPainterBounds, setWrappedPainter
-
Field Details
-
separatorColor
public final org.eclipse.swt.graphics.Color separatorColor
-
-
Constructor Details
-
BackgroundImagePainter
public BackgroundImagePainter(org.eclipse.swt.graphics.Image bgImage) - Parameters:
bgImage- to be used for painting the background- Since:
- 1.4
-
BackgroundImagePainter
- Parameters:
interiorPainter- used for painting the cell contentsbgImage- to be used for painting the background
-
BackgroundImagePainter
public BackgroundImagePainter(org.eclipse.swt.graphics.Image bgImage, org.eclipse.swt.graphics.Color separatorColor) - Parameters:
bgImage- to be used for painting the backgroundseparatorColor- to be used for drawing left and right borders for the cell. Set to null if the borders are not required.- Since:
- 1.4
-
BackgroundImagePainter
public BackgroundImagePainter(ICellPainter interiorPainter, org.eclipse.swt.graphics.Image bgImage, org.eclipse.swt.graphics.Color separatorColor) - Parameters:
interiorPainter- used for painting the cell contentsbgImage- to be used for painting the backgroundseparatorColor- to be used for drawing left and right borders for the cell. Set to null if the borders are not required.
-
-
Method Details
-
getPreferredWidth
public int getPreferredWidth(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry) Description copied from interface:ICellPainterGet the preferred width of the cell when rendered by this painter. Used for auto-resize.- Specified by:
getPreferredWidthin interfaceICellPainter- Overrides:
getPreferredWidthin classCellPainterWrapper- Parameters:
cell- The cell for which the preferred width is requested.gc- The GC that is used for rendering.configRegistry- The IConfigRegistry that contains the configuration used for rendering.- Returns:
- The preferred width of the given cell when rendered by this painter.
-
getPreferredHeight
public int getPreferredHeight(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry) Description copied from interface:ICellPainterGet the preferred height of the cell when rendered by this painter. Used for auto-resize.- Specified by:
getPreferredHeightin interfaceICellPainter- Overrides:
getPreferredHeightin classCellPainterWrapper- Parameters:
cell- The cell for which the preferred height is requested.gc- The GC that is used for rendering.configRegistry- The IConfigRegistry that contains the configuration used for rendering.- Returns:
- The preferred height of the given cell when rendered by this painter.
-
paintCell
public void paintCell(ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry) - Specified by:
paintCellin interfaceICellPainter- Overrides:
paintCellin classCellPainterWrapper
-
getBackgroundImage
public org.eclipse.swt.graphics.Image getBackgroundImage()- Returns:
- The
Imagethat is used to render the background. - Since:
- 1.4
-
setBackgroundImage
public void setBackgroundImage(org.eclipse.swt.graphics.Image bgImage) - Parameters:
bgImage- TheImagethat should be used to render the background.- Since:
- 1.4
-