Class CopySelectionLayerPainter

All Implemented Interfaces:
ILayerPainter

public class CopySelectionLayerPainter extends SelectionLayerPainter
Specialized SelectionLayerPainter that renders a border around cells that are currently in the stored in the InternalCellClipboard.

Note: Needs to be set to the SelectionLayer in order to work correctly.

Since:
1.4
  • Field Details

  • Constructor Details

    • CopySelectionLayerPainter

      public CopySelectionLayerPainter(InternalCellClipboard clipboard)
      Create a CopySelectionLayerPainter that renders gray grid lines and uses the default clipping behavior.
      Parameters:
      clipboard - The InternalCellClipboard that stores the cells that are currently copied.
    • CopySelectionLayerPainter

      public CopySelectionLayerPainter(InternalCellClipboard clipboard, org.eclipse.swt.graphics.Color gridColor)
      Create a CopySelectionLayerPainter that renders gray grid lines and uses the default clipping behavior.
      Parameters:
      clipboard - The InternalCellClipboard that stores the cells that are currently copied.
      gridColor - The color that should be used to render the grid lines.
    • CopySelectionLayerPainter

      public CopySelectionLayerPainter(InternalCellClipboard clipboard, org.eclipse.swt.graphics.Color gridColor, boolean clipLeft, boolean clipTop)
      Create a CopySelectionLayerPainter that renders grid lines in the specified color and uses the specified clipping behavior.
      Parameters:
      clipboard - The InternalCellClipboard that stores the cells that are currently copied.
      gridColor - The color that should be used to render the grid lines.
      clipLeft - Configure the rendering behavior 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 behavior 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.
    • CopySelectionLayerPainter

      public CopySelectionLayerPainter(InternalCellClipboard clipboard, boolean clipLeft, boolean clipTop)
      Create a CopySelectionLayerPainter that renders gray grid lines and uses the specified clipping behavior.
      Parameters:
      clipboard - The InternalCellClipboard that stores the cells that are currently copied.
      clipLeft - Configure the rendering behavior 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 behavior 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 Details

    • paintLayer

      public void paintLayer(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle pixelRectangle, IConfigRegistry configRegistry)
      Specified by:
      paintLayer in interface ILayerPainter
      Overrides:
      paintLayer in class SelectionLayerPainter
      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
      pixelRectangle - area the layer can paint in
      configRegistry - IConfigRegistry in use by NatTable. Useful for looking up associated painters.
    • getCopyBorderStyle

      protected BorderStyle getCopyBorderStyle(IConfigRegistry configRegistry)
      Get the border style that should be used to render the border for cells that are currently copied to the InternalCellClipboard. Checks the ConfigRegistry for a registered IStyle for the SelectionStyleLabels.COPY_BORDER_STYLE label. If none is registered, a default line style will be used to render the border.
      Parameters:
      configRegistry - The ConfigRegistry to retrieve the style information from.
      Returns:
      The BorderStyle that should be used for rendering the copy border.
      Since:
      1.6