Class PivotDataEvent


  • public class PivotDataEvent
    extends Object
    A data event is used to notify listeners that a pivot model has changed.
    Author:
    jumperchen
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALL_COLUMNS
      Specifies all columns in a row or rows.
      static int DELETE
      Identifies the removal of rows or columns.
      static int HEADER_ROW
      Identifies the header row.
      static int INSERT
      Identifies the addition of new rows or columns.
      static int UPDATE
      Identifies a change to existing data.
    • Constructor Summary

      Constructors 
      Constructor Description
      PivotDataEvent​(PivotModel model)
      All row data in the pivot model has changed, listeners should discard any state that was based on the rows and requery the PivotModel to get the new row count and all the appropriate values.
      PivotDataEvent​(PivotModel model, int row)
      This row of data has been updated.
      PivotDataEvent​(PivotModel model, int firstRow, int lastRow)
      The data in rows [firstRow, lastRow] have been updated.
      PivotDataEvent​(PivotModel model, int firstRow, int lastRow, int column)
      The cells in column column in the range [firstRow, lastRow] have been updated.
      PivotDataEvent​(PivotModel model, int firstRow, int lastRow, int column, int type)
      The cells from (firstRow, column) to (lastRow, column) have been changed.
    • Field Detail

      • UPDATE

        public static final int UPDATE
        Identifies a change to existing data.
        See Also:
        Constant Field Values
      • DELETE

        public static final int DELETE
        Identifies the removal of rows or columns.
        See Also:
        Constant Field Values
      • INSERT

        public static final int INSERT
        Identifies the addition of new rows or columns.
        See Also:
        Constant Field Values
      • HEADER_ROW

        public static final int HEADER_ROW
        Identifies the header row.
        See Also:
        Constant Field Values
      • ALL_COLUMNS

        public static final int ALL_COLUMNS
        Specifies all columns in a row or rows.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PivotDataEvent

        public PivotDataEvent​(PivotModel model)
        All row data in the pivot model has changed, listeners should discard any state that was based on the rows and requery the PivotModel to get the new row count and all the appropriate values. The Pivottable will render the entire visible region on receiving this event, querying the model for the cell values that are visible. The structure of the pivot table i.e., the column names, types and order have not changed.
      • PivotDataEvent

        public PivotDataEvent​(PivotModel model,
                              int row)
        This row of data has been updated. To denote the arrival of a completely new pivot table with a different structure use HEADER_ROW as the value for the row. This is the same as calling setModel(PivotModel) on the Pivottable.
      • PivotDataEvent

        public PivotDataEvent​(PivotModel model,
                              int firstRow,
                              int lastRow)
        The data in rows [firstRow, lastRow] have been updated.
      • PivotDataEvent

        public PivotDataEvent​(PivotModel model,
                              int firstRow,
                              int lastRow,
                              int column)
        The cells in column column in the range [firstRow, lastRow] have been updated.
      • PivotDataEvent

        public PivotDataEvent​(PivotModel model,
                              int firstRow,
                              int lastRow,
                              int column,
                              int type)
        The cells from (firstRow, column) to (lastRow, column) have been changed. The column refers to the column index of the cell in the model's co-ordinate system. When column is ALL_COLUMNS, all cells in the specified range of rows are considered changed.

        The type should be one of: INSERT, UPDATE and DELETE.

    • Method Detail

      • getPivotModel

        public PivotModel getPivotModel()
        Returns the pivot model which fires the event.
      • getFirstRow

        public int getFirstRow()
        Returns the first row that changed. HEADER_ROW means the meta data, ie. names, types and order of the columns.
      • getLastRow

        public int getLastRow()
        Returns the last row that changed.
      • getColumn

        public int getColumn()
        Returns the column for the event. If the return value is ALL_COLUMNS; it means every column in the specified rows changed.
      • getType

        public int getType()
        Returns the type of event - one of: INSERT, UPDATE and DELETE.