Package com.tagtraum.beatunes
Class SimpleSongTable
- java.lang.Object
-
- com.tagtraum.beatunes.SimpleSongTable
-
- All Implemented Interfaces:
DoubleClickListener,ApplicationComponent<BeaTunes>
public class SimpleSongTable extends Object implements ApplicationComponent<BeaTunes>, DoubleClickListener
Simple read-only song table backed by a List of Songs. No actions are enabled.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description SimpleSongTable(BeaTunes application)SimpleSongTable(BeaTunes application, Iterable<AudioSong> songs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JComponent$$$getRootComponent$$$()voiddoubleClick(ActionEvent event)Called when a double click occurs.voidfireTableDataChanged()Notifies all listeners that all cell values in the table's rows may have changed.BeaTunesgetApplication()Returns the main application component.StringgetColumnPreferencesKey()JComponentgetComponent()JPopupMenugetContextMenu()StringgetId()Unique id for each instance of this object.JScrollPanegetScrollPane()List<AudioSong>getSelectedSongs()AudioSonggetSong(int row)JTablegetSongTable()voidinit()Initializes this component and its sub-components.voidregisterDoubleClick(String actionId)Registers an action to perform on double clicks.voidsetApplication(BeaTunes beaTunes)Sets the main application component.voidsetColumnPreferencesKey(String columnPreferencesKey)voidsetSongModel(AbstractSongTableModel model)Re-initializes this table with the given model.voidsetSongs(Iterable<AudioSong> songs)Re-initializes this table with the given songs.voidshutdown()Shuts down this component and its sub-components.voidstoreColumnPreferences()
-
-
-
Method Detail
-
getContextMenu
public JPopupMenu getContextMenu()
-
registerDoubleClick
public void registerDoubleClick(String actionId)
Registers an action to perform on double clicks.- Parameters:
actionId- id
-
doubleClick
public void doubleClick(ActionEvent event)
Description copied from interface:DoubleClickListenerCalled when a double click occurs.- Specified by:
doubleClickin interfaceDoubleClickListener- Parameters:
event- event
-
getApplication
public BeaTunes getApplication()
Description copied from interface:ApplicationComponentReturns the main application component.- Specified by:
getApplicationin interfaceApplicationComponent<BeaTunes>- Returns:
- application object
-
setApplication
public void setApplication(BeaTunes beaTunes)
Description copied from interface:ApplicationComponentSets the main application component.- Specified by:
setApplicationin interfaceApplicationComponent<BeaTunes>- Parameters:
beaTunes- main application component
-
getId
public String getId()
Description copied from interface:ApplicationComponentUnique id for each instance of this object.- Specified by:
getIdin interfaceApplicationComponent<BeaTunes>- Returns:
- id
-
init
public void init()
Description copied from interface:ApplicationComponentInitializes this component and its sub-components.- Specified by:
initin interfaceApplicationComponent<BeaTunes>
-
shutdown
public void shutdown()
Description copied from interface:ApplicationComponentShuts down this component and its sub-components.- Specified by:
shutdownin interfaceApplicationComponent<BeaTunes>
-
storeColumnPreferences
public void storeColumnPreferences()
-
getColumnPreferencesKey
public String getColumnPreferencesKey()
-
setColumnPreferencesKey
public void setColumnPreferencesKey(String columnPreferencesKey)
-
setSongs
public void setSongs(Iterable<AudioSong> songs)
Re-initializes this table with the given songs.- Parameters:
songs- song list
-
setSongModel
public void setSongModel(AbstractSongTableModel model)
Re-initializes this table with the given model.- Parameters:
model- song model
-
getSong
public AudioSong getSong(int row)
-
getComponent
public JComponent getComponent()
-
getScrollPane
public JScrollPane getScrollPane()
-
getSongTable
public JTable getSongTable()
-
fireTableDataChanged
public void fireTableDataChanged()
Notifies all listeners that all cell values in the table's rows may have changed. The number of rows may also have changed and theJTableshould redraw the table from scratch. The structure of the table (as in the order of the columns) is assumed to be the same.
-
$$$getRootComponent$$$
public JComponent $$$getRootComponent$$$()
-
-