Class NatLayerPainter

java.lang.Object
org.eclipse.nebula.widgets.nattable.painter.layer.NatLayerPainter
All Implemented Interfaces:
ILayerPainter
Direct Known Subclasses:
NatGridLayerPainter

public class NatLayerPainter extends Object implements ILayerPainter
ILayerPainter implementation that is rendering the background of the space that is available for the NatTable instance. It uses the Color that is configured via Control.setBackground(org.eclipse.swt.graphics.Color) . It then calls the ILayerPainter of the underlying layers in the layer stack and calls all registered IOverlayPainter at the end, to render the overlays correctly.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final NatTable
    The NatTable instance to paint on.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.eclipse.swt.graphics.Rectangle
    adjustCellBounds(int columnPosition, int rowPosition, org.eclipse.swt.graphics.Rectangle cellBounds)
    This method is used to adjust the cell bounds when painting the layer.
    protected void
    paintBackground(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry)
     
    void
    paintLayer(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry)
     
    protected void
    paintOverlays(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • natTable

      protected final NatTable natTable
      The NatTable instance to paint on.
      Since:
      2.0
  • Constructor Details

    • NatLayerPainter

      public NatLayerPainter(NatTable natTable)
  • Method Details

    • paintLayer

      public void paintLayer(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry)
      Specified by:
      paintLayer in interface ILayerPainter
      Parameters:
      natLayer - The layer to paint.
      gc - GC used for painting
      xOffset - x offset of the layer from the origin of the table
      yOffset - y offset of the layer from the origin of the table
      rectangle - area the layer can paint in
      configRegistry - IConfigRegistry in use by NatTable. Useful for looking up associated painters.
    • paintBackground

      protected void paintBackground(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry)
    • paintOverlays

      protected void paintOverlays(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry)
    • adjustCellBounds

      public org.eclipse.swt.graphics.Rectangle adjustCellBounds(int columnPosition, int rowPosition, org.eclipse.swt.graphics.Rectangle cellBounds)
      Description copied from interface: ILayerPainter
      This method is used to adjust the cell bounds when painting the layer. This is most often used to reduce the size of the cell to accommodate grid lines.
      Specified by:
      adjustCellBounds in interface ILayerPainter
      Parameters:
      columnPosition - The column position.
      rowPosition - The row position.
      cellBounds - The actual cell bounds.
      Returns:
      The adjusted cell bounds.