Package com.tagtraum.beatunes.songtable
Class SongTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- com.tagtraum.beatunes.AbstractSongTableModel
-
- com.tagtraum.beatunes.songtable.SongTableModel
-
- All Implemented Interfaces:
FilterTableModel<AudioSong>
,Serializable
,TableModel
public class SongTableModel extends AbstractSongTableModel
MainAudioSong
table model.- Author:
- Hendrik Schreiber
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description SongTableModel(BeaTunes beaTunes)
Empty model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fireTableDataChanged()
void
fireTableStructureChanged()
Long
getPersistentIDAt(int rowIndex)
PlayList
getPlayList()
Currently displayed playlist.int
getRowCount()
int
getUnfilteredRow(int row)
Returns unfiltered row index for a given row index.AudioSong
getValueAt(int rowIndex)
protected Object
getValueAt(AudioSong song, int rowIndex, int columnIndex)
Returns the Song property for a specific column.int
indexOf(long id)
First index for object with given id.int
indexOf(AudioSong song)
First index for object.void
setPlayList(PlayList playList)
-
Methods inherited from class com.tagtraum.beatunes.AbstractSongTableModel
addPropertyChangeListener, firePropertyChange, fireTableRowsRepaint, getApplication, getColumnCount, getValueAt, isCellEditable, isItemsEditable, setApplication, setItemsEditable, setValue, setValueAt
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, getColumnClass, getColumnName, getListeners, getTableModelListeners, removeTableModelListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tagtraum.beatunes.filter.FilterTableModel
getTableModelListeners
-
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnName, removeTableModelListener
-
-
-
-
Constructor Detail
-
SongTableModel
public SongTableModel(BeaTunes beaTunes)
Empty model.- Parameters:
beaTunes
- beaTunes
-
-
Method Detail
-
getPlayList
public PlayList getPlayList()
Currently displayed playlist. Might be null.- Returns:
- playlist or null, if none is set at the moment
-
setPlayList
public void setPlayList(PlayList playList)
- Parameters:
playList
- playlist
-
getRowCount
public int getRowCount()
-
getValueAt
public AudioSong getValueAt(int rowIndex)
- Parameters:
rowIndex
- index- Returns:
- the value at the indicated row or null
-
getPersistentIDAt
public Long getPersistentIDAt(int rowIndex)
-
getValueAt
protected Object getValueAt(AudioSong song, int rowIndex, int columnIndex)
Returns the Song property for a specific column.- Overrides:
getValueAt
in classAbstractSongTableModel
- Parameters:
song
- songrowIndex
- rowcolumnIndex
- property- Returns:
- the requested song property
-
indexOf
public int indexOf(AudioSong song)
Description copied from interface:FilterTableModel
First index for object.- Parameters:
song
- object to look for- Returns:
- index of the object or
-1
if not found
-
indexOf
public int indexOf(long id)
Description copied from interface:FilterTableModel
First index for object with given id.- Parameters:
id
- object id- Returns:
- index of the corresponding object or
-1
if not found
-
getUnfilteredRow
public int getUnfilteredRow(int row)
Description copied from interface:FilterTableModel
Returns unfiltered row index for a given row index.- Specified by:
getUnfilteredRow
in interfaceFilterTableModel<AudioSong>
- Overrides:
getUnfilteredRow
in classAbstractSongTableModel
- Parameters:
row
- filtered row- Returns:
- unfiltered row or -1 if not found
-
fireTableDataChanged
public void fireTableDataChanged()
- Overrides:
fireTableDataChanged
in classAbstractTableModel
-
fireTableStructureChanged
public void fireTableStructureChanged()
- Overrides:
fireTableStructureChanged
in classAbstractTableModel
-
-