|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
de.axelwernicke.mypod.ClipsTableModel
Model for a list view table. The model is mostly a wrapper around a playlist. Additionally all the stuff to sort a table by columns is in here...
| Field Summary |
| Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
| Constructor Summary | |
ClipsTableModel()
Default Constructor |
|
ClipsTableModel(Playlist _playlist)
Creates a new instance of ListViewModel and initializes with playlist. |
|
ClipsTableModel(Playlist _playlist,
java.util.Vector _sortingColumns)
Creates a new instance of ListViewModel and initializes with playlist and sorting. |
|
| Method Summary | |
int |
compare(int row1,
int row2)
Compares two values of a column to sort by |
int |
compareRowsByColumn(int row1,
int row2,
int column)
Compares two elements of a column. |
java.lang.Class |
getColumnClass(int column)
gets the class of a column |
int |
getColumnCount()
Gets the column count of the table. |
java.lang.String |
getColumnName(int column)
gets the column name and adds a mark, if the table is sorted by this row |
Playlist |
getPlaylist()
Gets the playlist behind the model. |
int |
getRowCount()
gets the total count of rows in the model |
java.util.Vector |
getSortingColumns()
Getter for property sortingColumns. |
java.lang.Object |
getValueAt(int row,
int col)
gets a value of the model |
boolean |
isValid()
Checks if the data in the model has the same count of rows as the sorting index array. |
void |
reallocateIndexes()
Reallocates sorting index. |
void |
setPlaylist(Playlist value)
Sets a playlist to the model. |
void |
setSortingColumns(java.util.Vector _sortingColumns)
Setter for property sortingColumns. |
void |
shuttlesort(int[] from,
int[] to,
int low,
int high)
This is a home-grown implementation which we have not had time to research - it may perform poorly in some circumstances. |
void |
sort()
Sort the model. |
void |
sortByColumn(int column)
Sorts a a table model by column ascending. |
void |
sortByColumn(int column,
boolean ascending)
Sorts a a table model by column. |
void |
swap(int i,
int j)
Swaps two elements. |
void |
tableChanged(javax.swing.event.TableModelEvent tableModelEvent)
Inform everbody listening that the model changed. |
void |
validate()
validates list view table model. |
| Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ClipsTableModel()
public ClipsTableModel(Playlist _playlist)
_playlist - Playlist to initialize table with.
public ClipsTableModel(Playlist _playlist,
java.util.Vector _sortingColumns)
_sortingColumns - columns to define sorting._playlist - Playlist to initialize playlist from.| Method Detail |
public void setPlaylist(Playlist value)
value - Playlist to set.public Playlist getPlaylist()
public int getColumnCount()
getColumnCount in interface javax.swing.table.TableModelpublic java.lang.String getColumnName(int column)
getColumnName in interface javax.swing.table.TableModelcolumn - index of the column
public java.lang.Class getColumnClass(int column)
getColumnClass in interface javax.swing.table.TableModelcolumn - index of the column
public int getRowCount()
getRowCount in interface javax.swing.table.TableModel
public java.lang.Object getValueAt(int row,
int col)
getValueAt in interface javax.swing.table.TableModelrow - specifies the rowcol - specifies the column
public boolean isValid()
public void validate()
public void tableChanged(javax.swing.event.TableModelEvent tableModelEvent)
tableChanged in interface javax.swing.event.TableModelListenertableModelEvent - event to postpublic void reallocateIndexes()
public int compareRowsByColumn(int row1,
int row2,
int column)
row1 - to comparerow2 - to comparecolumn - to compare
public int compare(int row1,
int row2)
row1 - value1row2 - value2
public void sort()
public void shuttlesort(int[] from,
int[] to,
int low,
int high)
from - source arrayto - destination arraylow - indexhigh - index
public void swap(int i,
int j)
i - element to swap.j - element to swap.public void sortByColumn(int column)
column - to sort by
public void sortByColumn(int column,
boolean ascending)
column - to sort byascending - sorting oderpublic java.util.Vector getSortingColumns()
public void setSortingColumns(java.util.Vector _sortingColumns)
_sortingColumns - vector containing the columns to sort the table by.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||