| /*=============================================================================# |
| # Copyright (c) 2012, 2021 Original NatTable authors and others. |
| # |
| # This program and the accompanying materials are made available under the |
| # terms of the Eclipse Public License 2.0 which is available at |
| # https://www.eclipse.org/legal/epl-2.0. |
| # |
| # SPDX-License-Identifier: EPL-2.0 |
| # |
| # Contributors: |
| # Original NatTable authors and others - initial API and implementation |
| #=============================================================================*/ |
| |
| package org.eclipse.statet.ecommons.waltable.painter.layer; |
| |
| import org.eclipse.swt.graphics.Device; |
| import org.eclipse.swt.graphics.GC; |
| |
| import org.eclipse.statet.ecommons.waltable.config.IConfigRegistry; |
| import org.eclipse.statet.ecommons.waltable.coordinate.LRectangle; |
| import org.eclipse.statet.ecommons.waltable.layer.ILayer; |
| |
| |
| /** |
| * Classes implementing this interface are responsible for painting to the relevant {@link Device}. |
| * Every layer has a layer painter. A layer can contribute to painting by providing its own painter. |
| */ |
| public interface ILayerPainter { |
| |
| /** |
| * @param natLayer |
| * @param gc GC used for painting |
| * @param xOffset of the layer from the origin of the table |
| * @param yOffset of the layer from the origin of the table |
| * @param rectangle area the layer can paint in |
| * @param configuration in use by NatTable. Useful for looking up associated painters. |
| */ |
| public void paintLayer(ILayer natLayer, GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configuration); |
| |
| /** |
| * 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. |
| */ |
| public LRectangle adjustCellBounds(long columnPosition, long rowPosition, LRectangle cellBounds); |
| |
| } |