Class DefaultGridLook
- java.lang.Object
-
- org.eclipse.nebula.paperclips.core.grid.DefaultGridLook
-
-
Field Summary
Fields Modifier and Type Field Description (package private) CellBackgroundProviderbodyBackgroundProviderstatic intBORDER_OVERLAPConstant cell spacing value indicating that the borders of adjacent cells should overlap so the appear continuous.(package private) BordercellBorder(package private) org.eclipse.swt.graphics.RectanglecellPadding(package private) org.eclipse.swt.graphics.PointcellSpacing(package private) DefaultCellBackgroundProviderdefaultBodyBackgroundProvider(package private) DefaultCellBackgroundProviderdefaultFooterBackgroundProvider(package private) DefaultCellBackgroundProviderdefaultHeaderBackgroundProvider(package private) CellBackgroundProviderfooterBackgroundProvider(package private) intfooterGap(package private) CellBackgroundProviderheaderBackgroundProvider(package private) intheaderGap
-
Constructor Summary
Constructors Constructor Description DefaultGridLook()Constructs a DefaultGridLook with no border, no cell spacing, and no background colors.DefaultGridLook(int horizontalSpacing, int verticalSpacing)Constructs a DefaultGridLook with the given cell spacing, and no border or background colors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)org.eclipse.swt.graphics.RGBgetBodyBackground()Returns the body background color.CellBackgroundProvidergetBodyBackgroundProvider()Returns the body background color provider.BordergetCellBorder()Returns the cell border.org.eclipse.swt.graphics.RectanglegetCellPadding()Returns a rectangle whose public fields denote the left (x), top (y), right (width) and bottom (height) cell padding, expressed in points.org.eclipse.swt.graphics.PointgetCellSpacing()Returns the border spacing, in points, between adjacent grid cells.org.eclipse.swt.graphics.RGBgetFooterBackground()Returns the footer background color.CellBackgroundProvidergetFooterBackgroundProvider()Returns the footer background color provider.intgetFooterGap()Returns the vertical gap between the body and footer cells.org.eclipse.swt.graphics.RGBgetHeaderBackground()Returns the header background color.CellBackgroundProvidergetHeaderBackgroundProvider()Returns the header background color provider.intgetHeaderGap()Returns the vertical gap between the header and body cells.GridLookPaintergetPainter(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)Returns a GridLookPainter for painting the GridLook.inthashCode()voidsetBodyBackground(org.eclipse.swt.graphics.RGB bodyBackground)Sets the body background color.voidsetBodyBackgroundProvider(CellBackgroundProvider bodyBackgroundProvider)Sets the body background color provider.voidsetCellBorder(Border border)Sets the cell border.voidsetCellPadding(int horizontalPadding, int verticalPadding)Sets the cell padding to the given horizontal and vertical values.voidsetCellPadding(int left, int top, int right, int bottom)Sets the cell padding to the specified values.voidsetCellPadding(org.eclipse.swt.graphics.Rectangle cellPadding)Sets the cell padding to the values in the public fields of the argument.voidsetCellSpacing(int horizontal, int vertical)Sets the border spacing, in points, between adjacent grid cells.voidsetCellSpacing(org.eclipse.swt.graphics.Point cellSpacing)Sets the border spacing, in points, between adjacent grid cells.voidsetFooterBackground(org.eclipse.swt.graphics.RGB footerBackground)Sets the footer background color.voidsetFooterBackgroundProvider(CellBackgroundProvider footerBackgroundProvider)Sets the footer background color provider.voidsetFooterGap(int footerGap)Sets the vertical gap between the header and body cells.voidsetHeaderBackground(org.eclipse.swt.graphics.RGB headerBackground)Sets the header background color.voidsetHeaderBackgroundProvider(CellBackgroundProvider headerBackgroundProvider)Sets the header background color provider.voidsetHeaderGap(int headerGap)Sets the vertical gap between the header and body cells.
-
-
-
Field Detail
-
BORDER_OVERLAP
public static final int BORDER_OVERLAP
Constant cell spacing value indicating that the borders of adjacent cells should overlap so the appear continuous.- See Also:
- Constant Field Values
-
cellSpacing
org.eclipse.swt.graphics.Point cellSpacing
-
cellPadding
org.eclipse.swt.graphics.Rectangle cellPadding
-
headerGap
int headerGap
-
footerGap
int footerGap
-
cellBorder
Border cellBorder
-
defaultBodyBackgroundProvider
DefaultCellBackgroundProvider defaultBodyBackgroundProvider
-
defaultHeaderBackgroundProvider
DefaultCellBackgroundProvider defaultHeaderBackgroundProvider
-
defaultFooterBackgroundProvider
DefaultCellBackgroundProvider defaultFooterBackgroundProvider
-
bodyBackgroundProvider
CellBackgroundProvider bodyBackgroundProvider
-
headerBackgroundProvider
CellBackgroundProvider headerBackgroundProvider
-
footerBackgroundProvider
CellBackgroundProvider footerBackgroundProvider
-
-
Constructor Detail
-
DefaultGridLook
public DefaultGridLook()
Constructs a DefaultGridLook with no border, no cell spacing, and no background colors.
-
DefaultGridLook
public DefaultGridLook(int horizontalSpacing, int verticalSpacing)Constructs a DefaultGridLook with the given cell spacing, and no border or background colors.- Parameters:
horizontalSpacing- the horizontal cell spacing.verticalSpacing- the vertical cell spacing.
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getCellBorder
public Border getCellBorder()
Returns the cell border. Default is an empty border with no margins.- Returns:
- the cell border.
-
setCellBorder
public void setCellBorder(Border border)
Sets the cell border.- Parameters:
border- the cell border.
-
getCellSpacing
public org.eclipse.swt.graphics.Point getCellSpacing()
Returns the border spacing, in points, between adjacent grid cells. Default is (x=BORDER_OVERLAP, y=BORDER_OVERLAP).- Returns:
- the border spacing, in points, between adjacent grid cells.
-
setCellSpacing
public void setCellSpacing(org.eclipse.swt.graphics.Point cellSpacing)
Sets the border spacing, in points, between adjacent grid cells. A value ofBORDER_OVERLAPcauses the borders to overlap, making the border appear continuous throughout the grid. A value of 0 or more causes the cell borders to be spaced that many points apart. 72 points = 1".- Parameters:
cellSpacing- a point whose x and y elements indicate the horizontal and vertical spacing between grid cells.
-
setCellSpacing
public void setCellSpacing(int horizontal, int vertical)Sets the border spacing, in points, between adjacent grid cells. A value ofBORDER_OVERLAPcauses the borders to overlap, making the border appear continuous throughout the grid. A value of 0 or more causes the cell borders to be spaced that many points apart. 72 points = 1".- Parameters:
horizontal- the horizontal cell spacing.vertical- the vertical cell spacing.
-
getCellPadding
public org.eclipse.swt.graphics.Rectangle getCellPadding()
Returns a rectangle whose public fields denote the left (x), top (y), right (width) and bottom (height) cell padding, expressed in points. 72 points = 1" = 2.54cm.- Returns:
- a rectangle whose public fields denote the cell padding at each edge.
-
setCellPadding
public void setCellPadding(org.eclipse.swt.graphics.Rectangle cellPadding)
Sets the cell padding to the values in the public fields of the argument.- Parameters:
cellPadding- the new cell padding.
-
setCellPadding
public void setCellPadding(int horizontalPadding, int verticalPadding)Sets the cell padding to the given horizontal and vertical values. This is equivalent to calling setCellPadding(horizontalPadding, verticalPadding, horizontalPadding, verticalPadding).- Parameters:
horizontalPadding- the amount of padding to add to the left and right of each cell, in points.verticalPadding- the amount padding to add to the top and bottom each cell, in points.
-
setCellPadding
public void setCellPadding(int left, int top, int right, int bottom)Sets the cell padding to the specified values.- Parameters:
left- the left cell padding, in points.top- the top cell padding, in points.right- the right cell padding, in points.bottom- the bottom cell padding, in points.
-
getHeaderBackground
public org.eclipse.swt.graphics.RGB getHeaderBackground()
Returns the header background color. If null, the body background color is used. Default is null.- Returns:
- the header background color.
-
setHeaderBackground
public void setHeaderBackground(org.eclipse.swt.graphics.RGB headerBackground)
Sets the header background color. Calls to this method override any previous calls to setHeaderBackgroundProvider(...).- Parameters:
headerBackground- the new background color. If null, the body background color will be used.
-
getHeaderBackgroundProvider
public CellBackgroundProvider getHeaderBackgroundProvider()
Returns the header background color provider.- Returns:
- the header background color provider.
-
setHeaderBackgroundProvider
public void setHeaderBackgroundProvider(CellBackgroundProvider headerBackgroundProvider)
Sets the header background color provider. Calls to this method override any previous calls to setHeaderBackground(RGB). Setting this property to null restores the default background provider.- Parameters:
headerBackgroundProvider- the new background color provider.
-
getHeaderGap
public int getHeaderGap()
Returns the vertical gap between the header and body cells. Default is BORDER_OVERLAP.- Returns:
- the vertical gap between the header and body cells.
-
setHeaderGap
public void setHeaderGap(int headerGap)
Sets the vertical gap between the header and body cells. A value ofBORDER_OVERLAPcauses the borders to overlap, making the border appear continuous in the transition from the header cells to the body cells.- Parameters:
headerGap- the new header gap.
-
getBodyBackground
public org.eclipse.swt.graphics.RGB getBodyBackground()
Returns the body background color. Default is null (no background color).- Returns:
- the body background color.
-
setBodyBackground
public void setBodyBackground(org.eclipse.swt.graphics.RGB bodyBackground)
Sets the body background color. Calls to this method override any previous calls to setBodyBackgroundProvider(...).- Parameters:
bodyBackground- the new background color.
-
getBodyBackgroundProvider
public CellBackgroundProvider getBodyBackgroundProvider()
Returns the body background color provider.- Returns:
- the body background color provider.
-
setBodyBackgroundProvider
public void setBodyBackgroundProvider(CellBackgroundProvider bodyBackgroundProvider)
Sets the body background color provider. Calls to this method override any previous calls to setBodyBackground(RGB). Setting this property to null restores the default background provider.- Parameters:
bodyBackgroundProvider- the new background color provider.
-
getFooterGap
public int getFooterGap()
Returns the vertical gap between the body and footer cells. Default is BORDER_OVERLAP.- Returns:
- the vertical gap between the header and body cells.
-
setFooterGap
public void setFooterGap(int footerGap)
Sets the vertical gap between the header and body cells. A value ofBORDER_OVERLAPcauses the borders to overlap, making the border appear continuous in the transition from the body cells to the footer cells.- Parameters:
footerGap-
-
getFooterBackground
public org.eclipse.swt.graphics.RGB getFooterBackground()
Returns the footer background color. If null, the body background color is used. Default is null.- Returns:
- the footer background color.
-
setFooterBackground
public void setFooterBackground(org.eclipse.swt.graphics.RGB footerBackground)
Sets the footer background color. Calls to this method override any previous calls to setFooterBackgroundProvider(...).- Parameters:
footerBackground- the new background color. If null, the body background color will be used.
-
getFooterBackgroundProvider
public CellBackgroundProvider getFooterBackgroundProvider()
Returns the footer background color provider.- Returns:
- the footer background color provider.
-
setFooterBackgroundProvider
public void setFooterBackgroundProvider(CellBackgroundProvider footerBackgroundProvider)
Sets the footer background color provider. Calls to this method override any previous calls to setFooterBackground(RGB). Setting this property to null restores the default background provider.- Parameters:
footerBackgroundProvider- the new background color provider.
-
getPainter
public GridLookPainter getPainter(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
Description copied from interface:GridLookReturns a GridLookPainter for painting the GridLook.- Specified by:
getPainterin interfaceGridLook- Parameters:
device- the device to paint on.gc- the graphics context for painting.- Returns:
- a GridLookPainter for painting the GridLook.
-
-