Class CompositeFreezeLayerPainter
java.lang.Object
org.eclipse.nebula.widgets.nattable.layer.CompositeLayer.CompositeLayerPainter
org.eclipse.nebula.widgets.nattable.painter.layer.CompositeFreezeLayerPainter
- All Implemented Interfaces:
ILayerPainter
CompositeLayer
that is used to render the freeze border. Can also be
used set on a top-level CompositeLayer
to render the freeze border
also on adjacent regions, e.g. in a GridLayer to render the freeze border
also inside the column header and row header.- Since:
- 1.6
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeFreezeLayerPainter
(CompositeFreezeLayer compositeFreezeLayer) Creates aCompositeFreezeLayerPainter
that can be set directly on aCompositeFreezeLayer
.CompositeFreezeLayerPainter
(CompositeLayer compositeLayer, CompositeFreezeLayer compositeFreezeLayer) Creates aCompositeFreezeLayerPainter
that can be set on aCompositeLayer
that contains aCompositeFreezeLayer
.CompositeFreezeLayerPainter
(CompositeLayer compositeLayer, CompositeFreezeLayer compositeFreezeLayer, boolean inspectComposite) Creates aCompositeFreezeLayerPainter
that can be set on aCompositeLayer
that contains aCompositeFreezeLayer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addNestedHorizontalLayer
(ILayer layer) Adds the given layer to the list of nested horizontal layers that are used to shift the freeze border to the right.void
addNestedVerticalLayer
(ILayer layer) Adds the given layer to the list of nested vertical layers that are used to shift the freeze border down.protected int
getFreezeX
(int xOffset) Returns the x coordinate of the freeze border.protected int
getFreezeY
(int yOffset) Returns the y coordinate of the freeze border.protected int
Returns the height of the freeze border dependent on the configured layers this painter is attached to.protected int
getWidth()
Returns the width of the freeze border dependent on the configured layers this painter is attached to.void
paintLayer
(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry) Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.CompositeLayer.CompositeLayerPainter
adjustCellBounds
-
Constructor Details
-
CompositeFreezeLayerPainter
Creates aCompositeFreezeLayerPainter
that can be set directly on aCompositeFreezeLayer
. This way the freeze border will be rendered only inside theCompositeFreezeLayer
.- Parameters:
compositeFreezeLayer
- TheCompositeFreezeLayer
for rendering the freeze border.
-
CompositeFreezeLayerPainter
public CompositeFreezeLayerPainter(CompositeLayer compositeLayer, CompositeFreezeLayer compositeFreezeLayer) Creates aCompositeFreezeLayerPainter
that can be set on aCompositeLayer
that contains aCompositeFreezeLayer
. This way the freeze border will be rendered also on the adjacent regions. For this typically the givencompositeLayer
is inspected and the freeze border is moved by the width/height of the first layers on top and to the left, as we do not know the needed offset values on the higher level composition.- Parameters:
compositeLayer
- The top levelCompositeLayer
, e.g. a GridLayer.compositeFreezeLayer
- TheCompositeFreezeLayer
for rendering the freeze border.
-
CompositeFreezeLayerPainter
public CompositeFreezeLayerPainter(CompositeLayer compositeLayer, CompositeFreezeLayer compositeFreezeLayer, boolean inspectComposite) Creates aCompositeFreezeLayerPainter
that can be set on aCompositeLayer
that contains aCompositeFreezeLayer
. This way the freeze border will be rendered also on the adjacent regions. For this typically the givencompositeLayer
is inspected and the freeze border is moved by the width/height of the first layers on top and to the left, as we do not know the needed offset values on the higher level composition.Note: Via the
inspectComposite
parameter the behavior in more complex layer compositions with nested CompositeLayer can be adjusted.- Parameters:
compositeLayer
- The top levelCompositeLayer
, e.g. a GridLayer.compositeFreezeLayer
- TheCompositeFreezeLayer
for rendering the freeze border.inspectComposite
-true
if the givencompositeLayer
should be inspected for the position of the freeze border,false
if not. Default istrue
. Remember to add nested layers to manually configure the freeze border shift when setting this value tofalse
.- See Also:
-
-
Method Details
-
paintLayer
public void paintLayer(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry) - Specified by:
paintLayer
in interfaceILayerPainter
- Overrides:
paintLayer
in classCompositeLayer.CompositeLayerPainter
- Parameters:
natLayer
- The layer to paint.gc
- GC used for paintingxOffset
- x offset of the layer from the origin of the tableyOffset
- y offset of the layer from the origin of the tablerectangle
- area the layer can paint inconfigRegistry
-IConfigRegistry
in use by NatTable. Useful for looking up associated painters.
-
getHeight
protected int getHeight()Returns the height of the freeze border dependent on the configured layers this painter is attached to.- Returns:
- The height of the freeze border.
-
getWidth
protected int getWidth()Returns the width of the freeze border dependent on the configured layers this painter is attached to.- Returns:
- The width of the freeze border.
-
getFreezeX
protected int getFreezeX(int xOffset) Returns the x coordinate of the freeze border.- Parameters:
xOffset
- The composition offset.- Returns:
- The x coordinate value for the horizontal freeze border.
-
getFreezeY
protected int getFreezeY(int yOffset) Returns the y coordinate of the freeze border.- Parameters:
yOffset
- The composition offset.- Returns:
- The y coordinate value for the vertical freeze border.
-
addNestedVerticalLayer
Adds the given layer to the list of nested vertical layers that are used to shift the freeze border down. Needed in case of nested compositions, e.g. using a fixed summary row in the body region.- Parameters:
layer
- TheILayer
to add.
-
addNestedHorizontalLayer
Adds the given layer to the list of nested horizontal layers that are used to shift the freeze border to the right. Needed in case of nested compositions in the body region.- Parameters:
layer
- TheILayer
to add.
-