Class FillHandleCompositeFreezeLayerPainter
java.lang.Object
org.eclipse.nebula.widgets.nattable.layer.CompositeLayer.CompositeLayerPainter
org.eclipse.nebula.widgets.nattable.painter.layer.CompositeFreezeLayerPainter
org.eclipse.nebula.widgets.nattable.fillhandle.FillHandleCompositeFreezeLayerPainter
- All Implemented Interfaces:
FillHandleBoundsProvider,ILayerPainter
public class FillHandleCompositeFreezeLayerPainter
extends CompositeFreezeLayerPainter
implements FillHandleBoundsProvider
Specialization of the
CompositeFreezeLayerPainter that retrieves the
fill handle bounds from the separate paint calls and stores them locally.- Since:
- 2.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.swt.graphics.RectangleThe bounds of the current visible selection handle ornullif no fill handle is currently rendered. -
Constructor Summary
ConstructorsConstructorDescriptionFillHandleCompositeFreezeLayerPainter(CompositeFreezeLayer compositeFreezeLayer) Creates aFillHandleCompositeFreezeLayerPainterthat can be set directly on aCompositeFreezeLayer.FillHandleCompositeFreezeLayerPainter(CompositeLayer compositeLayer, CompositeFreezeLayer compositeFreezeLayer) Creates aFillHandleCompositeFreezeLayerPainterthat can be set on aCompositeLayerthat contains aCompositeFreezeLayer.FillHandleCompositeFreezeLayerPainter(CompositeLayer compositeLayer, CompositeFreezeLayer compositeFreezeLayer, boolean inspectComposite) Creates aFillHandleCompositeFreezeLayerPainterthat can be set on aCompositeLayerthat contains aCompositeFreezeLayer. -
Method Summary
Modifier and TypeMethodDescriptionprotected BorderStylegetHandleBorderStyle(IConfigRegistry configRegistry) Returns the border style that should be used to render the border of the fill handle.protected org.eclipse.swt.graphics.ColorgetHandleColor(IConfigRegistry configRegistry) Returns the color that should be used to render the fill handle.org.eclipse.swt.graphics.Rectangleprotected voidpaintFillHandle(org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry) Paint the fill handle.voidpaintLayer(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry) protected voidProcess the information stored in aILayerPainterof a composite region.Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.layer.CompositeFreezeLayerPainter
addNestedHorizontalLayer, addNestedVerticalLayer, getFreezeX, getFreezeY, getHeight, getWidthMethods inherited from class org.eclipse.nebula.widgets.nattable.layer.CompositeLayer.CompositeLayerPainter
adjustCellBounds
-
Field Details
-
handleBounds
protected org.eclipse.swt.graphics.Rectangle handleBoundsThe bounds of the current visible selection handle ornullif no fill handle is currently rendered.
-
-
Constructor Details
-
FillHandleCompositeFreezeLayerPainter
Creates aFillHandleCompositeFreezeLayerPainterthat can be set directly on aCompositeFreezeLayer. This way the freeze border will be rendered only inside theCompositeFreezeLayer.- Parameters:
compositeFreezeLayer- TheCompositeFreezeLayerfor rendering the freeze border.
-
FillHandleCompositeFreezeLayerPainter
public FillHandleCompositeFreezeLayerPainter(CompositeLayer compositeLayer, CompositeFreezeLayer compositeFreezeLayer) Creates aFillHandleCompositeFreezeLayerPainterthat can be set on aCompositeLayerthat contains aCompositeFreezeLayer. This way the freeze border will be rendered also on the adjacent regions. For this typically the givenCompositeFreezeLayerPainter.compositeLayeris 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.
-
FillHandleCompositeFreezeLayerPainter
public FillHandleCompositeFreezeLayerPainter(CompositeLayer compositeLayer, CompositeFreezeLayer compositeFreezeLayer, boolean inspectComposite) Creates aFillHandleCompositeFreezeLayerPainterthat can be set on aCompositeLayerthat contains aCompositeFreezeLayer. This way the freeze border will be rendered also on the adjacent regions. For this typically the givenCompositeFreezeLayerPainter.compositeLayeris 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 givenCompositeFreezeLayerPainter.compositeLayershould 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 classCompositeFreezeLayerPainter- 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.
-
processLayerPainterInformation
Description copied from class:CompositeLayer.CompositeLayerPainterProcess the information stored in aILayerPainterof a composite region. Needed to avoid that the information is lost if the same painter is used in all regions, e.g. the FillHandleLayerPainter.- Overrides:
processLayerPainterInformationin classCompositeLayer.CompositeLayerPainter- Parameters:
painter- TheILayerPainterof a composite region.
-
paintFillHandle
Paint the fill handle.- Parameters:
gc- TheGCused for painting.configRegistry- TheIConfigRegistryto retrieve fill handle configurations.
-
getHandleColor
Returns the color that should be used to render the fill handle. If theIConfigRegistryisnullor does not contain configurations for the color of the fill handle, a default dark green color is used.- Parameters:
configRegistry- TheIConfigRegistryneeded to determine the configured fill handle color. Can benullwhich results in returning a default dark green color.- Returns:
- the color that should be used
-
getHandleBorderStyle
Returns the border style that should be used to render the border of the fill handle. If theIConfigRegistryisnullor does not contain configurations for styling the border of the fill handle, a default style is used.- Parameters:
configRegistry- TheIConfigRegistryneeded to determine the configured fill handle border style. Can benullwhich results in returning a default style.- Returns:
- the border style that should be used
-
getSelectionHandleBounds
public org.eclipse.swt.graphics.Rectangle getSelectionHandleBounds()- Specified by:
getSelectionHandleBoundsin interfaceFillHandleBoundsProvider- Returns:
- The bounds of the current visible selection handle or
nullif no fill handle is currently rendered.
-