Class ConfigureScalingCommand
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.command.AbstractContextFreeCommand
-
- org.eclipse.nebula.widgets.nattable.layer.command.ConfigureScalingCommand
-
- All Implemented Interfaces:
ILayerCommand
public class ConfigureScalingCommand extends AbstractContextFreeCommand
This command is used to configure scaling behavior. It transportsIDpiConverter
for horizontal and vertical dpi based scaling down the layer stack. This way every layer that directly performs pixel based size calculations is able to consume the converter.IMPORTANT
This command is not intended to be consumed at any layer. It is necessary that it is transported down the whole layer stack of all layer regions so every layer has the chance to consume theIDpiConverter
.The registering of
IDpiConverter
for automatic scaling is done via this command to avoid dependencies betweenSizeConfig
,DataLayer
and theIDpiConverter
. This is necessary because every UI toolkit has its own mechanism to provide the current DPI values.DPI factors could be different for x and y but the Windows API always delivers the same values for x and y. To avoid later refactorings because this behavior changes, this command transports an
IDpiConverter
for horizontal and vertical DPI conversion.
-
-
Constructor Summary
Constructors Constructor Description ConfigureScalingCommand(IDpiConverter dpiConverter)
ConfigureScalingCommand(IDpiConverter horizontalDpiConverter, IDpiConverter verticalDpiConverter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDpiConverter
getHorizontalDpiConverter()
IDpiConverter
getVerticalDpiConverter()
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractContextFreeCommand
cloneCommand, convertToTargetLayer
-
-
-
-
Constructor Detail
-
ConfigureScalingCommand
public ConfigureScalingCommand(IDpiConverter dpiConverter)
- Parameters:
dpiConverter
- TheIDpiConverter
that should be registered for horizontal and vertical DPI conversion.- Since:
- 2.0
-
ConfigureScalingCommand
public ConfigureScalingCommand(IDpiConverter horizontalDpiConverter, IDpiConverter verticalDpiConverter)
- Parameters:
horizontalDpiConverter
- TheIDpiConverter
that should be registered for horizontal DPI conversion.verticalDpiConverter
- TheIDpiConverter
that should be registered for vertical DPI conversion.
-
-
Method Detail
-
getHorizontalDpiConverter
public IDpiConverter getHorizontalDpiConverter()
- Returns:
- The
IDpiConverter
that should be registered for horizontal DPI conversion.
-
getVerticalDpiConverter
public IDpiConverter getVerticalDpiConverter()
- Returns:
- The
IDpiConverter
that should be registered for vertical DPI conversion.
-
-