Class ConfigureScalingCommand

  • All Implemented Interfaces:
    ILayerCommand

    public class ConfigureScalingCommand
    extends AbstractContextFreeCommand
    This command is used to configure scaling behavior. It transports IDpiConverter 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 the IDpiConverter.

    The registering of IDpiConverter for automatic scaling is done via this command to avoid dependencies between SizeConfig, DataLayer and the IDpiConverter. 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 Detail

      • ConfigureScalingCommand

        public ConfigureScalingCommand​(IDpiConverter dpiConverter)
        Parameters:
        dpiConverter - The IDpiConverter that should be registered for horizontal and vertical DPI conversion.
        Since:
        2.0
      • ConfigureScalingCommand

        public ConfigureScalingCommand​(IDpiConverter horizontalDpiConverter,
                                       IDpiConverter verticalDpiConverter)
        Parameters:
        horizontalDpiConverter - The IDpiConverter that should be registered for horizontal DPI conversion.
        verticalDpiConverter - The IDpiConverter 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.