Class MultiRowResizeCommand

    • Constructor Detail

      • MultiRowResizeCommand

        public MultiRowResizeCommand​(ILayer layer,
                                     int[] rowPositions,
                                     int commonRowHeight)
        Create a MultiRowResizeCommand to resize multiple rows, where each row is resized to the same height, e.g. during a drag resize. The given row height will be taken as is without scaling.
        Parameters:
        layer - The ILayer to which the row positions correlate.
        rowPositions - The positions of the rows that should be resized.
        commonRowHeight - The row height that should be applied to all given rows.
      • MultiRowResizeCommand

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

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

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

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

      • getCommonRowHeight

        public int getCommonRowHeight()
        Returns:
        The common row height if all rows should be resized to the same height, or -1 if the rows should be resized to different values.
      • getRowHeight

        public int getRowHeight​(int rowPosition)
        Parameters:
        rowPosition - The row position for which the new height is requested.
        Returns:
        The new row height for the requested position.
      • downScaleValue

        public boolean downScaleValue()
        Returns:
        true if the row height 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)
        Description copied from interface: ILayerCommand
        Convert the row/column coordinates the command might be carrying from the source layer to the destination (target) layer. If it is not possible to convert the command to the target layer, then this method will return false and the state of this command object will remain unchanged. Note: Commands should not be processed if they fail conversion.
        Specified by:
        convertToTargetLayer in interface ILayerCommand
        Overrides:
        convertToTargetLayer in class AbstractMultiRowCommand
        Parameters:
        targetLayer - the target layer
        Returns:
        true if the command is valid after conversion, false if the command is no longer valid.