Class DefaultGridLookPainter
- java.lang.Object
-
- org.eclipse.nebula.paperclips.core.grid.BasicGridLookPainter
-
- org.eclipse.nebula.paperclips.core.grid.internal.DefaultGridLookPainter
-
- All Implemented Interfaces:
GridLookPainter
public class DefaultGridLookPainter extends BasicGridLookPainter
-
-
Field Summary
Fields Modifier and Type Field Description private CellBackgroundProvider
bodyBackground
private BorderPainter
border
private org.eclipse.swt.graphics.Rectangle
cellPadding
private CellBackgroundProvider
footerBackground
private CellBackgroundProvider
headerBackground
private GridMargins
margins
private ResourcePool
resources
-
Fields inherited from class org.eclipse.nebula.paperclips.core.grid.BasicGridLookPainter
device
-
-
Constructor Summary
Constructors Constructor Description DefaultGridLookPainter(DefaultGridLook look, org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.eclipse.swt.graphics.Rectangle
calculateCellPadding(DefaultGridLook look, org.eclipse.swt.graphics.Point dpi)
private GridMargins
calculateGridMargins(DefaultGridLook look, org.eclipse.swt.graphics.Point dpi)
void
dispose()
Disposes the system resources allocated by this GridLookPainter.GridMargins
getMargins()
Returns the grid margins used for the GridLook.protected void
paintBodyCell(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, int row, int col, int colspan, boolean topOpen, boolean bottomOpen)
Paint the decorations for the described body cell.private void
paintCell(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.RGB background, org.eclipse.swt.graphics.Rectangle bounds, boolean topOpen, boolean bottomOpen)
protected void
paintFooterCell(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, int row, int col, int colspan)
Paint the decorations for the described footer cell.protected void
paintHeaderCell(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, int row, int col, int colspan)
Paint the decorations for the described header cell.-
Methods inherited from class org.eclipse.nebula.paperclips.core.grid.BasicGridLookPainter
paint
-
-
-
-
Field Detail
-
cellPadding
private final org.eclipse.swt.graphics.Rectangle cellPadding
-
border
private final BorderPainter border
-
headerBackground
private final CellBackgroundProvider headerBackground
-
bodyBackground
private final CellBackgroundProvider bodyBackground
-
footerBackground
private final CellBackgroundProvider footerBackground
-
margins
private final GridMargins margins
-
resources
private final ResourcePool resources
-
-
Constructor Detail
-
DefaultGridLookPainter
public DefaultGridLookPainter(DefaultGridLook look, org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
-
-
Method Detail
-
calculateCellPadding
private org.eclipse.swt.graphics.Rectangle calculateCellPadding(DefaultGridLook look, org.eclipse.swt.graphics.Point dpi)
-
calculateGridMargins
private GridMargins calculateGridMargins(DefaultGridLook look, org.eclipse.swt.graphics.Point dpi)
-
getMargins
public GridMargins getMargins()
Description copied from interface:GridLookPainter
Returns the grid margins used for the GridLook.- Returns:
- the grid margins used for the GridLook.
- See Also:
GridMargins
-
paintHeaderCell
protected void paintHeaderCell(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, int row, int col, int colspan)
Description copied from class:BasicGridLookPainter
Paint the decorations for the described header cell.- Specified by:
paintHeaderCell
in classBasicGridLookPainter
- Parameters:
gc
- the graphics context to use for painting.bounds
- the bounds of the cell, excluding margins.row
- the row offset of the cell within the header.col
- the column offset of the cell within the header.colspan
- the number of columns that this cell spans.
-
paintBodyCell
protected void paintBodyCell(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, int row, int col, int colspan, boolean topOpen, boolean bottomOpen)
Description copied from class:BasicGridLookPainter
Paint the decorations for the described body cell.- Specified by:
paintBodyCell
in classBasicGridLookPainter
- Parameters:
gc
- the graphics context to use for painting.bounds
- the bounds of the cell, excluding margins.row
- the row offset of the cell within the header.col
- the column offset of the cell within the header.colspan
- the number of columns that this cell spans.topOpen
- whether the cell should be drawn with the top edge of the cell border "open." An open top border is a visual cue that the cell is being continued from the previous page.bottomOpen
- whether the cell should be drawn with the bottom edge of the cell border "open." An open bottom border is a visual cue that the cell will be continued on the next page.
-
paintFooterCell
protected void paintFooterCell(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, int row, int col, int colspan)
Description copied from class:BasicGridLookPainter
Paint the decorations for the described footer cell.- Specified by:
paintFooterCell
in classBasicGridLookPainter
- Parameters:
gc
- the graphics context to use for painting.bounds
- the bounds of the cell, excluding margins.row
- the row offset of the cell within the header.col
- the column offset of the cell within the header.colspan
- the number of columns that this cell spans.
-
paintCell
private void paintCell(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.RGB background, org.eclipse.swt.graphics.Rectangle bounds, boolean topOpen, boolean bottomOpen)
-
dispose
public void dispose()
Description copied from interface:GridLookPainter
Disposes the system resources allocated by this GridLookPainter. The dispose method is not a permanent disposal of a GridLookPainter. It is intended to reclaim system resources, however future calls to paint(GC,int,int) may require that the resources be allocated again.
-
-