Package javax.swing.event

Examples of javax.swing.event.TableModelEvent


        sortingColumn = column;
        this.ascending = ascending;
        sortingColumns.removeAllElements();
        sortingColumns.addElement(new Integer(column));
        sort(this);
        super.tableChanged(new TableModelEvent(this));
    }
View Full Code Here


    public void removeTableModelListener(TableModelListener l) {
      listeners.remove(l);
    }

    void fireTableChanged() {
      TableModelEvent e = new TableModelEvent(this);
      for (TableModelListener l : new ArrayList<TableModelListener>(listeners)) {
        l.tableChanged(e);
      }
    }
View Full Code Here

      int column = e.getColumn();
      if (e.getFirstRow() == e.getLastRow()
          && column != TableModelEvent.ALL_COLUMNS
          && getSortingStatus(column) == NOT_SORTED && modelToView != null) {
        int viewIndex = getModelToView()[e.getFirstRow()];
        fireTableChanged(new TableModelEvent(TableSorter.this, viewIndex,
            viewIndex, column, e.getType()));
        return;
      }

      // Something has happened to the data that may have invalidated the row
View Full Code Here

        lastRow -= (getEnclosedModel().getRowCount() - getEnd());
      }
      final int type = e.getType();
      final int column = e.getColumn();

      final TableModelEvent event =
          new TableModelEvent(SubSetTableModel.this, firstRow, lastRow, column, type);

      for (int i = 0; i < listeners.size(); i++)
      {
        final TableModelListener l = (TableModelListener) listeners.get(i);
        l.tableChanged(event);
View Full Code Here

    public void modelChanged(ModelChangeEvent e) {
      if (message == null) {
        TableChangeEvent tce = (TableChangeEvent) e;

        TableModelEvent event =
          new TableModelEvent(
            this,
            tce.getFirstIndex(),
            tce.getLastIndex(),
            columnKeys.indexOf(tce.getKey()),
            tce.getType());
View Full Code Here

      final int lastRow = e.getLastRow();

      final int firstRowIndex = (firstRow / 2);
      final int lastRowIndex = (lastRow / 2);

      final TableModelEvent event =
          new TableModelEvent(WrappingTableModel.this, firstRowIndex, lastRowIndex,
              columnIndex, e.getType());

      for (int i = 0; i < listeners.size(); i++)
      {
        final TableModelListener l = (TableModelListener) listeners.get(i);
View Full Code Here

  public void setModel(TableModel model) {
    singleSortingColumn = -1;
    super.setModel(model);
    reallocateIndexes();
    fireTableChanged(new TableModelEvent(this, TableModelEvent.HEADER_ROW));
  }
View Full Code Here

  public void sortByColumn(int column) {
    sortingColumns.removeAllElements();
    sortingColumns.addElement(new Integer(column));
    sort(this);
    super.tableChanged(new TableModelEvent(this));
  }
View Full Code Here

            if (e.getFirstRow() == e.getLastRow()
                    && column != TableModelEvent.ALL_COLUMNS
                    && getSortingStatus(column) == NOT_SORTED
                    && modelToView != null) {
                int viewIndex = getModelToView()[e.getFirstRow()];
                fireTableChanged(new TableModelEvent(TableSorter.this,
                                                     viewIndex, viewIndex,
                                                     column, e.getType()));
                return;
            }
View Full Code Here

            table.validate();
        }

        public void clear() {
            items.clear();
            table.tableChanged(new TableModelEvent(this));
        }
View Full Code Here

TOP

Related Classes of javax.swing.event.TableModelEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.