Example usage for javax.swing.event TableModelEvent TableModelEvent

List of usage examples for javax.swing.event TableModelEvent TableModelEvent

Introduction

In this page you can find the example usage for javax.swing.event TableModelEvent TableModelEvent.

Prototype

public TableModelEvent(TableModel source, int row) 

Source Link

Document

This row of data has been updated.

Usage

From source file:blue.soundObject.tracker.TrackList.java

public TrackList() {
    columnChangeListener = new TableModelListener() {
        public void tableChanged(TableModelEvent e) {
            TableModelEvent tme = new TableModelEvent(TrackList.this, TableModelEvent.HEADER_ROW);
            fireTableModelEvent(tme);//from   w  w  w . j av  a2s.  c  o  m
        }
    };
}

From source file:blue.soundObject.tracker.TrackList.java

public void addTrack(Track track) {
    tracks.add(track);//from w w  w .j a v a2  s  .c  om
    track.resizeSteps(steps);

    track.addTableModelListener(columnChangeListener);

    if (listeners != null) {
        TableModelEvent tme = new TableModelEvent(this, TableModelEvent.HEADER_ROW);
        fireTableModelEvent(tme);
    }
}

From source file:blue.soundObject.tracker.TrackList.java

public void addTrack(int index, Track track) {
    tracks.add(index, track);/*from   w  w  w .j av a  2s.  c o m*/
    track.resizeSteps(steps);

    track.addTableModelListener(columnChangeListener);

    if (listeners != null) {
        TableModelEvent tme = new TableModelEvent(this, TableModelEvent.HEADER_ROW);
        fireTableModelEvent(tme);
    }
}

From source file:blue.soundObject.tracker.TrackList.java

public void removeTrack(Track track) {
    tracks.remove(track);// ww w.  ja v  a2s.co m
    track.removeAllPropertyChangeListeners();

    track.removeTableModelListener(columnChangeListener);

    if (listeners != null) {
        TableModelEvent tme = new TableModelEvent(this, TableModelEvent.HEADER_ROW);
        fireTableModelEvent(tme);
    }
}

From source file:blue.soundObject.jmask.ItemList.java

public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
    if (aValue instanceof Double) {
        listItems.remove(rowIndex);//from  w w w.  j  av  a 2 s  .co  m
        listItems.add(rowIndex, aValue);
    }

    TableModelEvent tme = new TableModelEvent(this, rowIndex);

    fireTableUpdated(tme);
}

From source file:blue.soundObject.tracker.TrackList.java

private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {

    in.defaultReadObject();/* w  w w  .ja v a 2s . c  om*/

    columnChangeListener = new TableModelListener() {
        public void tableChanged(TableModelEvent e) {
            TableModelEvent tme = new TableModelEvent(TrackList.this, TableModelEvent.HEADER_ROW);
            fireTableModelEvent(tme);
        }
    };

    for (Iterator it = tracks.iterator(); it.hasNext();) {
        Track t = (Track) it.next();
        t.addTableModelListener(columnChangeListener);
    }
}

From source file:org.jdal.swing.ListTableModel.java

/**
 * Fire a model table changed/* w  w  w  . ja va2 s  . c o  m*/
 */
public void fireTableChanged() {
    fireTableChanged(new TableModelEvent(this, TableModelEvent.HEADER_ROW));
}

From source file:org.wings.STable.java

/**
 * <p>Sets the model of the table.</p>
 *
 * @param tm the <code>TableModel</code> to set.
 *///from   w  w  w. j a  v a2  s  .  co  m
public void setModel(TableModel tm) {
    if (tm == null)
        throw new IllegalArgumentException("Cannot set a null TableModel");

    TableModel oldVal = this.model;
    if (this.model != tm) {
        if (model != null)
            model.removeTableModelListener(this);

        model = tm;
        model.addTableModelListener(this);

        tableChanged(new TableModelEvent(tm, TableModelEvent.HEADER_ROW));
    }
    propertyChangeSupport.firePropertyChange("model", oldVal, this.model);
}