org.eclipse.nebula.widgets.nattable.painter.layer
Class GridLineCellLayerPainter

java.lang.Object
  extended by org.eclipse.nebula.widgets.nattable.painter.layer.CellLayerPainter
      extended by org.eclipse.nebula.widgets.nattable.painter.layer.GridLineCellLayerPainter
All Implemented Interfaces:
ILayerPainter
Direct Known Subclasses:
SelectionLayerPainter

public class GridLineCellLayerPainter
extends CellLayerPainter


Constructor Summary
GridLineCellLayerPainter()
          Create a GridLineCellLayerPainter that renders gray grid lines and uses the default clipping behaviour.
GridLineCellLayerPainter(boolean clipLeft, boolean clipTop)
          Create a GridLineCellLayerPainter that renders gray grid lines and uses the specified clipping behaviour.
GridLineCellLayerPainter(org.eclipse.swt.graphics.Color gridColor)
          Create a GridLineCellLayerPainter that renders grid lines in the specified color and uses the default clipping behaviour.
GridLineCellLayerPainter(org.eclipse.swt.graphics.Color gridColor, boolean clipLeft, boolean clipTop)
          Create a GridLineCellLayerPainter that renders grid lines in the specified color and uses the specified clipping behaviour.
 
Method Summary
 org.eclipse.swt.graphics.Rectangle adjustCellBounds(int columnPosition, int rowPosition, org.eclipse.swt.graphics.Rectangle bounds)
          This method is used to adjust the cell bounds when painting the layer.
protected  void drawGridLines(ILayer natLayer, org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry)
           
 org.eclipse.swt.graphics.Color getGridColor()
           
 void paintLayer(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry)
           
 
Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.layer.CellLayerPainter
getPositionRectangleFromPixelRectangle, getStartXOfColumnPosition, getStartYOfRowPosition, isClipLeft, isClipTop, paintCell
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridLineCellLayerPainter

public GridLineCellLayerPainter(org.eclipse.swt.graphics.Color gridColor)
Create a GridLineCellLayerPainter that renders grid lines in the specified color and uses the default clipping behaviour.

Parameters:
gridColor - The color that should be used to render the grid lines.

GridLineCellLayerPainter

public GridLineCellLayerPainter()
Create a GridLineCellLayerPainter that renders gray grid lines and uses the default clipping behaviour.


GridLineCellLayerPainter

public GridLineCellLayerPainter(org.eclipse.swt.graphics.Color gridColor,
                                boolean clipLeft,
                                boolean clipTop)
Create a GridLineCellLayerPainter that renders grid lines in the specified color and uses the specified clipping behaviour.

Parameters:
gridColor - The color that should be used to render the grid lines.
clipLeft - Configure the rendering behaviour when cells overlap. If set to true the left cell will be clipped, if set to false the right cell will be clipped. The default value is false.
clipTop - Configure the rendering behaviour when cells overlap. If set to true the top cell will be clipped, if set to false the bottom cell will be clipped. The default value is false.

GridLineCellLayerPainter

public GridLineCellLayerPainter(boolean clipLeft,
                                boolean clipTop)
Create a GridLineCellLayerPainter that renders gray grid lines and uses the specified clipping behaviour.

Parameters:
clipLeft - Configure the rendering behaviour when cells overlap. If set to true the left cell will be clipped, if set to false the right cell will be clipped. The default value is false.
clipTop - Configure the rendering behaviour when cells overlap. If set to true the top cell will be clipped, if set to false the bottom cell will be clipped. The default value is false.
Method Detail

getGridColor

public org.eclipse.swt.graphics.Color getGridColor()
Returns:
The local configured color that is used to render the grid lines.

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
Overrides:
paintLayer in class CellLayerPainter
gc - GC used for painting
xOffset - of the layer from the origin of the table
yOffset - of the layer from the origin of the table
rectangle - area the layer can paint in
configRegistry - in use by NatTable. Useful for looking up associated painters.

adjustCellBounds

public org.eclipse.swt.graphics.Rectangle adjustCellBounds(int columnPosition,
                                                           int rowPosition,
                                                           org.eclipse.swt.graphics.Rectangle bounds)
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
Overrides:
adjustCellBounds in class CellLayerPainter

drawGridLines

protected void drawGridLines(ILayer natLayer,
                             org.eclipse.swt.graphics.GC gc,
                             org.eclipse.swt.graphics.Rectangle rectangle,
                             IConfigRegistry configRegistry)


Copyright © 2015. All rights reserved.