Class MultiColumnResizeCommand

    • Constructor Detail

      • MultiColumnResizeCommand

        public MultiColumnResizeCommand​(ILayer layer,
                                        int[] columnPositions,
                                        int commonColumnWidth)
        Create a MultiColumnResizeCommand to resize multiple columns, where each column is resized to the same width, e.g. during a drag resize. The given column width will be taken as is without scaling.
        Parameters:
        layer - The ILayer to which the column positions correlate.
        columnPositions - The positions of the columns that should be resized.
        commonColumnWidth - The column width that should be applied to all given columns.
      • MultiColumnResizeCommand

        public MultiColumnResizeCommand​(ILayer layer,
                                        int[] columnPositions,
                                        int commonColumnWidth,
                                        boolean downScale)
        Create a MultiColumnResizeCommand to resize multiple columns, where each column is resized to the same width, e.g. during a drag resize.
        Parameters:
        layer - The ILayer to which the column positions correlate.
        columnPositions - The positions of the columns that should be resized.
        commonColumnWidth - The column width that should be applied to all given columns.
        downScale - true if the commonColumnWidth value should be down scaled according to the scaling level, false if the value should be taken as is.
        Since:
        1.6
      • MultiColumnResizeCommand

        public MultiColumnResizeCommand​(ILayer layer,
                                        int[] columnPositions,
                                        int[] columnWidths)
        Create a MultiColumnResizeCommand to resize multiple columns, where each column can be resized to a different size, e.g. during auto resize. The given column width will be taken as is without scaling.
        Parameters:
        layer - The ILayer to which the column positions correlate.
        columnPositions - The positions of the columns that should be resized.
        columnWidths - The new widths that should be applied to the given columns. The indexes in the arrays need to correlate.
      • MultiColumnResizeCommand

        public MultiColumnResizeCommand​(ILayer layer,
                                        int[] columnPositions,
                                        int[] columnWidths,
                                        boolean downScale)
        Create a MultiColumnResizeCommand to resize multiple columns, where each column can be resized to a different size, e.g. during auto resize.
        Parameters:
        layer - The ILayer to which the column positions correlate.
        columnPositions - The positions of the columns that should be resized.
        columnWidths - The new widths that should be applied to the given columns. The indexes in the arrays need to correlate.
        downScale - true if the columnWidths value should be down scaled according to the scaling level, false if the value should be taken as is.
        Since:
        1.6
      • MultiColumnResizeCommand

        protected MultiColumnResizeCommand​(MultiColumnResizeCommand command)
        Constructor used to clone the given command.
        Parameters:
        command - The command to clone.
    • Method Detail

      • getCommonColumnWidth

        public int getCommonColumnWidth()
        Returns:
        The common column width if all columns should be resized to the same width, or -1 if the columns should be resized to different values.
      • getColumnWidth

        public int getColumnWidth​(int columnPosition)
        Parameters:
        columnPosition - The column position for which the new width is requested.
        Returns:
        The new column width for the requested position.
      • downScaleValue

        public boolean downScaleValue()
        Returns:
        true if the column width value should be down scaled according to the scaling level, false if the value should be taken as is.
        Since:
        1.6
      • convertToTargetLayer

        public boolean convertToTargetLayer​(ILayer targetLayer)
        Convert the column positions to the target layer. Ensure that the width associated with the column is now associated with the converted column position.
        Specified by:
        convertToTargetLayer in interface ILayerCommand
        Overrides:
        convertToTargetLayer in class AbstractMultiColumnCommand
        Parameters:
        targetLayer - the target layer
        Returns:
        true if the command is valid after conversion, false if the command is no longer valid.