Class FillHandlePasteCommandHandler

All Implemented Interfaces:
Direct Known Subclasses:

public class FillHandlePasteCommandHandler extends Object implements ILayerCommandHandler<FillHandlePasteCommand>
Command handler for the FillHandlePasteCommand.
See Also:
  • Field Details

  • Constructor Details

    • FillHandlePasteCommandHandler

      public FillHandlePasteCommandHandler(SelectionLayer selectionLayer, InternalCellClipboard clipboard)
      selectionLayer - The SelectionLayer needed to determine the fill handle region and perform the update command.
      clipboard - The internal clipboard that carries the cells for the copy & paste operation triggered by using the fill handle.
  • Method Details

    • doCommand

      public boolean doCommand(ILayer targetLayer, FillHandlePasteCommand command)
      Specified by:
      doCommand in interface ILayerCommandHandler<FillHandlePasteCommand>
      targetLayer - the target layer
      command - the command
      true if the command has been handled, false otherwise
    • getPasteValue

      protected Object getPasteValue(ILayerCell cell, FillHandlePasteCommand command, int toColumn, int toRow)
      Returns the value from the given cell that should be pasted to the given position.
      cell - The cell that is copied.
      command - The command that contains the necessary information for the paste operation.
      toColumn - The column position of the cell to which the value should be pasted.
      toRow - The row position of the cell to which the value should be pasted.
      The value that should be set to the given position.
    • calculateHorizontalDiff

      protected Number calculateHorizontalDiff(ILayerCell cell, int toRow, IConfigRegistry configRegistry)
    • calculateVerticalDiff

      protected Number calculateVerticalDiff(ILayerCell cell, int toColumn, IConfigRegistry configRegistry)
    • getRowDiff

      protected int getRowDiff(ILayerCell currentCell, int toRow)
      Calculate the row difference between the cell row index and the row index of the cell to copy to.
      currentCell - The current cell to manage.
      toRow - The row index of the cell to copy to.
      The difference as integer.
    • getColumnDiff

      protected int getColumnDiff(ILayerCell currentCell, int toColumn)
      Calculate the column difference between the cell column index and the column index of the cell to copy to.
      currentCell - The current cell to manage.
      toColumn - The column index of the cell to copy to.
      The difference as integer.
    • getCastValue

      protected Number getCastValue(int diff, Class<?> type)
    • calculateByteDiff

      protected Byte calculateByteDiff(ILayerCell c1, ILayerCell c2)
    • calculateShortDiff

      protected Short calculateShortDiff(ILayerCell c1, ILayerCell c2)
    • calculateIntDiff

      protected Integer calculateIntDiff(ILayerCell c1, ILayerCell c2)
    • calculateLongDiff

      protected Long calculateLongDiff(ILayerCell c1, ILayerCell c2)
    • calculateFloatDiff

      protected Float calculateFloatDiff(ILayerCell c1, ILayerCell c2)
    • calculateDoubleDiff

      protected Double calculateDoubleDiff(ILayerCell c1, ILayerCell c2)
    • calculateBigIntegerDiff

      protected BigInteger calculateBigIntegerDiff(ILayerCell c1, ILayerCell c2)
    • calculateBigDecimalDiff

      protected BigDecimal calculateBigDecimalDiff(ILayerCell c1, ILayerCell c2)
    • calculateDateDiff

      protected Integer calculateDateDiff(ILayerCell c1, ILayerCell c2, IConfigRegistry configRegistry)
    • getIncrementDateField

      protected int getIncrementDateField(ILayerCell cell, IConfigRegistry configRegistry)
    • getCommandClass

      public Class<FillHandlePasteCommand> getCommandClass()
      Specified by:
      getCommandClass in interface ILayerCommandHandler<FillHandlePasteCommand>