# DataTableBackgroundImagePainter (ARX GUI Documentation)

org.deidentifier.arx.gui.view.impl.common.datatable

## Class DataTableBackgroundImagePainter

- java.lang.Object
- - org.eclipse.nebula.widgets.nattable.painter.cell.AbstractCellPainter
  - - org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
    - - org.deidentifier.arx.gui.view.impl.common.datatable.DataTableBackgroundImagePainter

- All Implemented Interfaces:
    org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter

      public class DataTableBackgroundImagePainter
      extends org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper

  Paints the cell background using an image. Image is repeated to cover the background. Similar to HTML table painting.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `org.eclipse.swt.graphics.Color` | `separatorColor` Color

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataTableBackgroundImagePainter(org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter interiorPainter, org.eclipse.swt.graphics.Image bgImage)`
    `DataTableBackgroundImagePainter(org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter interiorPainter, org.eclipse.swt.graphics.Image bgImage, org.eclipse.swt.graphics.Color separatorColor)`
    `DataTableBackgroundImagePainter(org.eclipse.swt.graphics.Image bgImage)`
    `DataTableBackgroundImagePainter(org.eclipse.swt.graphics.Image bgImage, org.eclipse.swt.graphics.Color separatorColor)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getPreferredHeight(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.nebula.widgets.nattable.config.IConfigRegistry configRegistry)`
    `int` | `getPreferredWidth(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.nebula.widgets.nattable.config.IConfigRegistry configRegistry)`
    `void` | `paintCell(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle, org.eclipse.nebula.widgets.nattable.config.IConfigRegistry configRegistry)`

    - ### Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper

      `getCellPainterAt, getWrappedPainter, getWrappedPainterBounds, setWrappedPainter`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### separatorColor

          public final org.eclipse.swt.graphics.Color separatorColor

      Color

  - ### Constructor Detail

    - #### DataTableBackgroundImagePainter

          public DataTableBackgroundImagePainter(org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter interiorPainter,
                                         org.eclipse.swt.graphics.Image bgImage)

      Parameters:
        `interiorPainter` - used for painting the cell contents
        `bgImage` - to be used for painting the background

    - #### DataTableBackgroundImagePainter

          public DataTableBackgroundImagePainter(org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter interiorPainter,
                                         org.eclipse.swt.graphics.Image bgImage,
                                         org.eclipse.swt.graphics.Color separatorColor)

      Parameters:
        `interiorPainter` - used for painting the cell contents
        `bgImage` - to be used for painting the background
        `separatorColor` - to be used for drawing left and right borders for the cell. Set to null if the borders are not required.

    - #### DataTableBackgroundImagePainter

          public DataTableBackgroundImagePainter(org.eclipse.swt.graphics.Image bgImage)

      Parameters:
        `bgImage` - to be used for painting the background
      Since:
        1.4

    - #### DataTableBackgroundImagePainter

          public DataTableBackgroundImagePainter(org.eclipse.swt.graphics.Image bgImage,
                                         org.eclipse.swt.graphics.Color separatorColor)

      Parameters:
        `bgImage` - to be used for painting the background
        `separatorColor` - to be used for drawing left and right borders for the cell. Set to null if the borders are not required.
      Since:
        1.4

  - ### Method Detail

    - #### getPreferredHeight

          public int getPreferredHeight(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell cell,
                               org.eclipse.swt.graphics.GC gc,
                               org.eclipse.nebula.widgets.nattable.config.IConfigRegistry configRegistry)

      Specified by:
        `getPreferredHeight` in interface `org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter`
      Overrides:
        `getPreferredHeight` in class `org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper`

    - #### getPreferredWidth

          public int getPreferredWidth(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell cell,
                              org.eclipse.swt.graphics.GC gc,
                              org.eclipse.nebula.widgets.nattable.config.IConfigRegistry configRegistry)

      Specified by:
        `getPreferredWidth` in interface `org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter`
      Overrides:
        `getPreferredWidth` in class `org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper`

    - #### paintCell

          public void paintCell(org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell cell,
                       org.eclipse.swt.graphics.GC gc,
                       org.eclipse.swt.graphics.Rectangle rectangle,
                       org.eclipse.nebula.widgets.nattable.config.IConfigRegistry configRegistry)

      Specified by:
        `paintCell` in interface `org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter`
      Overrides:
        `paintCell` in class `org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper`