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 aCompositeFreezeLayerPainterthat can be set directly on aCompositeFreezeLayer.CompositeFreezeLayerPainter(CompositeLayer compositeLayer, CompositeFreezeLayer compositeFreezeLayer) Creates aCompositeFreezeLayerPainterthat can be set on aCompositeLayerthat contains aCompositeFreezeLayer.CompositeFreezeLayerPainter(CompositeLayer compositeLayer, CompositeFreezeLayer compositeFreezeLayer, boolean inspectComposite) Creates aCompositeFreezeLayerPainterthat can be set on aCompositeLayerthat contains aCompositeFreezeLayer. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNestedHorizontalLayer(ILayer layer) Adds the given layer to the list of nested horizontal layers that are used to shift the freeze border to the right.voidaddNestedVerticalLayer(ILayer layer) Adds the given layer to the list of nested vertical layers that are used to shift the freeze border down.protected intgetFreezeX(int xOffset) Returns the x coordinate of the freeze border.protected intgetFreezeY(int yOffset) Returns the y coordinate of the freeze border.protected intReturns the height of the freeze border dependent on the configured layers this painter is attached to.protected intgetWidth()Returns the width of the freeze border dependent on the configured layers this painter is attached to.voidpaintLayer(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 aCompositeFreezeLayerPainterthat can be set directly on aCompositeFreezeLayer. This way the freeze border will be rendered only inside theCompositeFreezeLayer.- Parameters:
compositeFreezeLayer- TheCompositeFreezeLayerfor rendering the freeze border.
-
CompositeFreezeLayerPainter
public CompositeFreezeLayerPainter(CompositeLayer compositeLayer, CompositeFreezeLayer compositeFreezeLayer) Creates aCompositeFreezeLayerPainterthat can be set on aCompositeLayerthat contains aCompositeFreezeLayer. This way the freeze border will be rendered also on the adjacent regions. For this typically the givencompositeLayeris 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- TheCompositeFreezeLayerfor rendering the freeze border.
-
CompositeFreezeLayerPainter
public CompositeFreezeLayerPainter(CompositeLayer compositeLayer, CompositeFreezeLayer compositeFreezeLayer, boolean inspectComposite) Creates aCompositeFreezeLayerPainterthat can be set on aCompositeLayerthat contains aCompositeFreezeLayer. This way the freeze border will be rendered also on the adjacent regions. For this typically the givencompositeLayeris 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
inspectCompositeparameter the behavior in more complex layer compositions with nested CompositeLayer can be adjusted.- Parameters:
compositeLayer- The top levelCompositeLayer, e.g. a GridLayer.compositeFreezeLayer- TheCompositeFreezeLayerfor rendering the freeze border.inspectComposite-trueif the givencompositeLayershould be inspected for the position of the freeze border,falseif 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:
paintLayerin interfaceILayerPainter- Overrides:
paintLayerin 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-IConfigRegistryin 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- TheILayerto 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- TheILayerto add.
-