Class HideIndicatorOverlayPainter
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.hideshow.indicator.HideIndicatorOverlayPainter
-
- All Implemented Interfaces:
IOverlayPainter
,IOverlayPainter2
- Direct Known Subclasses:
HierarchicalHideIndicatorOverlayPainter
public class HideIndicatorOverlayPainter extends Object implements IOverlayPainter2
Overlay painter that is used to render an indicator for hidden columns or rows.- Since:
- 1.6
-
-
Field Summary
Fields Modifier and Type Field Description protected ILayer
columnHeaderLayer
protected IConfigRegistry
configRegistry
TheIConfigRegistry
that should be used to retrieve the color to use for rendering the hide indicator.protected ILayer
rowHeaderLayer
-
Constructor Summary
Constructors Constructor Description HideIndicatorOverlayPainter(ILayer columnHeaderLayer, ILayer rowHeaderLayer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.graphics.Color
getIndicatorColor()
Checks if aIConfigRegistry
is set to this HideIndicatorOverlayPainter and will try to extract the configuration value forHideIndicatorConfigAttributes.HIDE_INDICATOR_COLOR
.int
getIndicatorLineWidth()
Checks if aIConfigRegistry
is set to this HideIndicatorOverlayPainter and will try to extract the configuration value forHideIndicatorConfigAttributes.HIDE_INDICATOR_LINE_WIDTH
.protected void
paintHiddenColumnIndicator(ILayer layer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle)
Renders the indicator for hidden columns.protected void
paintHiddenRowIndicator(ILayer layer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle)
Renders the indicator for hidden rows.void
paintOverlay(ILayer layer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle)
Render an overlay over the painted layers.void
paintOverlay(org.eclipse.swt.graphics.GC gc, ILayer layer)
void
setConfigRegistry(IConfigRegistry configRegistry)
Sets theIConfigRegistry
to this HideIndicatorOverlayPainter.void
setIndicatorColor(org.eclipse.swt.graphics.Color indicatorColor)
void
setIndicatorLineWidth(int lineWidth)
void
setLayerOnTop(ILayer layer)
void
setLayerToLeft(ILayer layer)
-
-
-
Field Detail
-
columnHeaderLayer
protected ILayer columnHeaderLayer
-
rowHeaderLayer
protected ILayer rowHeaderLayer
-
configRegistry
protected IConfigRegistry configRegistry
TheIConfigRegistry
that should be used to retrieve the color to use for rendering the hide indicator. If set tonull
, the locally set color will be used.
-
-
Constructor Detail
-
HideIndicatorOverlayPainter
public HideIndicatorOverlayPainter(ILayer columnHeaderLayer, ILayer rowHeaderLayer)
- Parameters:
columnHeaderLayer
- The layer in the column header that should be used to determine the height of the hidden column indicator. Should be the top most layer in the column header region, e.g. the FilterRowHeaderComposite in case filtering is included. Can benull
to avoid rendering of hidden column indicators.rowHeaderLayer
- The layer in the row header that should be used to determine the width of the hidden row indicator. Should be the top most layer in the row header region. Can benull
to avoid rendering of hidden row indicators.
-
-
Method Detail
-
paintOverlay
public void paintOverlay(org.eclipse.swt.graphics.GC gc, ILayer layer)
- Specified by:
paintOverlay
in interfaceIOverlayPainter
-
paintOverlay
public void paintOverlay(ILayer layer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle)
Description copied from interface:IOverlayPainter2
Render an overlay over the painted layers.- Specified by:
paintOverlay
in interfaceIOverlayPainter2
- Parameters:
layer
- The layer as base for the overlay rendering.gc
- The GC.xOffset
- The x offset.yOffset
- The y offset.rectangle
- The print bounds for the rendering action.
-
paintHiddenColumnIndicator
protected void paintHiddenColumnIndicator(ILayer layer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle)
Renders the indicator for hidden columns. By default it renders only if a layer is provided as column header layer.- Parameters:
layer
- The layer as base for the overlay rendering.gc
- The GC.xOffset
- The x offset.yOffset
- The y offset.rectangle
- The print bounds for the rendering action.
-
paintHiddenRowIndicator
protected void paintHiddenRowIndicator(ILayer layer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle)
Renders the indicator for hidden rows. By default it renders only if a layer is provided as row header layer.- Parameters:
layer
- The layer as base for the overlay rendering.gc
- The GC.xOffset
- The x offset.yOffset
- The y offset.rectangle
- The print bounds for the rendering action.
-
getIndicatorColor
public org.eclipse.swt.graphics.Color getIndicatorColor()
Checks if aIConfigRegistry
is set to this HideIndicatorOverlayPainter and will try to extract the configuration value forHideIndicatorConfigAttributes.HIDE_INDICATOR_COLOR
. If there is no IConfigRegistry set or there is no value for the attribute in the set IConfigRegistry, the Color set as member will be used.- Returns:
- The Color that will be used to render the hide indicator.
-
setIndicatorColor
public void setIndicatorColor(org.eclipse.swt.graphics.Color indicatorColor)
- Parameters:
indicatorColor
- The Color that should be used to render the hide indicator.null
values will be ignored.
-
getIndicatorLineWidth
public int getIndicatorLineWidth()
Checks if aIConfigRegistry
is set to this HideIndicatorOverlayPainter and will try to extract the configuration value forHideIndicatorConfigAttributes.HIDE_INDICATOR_LINE_WIDTH
. If there is no IConfigRegistry set or there is no value for the attribute in the set IConfigRegistry, the line width set as member will be used.- Returns:
- The line width that will be used to render the hide indicator.
-
setIndicatorLineWidth
public void setIndicatorLineWidth(int lineWidth)
- Parameters:
lineWidth
- The line width that should be used to render the hide indicator.
-
setConfigRegistry
public void setConfigRegistry(IConfigRegistry configRegistry)
Sets theIConfigRegistry
to this HideIndicatorOverlayPainter. By setting it the values for indicator color and indicator width will be read out of theIConfigRegistry
and not used from the local member variables.- Parameters:
configRegistry
- TheIConfigRegistry
that contains the configuration values for the hide indicator.- See Also:
HideIndicatorConfigAttributes.HIDE_INDICATOR_COLOR
,HideIndicatorConfigAttributes.HIDE_INDICATOR_LINE_WIDTH
-
setLayerOnTop
public void setLayerOnTop(ILayer layer)
- Parameters:
layer
- Layer that is placed above the column header in a composition, e.g. the GroupByHeaderLayer. Needed to adjust the hide indicator start and height, and also to retrieve the labels from a body cell.- Since:
- 2.0
-
setLayerToLeft
public void setLayerToLeft(ILayer layer)
- Parameters:
layer
- Layer that is placed left of the row header in a composition. Needed to adjust the hide indicator start and height, and also to retrieve the labels from a body cell.- Since:
- 2.0
-
-