Package com.tagtraum.beatunes.filter
Class PlayListSorter
- java.lang.Object
-
- javax.swing.RowSorter<AbstractSongTableModel>
-
- com.tagtraum.beatunes.filter.SongTableRowSorter
-
- com.tagtraum.beatunes.filter.PlayListSorter
-
- All Implemented Interfaces:
SyncTempoAware
public class PlayListSorter extends SongTableRowSorter implements SyncTempoAware
Sorter forPlayList
s that already support filtering and sorting.- Author:
- Hendrik Schreiber
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.RowSorter
RowSorter.SortKey
-
-
Constructor Summary
Constructors Constructor Description PlayListSorter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
allRowsChanged()
int
convertRowIndexToModel(int index)
int
convertRowIndexToView(int index)
AbstractSongTableModel
getModel()
int
getModelRowCount()
PlayList
getPlaylist()
SubstringRowFilter
getRowFilter()
Return row filter.List<? extends RowSorter.SortKey>
getSortKeys()
int
getViewRowCount()
void
modelStructureChanged()
void
nextSortConfig(int column)
Changes theSongTableColumn.SortConfig
that is used for a given model.void
rowsDeleted(int firstRow, int endRow)
void
rowsInserted(int firstRow, int endRow)
void
rowsUpdated(int firstRow, int endRow)
void
rowsUpdated(int firstRow, int endRow, int column)
void
setModel(AbstractSongTableModel model)
Sets the underlying unsorted, unfiltered model.void
setPlaylist(PlayList playlist)
void
setRowFilter(SubstringRowFilter rowFilter)
Sets row filter.void
setSortKeys(List<? extends RowSorter.SortKey> keys)
void
setSyncTempo(com.tagtraum.audiokern.bpm.Tempo syncTempo)
Sets the sync tempo.void
toggleSortOrder(int column)
-
Methods inherited from class com.tagtraum.beatunes.filter.SongTableRowSorter
fireRowSorterChanged, fireSortOrderChanged
-
Methods inherited from class javax.swing.RowSorter
addRowSorterListener, removeRowSorterListener
-
-
-
-
Method Detail
-
setSyncTempo
public void setSyncTempo(com.tagtraum.audiokern.bpm.Tempo syncTempo)
Description copied from interface:SyncTempoAware
Sets the sync tempo. May be unset by calling this method withnull
as parameter.- Specified by:
setSyncTempo
in interfaceSyncTempoAware
- Parameters:
syncTempo
- sync tempo
-
getPlaylist
public PlayList getPlaylist()
-
setPlaylist
public void setPlaylist(PlayList playlist)
-
setModel
public void setModel(AbstractSongTableModel model)
Description copied from class:SongTableRowSorter
Sets the underlying unsorted, unfiltered model.- Specified by:
setModel
in classSongTableRowSorter
- Parameters:
model
- table model
-
getModel
public AbstractSongTableModel getModel()
- Specified by:
getModel
in classRowSorter<AbstractSongTableModel>
-
setRowFilter
public void setRowFilter(SubstringRowFilter rowFilter)
Description copied from class:SongTableRowSorter
Sets row filter.- Specified by:
setRowFilter
in classSongTableRowSorter
- Parameters:
rowFilter
- filter
-
getRowFilter
public SubstringRowFilter getRowFilter()
Description copied from class:SongTableRowSorter
Return row filter.- Specified by:
getRowFilter
in classSongTableRowSorter
- Returns:
- filter
-
nextSortConfig
public void nextSortConfig(int column)
Description copied from class:SongTableRowSorter
Changes theSongTableColumn.SortConfig
that is used for a given model.- Specified by:
nextSortConfig
in classSongTableRowSorter
- Parameters:
column
- column index- See Also:
SortableTableColumn.ColumnDescriptor.nextSortConfig()
-
toggleSortOrder
public void toggleSortOrder(int column)
- Specified by:
toggleSortOrder
in classRowSorter<AbstractSongTableModel>
-
convertRowIndexToModel
public int convertRowIndexToModel(int index)
- Specified by:
convertRowIndexToModel
in classRowSorter<AbstractSongTableModel>
-
convertRowIndexToView
public int convertRowIndexToView(int index)
- Specified by:
convertRowIndexToView
in classRowSorter<AbstractSongTableModel>
-
setSortKeys
public void setSortKeys(List<? extends RowSorter.SortKey> keys)
- Specified by:
setSortKeys
in classRowSorter<AbstractSongTableModel>
-
getSortKeys
public List<? extends RowSorter.SortKey> getSortKeys()
- Specified by:
getSortKeys
in classRowSorter<AbstractSongTableModel>
-
getViewRowCount
public int getViewRowCount()
- Specified by:
getViewRowCount
in classRowSorter<AbstractSongTableModel>
-
getModelRowCount
public int getModelRowCount()
- Specified by:
getModelRowCount
in classRowSorter<AbstractSongTableModel>
-
modelStructureChanged
public void modelStructureChanged()
- Specified by:
modelStructureChanged
in classRowSorter<AbstractSongTableModel>
-
allRowsChanged
public void allRowsChanged()
- Specified by:
allRowsChanged
in classRowSorter<AbstractSongTableModel>
-
rowsInserted
public void rowsInserted(int firstRow, int endRow)
- Specified by:
rowsInserted
in classRowSorter<AbstractSongTableModel>
-
rowsDeleted
public void rowsDeleted(int firstRow, int endRow)
- Specified by:
rowsDeleted
in classRowSorter<AbstractSongTableModel>
-
rowsUpdated
public void rowsUpdated(int firstRow, int endRow)
- Specified by:
rowsUpdated
in classRowSorter<AbstractSongTableModel>
-
rowsUpdated
public void rowsUpdated(int firstRow, int endRow, int column)
- Specified by:
rowsUpdated
in classRowSorter<AbstractSongTableModel>
-
-