Class ColumnReorderEvent

All Implemented Interfaces:
ILayerEvent, IStructuralChangeEvent, IVisualChangeEvent

public class ColumnReorderEvent extends ColumnStructuralChangeEvent
Event indicating that one or multiple columns are moved to a new position.
  • Constructor Details

    • ColumnReorderEvent

      public ColumnReorderEvent(ILayer layer, int beforeFromColumnPosition, int beforeFromColumnIndex, int beforeToColumnPosition, int beforeToColumnIndex, boolean reorderToLeftEdge)
      Parameters:
      layer - The layer to which the column positions match.
      beforeFromColumnPosition - The column position that was reordered, before the reorder operation was performed.
      beforeFromColumnIndex - The index of the reordered position.
      beforeToColumnPosition - The position of the column to which the reorder operation was performed, before the reorder operation was performed
      beforeToColumnIndex - The index of the column to which the reorder operation was performed.
      reorderToLeftEdge - whether the reorder operation was performed to the left or the right edge.
      Since:
      1.6
    • ColumnReorderEvent

      public ColumnReorderEvent(ILayer layer, List<Integer> beforeFromColumnPositions, List<Integer> beforeFromColumnIndexes, int beforeToColumnPosition, int beforeToColumnIndex, boolean reorderToLeftEdge)
      Parameters:
      layer - The layer to which the column positions match.
      beforeFromColumnPositions - The column positions that were reordered, before the reorder operation was performed.
      beforeFromColumnIndexes - The indexes of the reordered positions.
      beforeToColumnPosition - The position of the column to which the reorder operation was performed, before the reorder operation was performed
      beforeToColumnIndex - The index of the column to which the reorder operation was performed.
      reorderToLeftEdge - whether the reorder operation was performed to the left or the right edge.
      Since:
      1.6
    • ColumnReorderEvent

      public ColumnReorderEvent(ILayer layer, int[] beforeFromColumnPositions, int[] beforeFromColumnIndexes, int beforeToColumnPosition, int beforeToColumnIndex, boolean reorderToLeftEdge)
      Parameters:
      layer - The layer to which the column positions match.
      beforeFromColumnPositions - The column positions that were reordered, before the reorder operation was performed.
      beforeFromColumnIndexes - The indexes of the reordered positions.
      beforeToColumnPosition - The position of the column to which the reorder operation was performed, before the reorder operation was performed
      beforeToColumnIndex - The index of the column to which the reorder operation was performed.
      reorderToLeftEdge - whether the reorder operation was performed to the left or the right edge.
      Since:
      2.0
    • ColumnReorderEvent

      public ColumnReorderEvent(ColumnReorderEvent event)
      Constructor for internal use to clone this event.
      Parameters:
      event - The event out of which the new one should be created
  • Method Details

    • getBeforeFromColumnIndexes

      public Collection<Integer> getBeforeFromColumnIndexes()
      Returns:
      The indexes of the reordered columns.
      Since:
      1.6
    • getBeforeFromColumnIndexesArray

      public int[] getBeforeFromColumnIndexesArray()
      Returns:
      The indexes of the reordered columns.
      Since:
      2.0
    • getBeforeFromColumnPositionRanges

      public Collection<Range> getBeforeFromColumnPositionRanges()
      Returns:
      The position ranges of the reordered columns.
    • getBeforeToColumnPosition

      public int getBeforeToColumnPosition()
      Returns:
      The position of the column to which the reorder operation was performed.
    • getBeforeToColumnIndex

      public int getBeforeToColumnIndex()
      Returns:
      The index of the column to which the reorder operation was performed.
      Since:
      1.6
    • setBeforeToColumnIndex

      public void setBeforeToColumnIndex(int beforeIndex)
      Setter for the beforeToColumnIndex that needs to be called used in case a reorder operation was performed to a hidden column.
      Parameters:
      beforeIndex - The index of the column to which the reorder operation was performed.
      Since:
      1.6
    • isReorderToLeftEdge

      public boolean isReorderToLeftEdge()
      Returns:
      true if the columns were reordered to the left edge of the toColumnPosition, false if the reorder operation was performed on the right edge (e.g. at the end of a table)
    • getColumnDiffs

      public Collection<StructuralDiff> getColumnDiffs()
    • setConvertedBeforePositions

      public void setConvertedBeforePositions(ILayer layer, Collection<Range> fromColumnPositionRanges, int toColumnPosition)
      This method is intended to be used for position conversion of the before positions. The locally stored before positions are the positions of the reordered columns positions before the reorder is applied. Needed in case the conversion needs to be done before other states in the given layer are updated, and therefore the local before position cannot be determined anymore.
      Parameters:
      layer - The layer that performed the conversion of the before positions.
      fromColumnPositionRanges - The converted column position ranges that were reordered before the reorder happened.
      toColumnPosition - The converted column position to which a reorder happened before the reordering was performed.
      Since:
      1.6
    • convertToLocal

      public boolean convertToLocal(ILayer targetLayer)
      Description copied from interface: ILayerEvent
      Convert the column/row positions carried by the event to the layer about to handle the event.
      Specified by:
      convertToLocal in interface ILayerEvent
      Overrides:
      convertToLocal in class ColumnVisualChangeEvent
      Parameters:
      targetLayer - layer about to receive the event
      Returns:
      TRUE if successfully converted, FALSE otherwise
    • cloneEvent

      public ColumnReorderEvent cloneEvent()
      Returns:
      A cloned copy of the event. This cloned copy is provided to each listener.