Search in sources :

Example 16 with TableModelEvent

use of javax.swing.event.TableModelEvent in project processdash by dtuma.

the class TaskScheduleDialog method evRecalculated.

public void evRecalculated(EventObject e) {
    recalcActiveMilestoneDateRow();
    // We have to manually generate events for the JTreeTable,
    // since it has installed some wrapper object to convert the
    // TreeTableModel into a TableModel.
    AbstractTableModel model = (AbstractTableModel) treeTable.getModel();
    model.fireTableChanged(new TableModelEvent(model, 0, treeTable.getRowCount() - 1));
    // Calculating the schedule may mean that direct time columns now
    // need to be displayed or hidden
    showHideColumns();
    // Since rows may have been added or deleted to the schedule, and
    // rows may have changed to or from automatic rows, update the
    // buttons appropriately.
    enableScheduleButtons();
    // Display the error button if necessary.
    maybeDisplayErrorButton();
    // highlight any errors in the EVModel if they exist.
    highlightErrors(getErrors());
}
Also used : TableModelEvent(javax.swing.event.TableModelEvent) AbstractTableModel(javax.swing.table.AbstractTableModel)

Example 17 with TableModelEvent

use of javax.swing.event.TableModelEvent in project processdash by dtuma.

the class EVSchedule method firePreparedEvents.

synchronized void firePreparedEvents() {
    if (prevNumRows == -1) {
        fireTableChanged(null);
        return;
    }
    int currNumRows = getRowCount();
    int changedRows = (currNumRows < prevNumRows ? currNumRows : prevNumRows);
    // fire an event to redraw rows that previously might have been
    // automatic.
    fireTableChanged(new TableModelEvent(this, 0, changedRows - 1, TableModelEvent.ALL_COLUMNS, TableModelEvent.UPDATE));
    if (prevNumRows < currNumRows)
        // fire a "rows added" event.
        fireTableChanged(new TableModelEvent(this, prevNumRows, currNumRows - 1, TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT));
    else if (prevNumRows > currNumRows)
        // fire a "rows deleted" event.
        fireTableChanged(new TableModelEvent(this, currNumRows, prevNumRows - 1, TableModelEvent.ALL_COLUMNS, TableModelEvent.DELETE));
    prevNumRows = -1;
}
Also used : TableModelEvent(javax.swing.event.TableModelEvent)

Example 18 with TableModelEvent

use of javax.swing.event.TableModelEvent in project processdash by dtuma.

the class EVMetrics method resetValidMetrics.

protected void resetValidMetrics() {
    validMetrics = null;
    fireTableChanged(new TableModelEvent(this));
}
Also used : TableModelEvent(javax.swing.event.TableModelEvent)

Example 19 with TableModelEvent

use of javax.swing.event.TableModelEvent in project processdash by dtuma.

the class EVSchedule method deleteRow.

public synchronized void deleteRow(int row) {
    Period r = get(row + 1);
    if (r == null || r.automatic)
        return;
    remove(row + 1);
    // send a "row deleted" event.
    fireTableChanged(new TableModelEvent(this, row, row, TableModelEvent.ALL_COLUMNS, TableModelEvent.DELETE));
    // signal the need to recalculate all the schedule data.
    fireNeedsRecalc();
}
Also used : TableModelEvent(javax.swing.event.TableModelEvent)

Example 20 with TableModelEvent

use of javax.swing.event.TableModelEvent in project processdash by dtuma.

the class DefectDataBag method selectUnselectAll.

public void selectUnselectAll(boolean select) {
    Object newVal = (select ? Boolean.TRUE : Boolean.FALSE);
    for (Iterator i = defectData.iterator(); i.hasNext(); ) {
        Map row = (Map) i.next();
        row.put(ATTRS[INCLUDED], newVal);
    }
    fireTableChanged(new TableModelEvent(this, 0, getRowCount() - 1, INCLUDED));
}
Also used : TableModelEvent(javax.swing.event.TableModelEvent) Iterator(java.util.Iterator) Map(java.util.Map)

Aggregations

TableModelEvent (javax.swing.event.TableModelEvent)35 TableModelListener (javax.swing.event.TableModelListener)15 DefaultTableModel (javax.swing.table.DefaultTableModel)6 ActionEvent (java.awt.event.ActionEvent)4 ActionListener (java.awt.event.ActionListener)4 ArrayList (java.util.ArrayList)4 JScrollPane (javax.swing.JScrollPane)4 TableColumn (javax.swing.table.TableColumn)4 JBTable (com.intellij.ui.table.JBTable)3 Dimension (java.awt.Dimension)3 GridBagConstraints (java.awt.GridBagConstraints)3 Insets (java.awt.Insets)3 JButton (javax.swing.JButton)3 JTable (javax.swing.JTable)3 ListSelectionEvent (javax.swing.event.ListSelectionEvent)3 ListSelectionListener (javax.swing.event.ListSelectionListener)3 GridBagLayout (java.awt.GridBagLayout)2 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)2 JComboBox (javax.swing.JComboBox)2 JPanel (javax.swing.JPanel)2