Class FillHandleLayerPainter

    • Field Detail

      • handleBounds

        protected org.eclipse.swt.graphics.Rectangle handleBounds
        The bounds of the current visible selection handle or null if no fill handle is currently rendered.
    • Constructor Detail

      • FillHandleLayerPainter

        public FillHandleLayerPainter()
        Create a SelectionLayerPainter that renders gray grid lines and uses the default clipping behavior.
      • FillHandleLayerPainter

        public FillHandleLayerPainter​(org.eclipse.swt.graphics.Color gridColor)
        Create an FillHandleLayerPainter that renders grid lines in the specified color and uses the default clipping behavior.
        Parameters:
        gridColor - The color that should be used to render the grid lines.
      • FillHandleLayerPainter

        public FillHandleLayerPainter​(boolean clipLeft,
                                      boolean clipTop)
        Create an FillHandleLayerPainter that renders gray grid lines and uses the specified clipping behavior.
        Parameters:
        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.
      • FillHandleLayerPainter

        public FillHandleLayerPainter​(org.eclipse.swt.graphics.Color gridColor,
                                      boolean clipLeft,
                                      boolean clipTop)
        Create an FillHandleLayerPainter that renders grid lines in the specified color and uses the specified clipping behavior.
        Parameters:
        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.
      • FillHandleLayerPainter

        public FillHandleLayerPainter​(InternalCellClipboard clipboard)
        Create an FillHandleLayerPainter that renders gray grid lines and uses the default clipping behavior. It also renders a border around internally copied cells.
        Parameters:
        clipboard - The InternalCellClipboard that stores the cells that are currently copied.
      • FillHandleLayerPainter

        public FillHandleLayerPainter​(InternalCellClipboard clipboard,
                                      org.eclipse.swt.graphics.Color gridColor)
        Create an FillHandleLayerPainter that renders grid lines in the specified color 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.
      • FillHandleLayerPainter

        public FillHandleLayerPainter​(InternalCellClipboard clipboard,
                                      boolean clipLeft,
                                      boolean clipTop)
        Create an FillHandleLayerPainter 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.
      • FillHandleLayerPainter

        public FillHandleLayerPainter​(InternalCellClipboard clipboard,
                                      org.eclipse.swt.graphics.Color gridColor,
                                      boolean clipLeft,
                                      boolean clipTop)
        Create an FillHandleLayerPainter 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.
    • Method Detail

      • 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.
      • paintFillHandle

        protected void paintFillHandle​(ILayerCell fillHandleCell,
                                       org.eclipse.swt.graphics.GC gc,
                                       int xOffset,
                                       int yOffset,
                                       IConfigRegistry configRegistry)
      • paintCopyBorder

        protected void paintCopyBorder​(ILayer natLayer,
                                       org.eclipse.swt.graphics.GC gc,
                                       int xOffset,
                                       int yOffset,
                                       org.eclipse.swt.graphics.Rectangle pixelRectangle,
                                       IConfigRegistry configRegistry)
      • isFillHandleRegion

        protected boolean isFillHandleRegion​(ILayerCell cell)
        Parameters:
        cell - The ILayerCell to check.
        Returns:
        true if the cell is part of the fill handle region, false if not.
      • isFillHandleCell

        protected boolean isFillHandleCell​(ILayerCell cell)
        Parameters:
        cell - The ILayerCell to check.
        Returns:
        true if the cell is the bottom right cell in a fill region, false if not.
      • getHandleColor

        protected org.eclipse.swt.graphics.Color getHandleColor​(IConfigRegistry configRegistry)
        Returns the color that should be used to render the fill handle. If the IConfigRegistry is null or does not contain configurations for the color of the fill handle, a default dark green color is used.
        Parameters:
        configRegistry - The IConfigRegistry needed to determine the configured fill handle color. Can be null which results in returning a default dark green color.
        Returns:
        the color that should be used
        Since:
        1.5
      • getHandleBorderStyle

        protected BorderStyle getHandleBorderStyle​(IConfigRegistry configRegistry)
        Returns the border style that should be used to render the border of the fill handle. If the IConfigRegistry is null or does not contain configurations for styling the border of the fill handle, a default style is used.
        Parameters:
        configRegistry - The IConfigRegistry needed to determine the configured fill handle border style. Can be null which results in returning a default style.
        Returns:
        the border style that should be used
        Since:
        1.5
      • getSelectionHandleBounds

        public org.eclipse.swt.graphics.Rectangle getSelectionHandleBounds()
        Returns:
        The bounds of the current visible selection handle or null if no fill handle is currently rendered.
      • getClipboard

        public InternalCellClipboard getClipboard()
        Returns:
        The InternalCellClipboard that is used to identify whether a cell is currently copied or null if special rendering of copied cells is disabled.
      • setClipboard

        public void setClipboard​(InternalCellClipboard clipboard)
        Parameters:
        clipboard - The InternalCellClipboard that should be used to identify whether a cell is currently copied or null to disable special rendering of copied cells.