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$$$()
void
doubleClick(ActionEvent event)
Called when a double click occurs.void
fireTableDataChanged()
Notifies all listeners that all cell values in the table's rows may have changed.BeaTunes
getApplication()
Returns the main application component.String
getColumnPreferencesKey()
JComponent
getComponent()
JPopupMenu
getContextMenu()
String
getId()
Unique id for each instance of this object.JScrollPane
getScrollPane()
List<AudioSong>
getSelectedSongs()
AudioSong
getSong(int row)
JTable
getSongTable()
void
init()
Initializes this component and its sub-components.void
registerDoubleClick(String actionId)
Registers an action to perform on double clicks.void
setApplication(BeaTunes beaTunes)
Sets the main application component.void
setColumnPreferencesKey(String columnPreferencesKey)
void
setSongModel(AbstractSongTableModel model)
Re-initializes this table with the given model.void
setSongs(Iterable<AudioSong> songs)
Re-initializes this table with the given songs.void
shutdown()
Shuts down this component and its sub-components.void
storeColumnPreferences()
-
-
-
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:DoubleClickListener
Called when a double click occurs.- Specified by:
doubleClick
in interfaceDoubleClickListener
- Parameters:
event
- event
-
getApplication
public BeaTunes getApplication()
Description copied from interface:ApplicationComponent
Returns the main application component.- Specified by:
getApplication
in interfaceApplicationComponent<BeaTunes>
- Returns:
- application object
-
setApplication
public void setApplication(BeaTunes beaTunes)
Description copied from interface:ApplicationComponent
Sets the main application component.- Specified by:
setApplication
in interfaceApplicationComponent<BeaTunes>
- Parameters:
beaTunes
- main application component
-
getId
public String getId()
Description copied from interface:ApplicationComponent
Unique id for each instance of this object.- Specified by:
getId
in interfaceApplicationComponent<BeaTunes>
- Returns:
- id
-
init
public void init()
Description copied from interface:ApplicationComponent
Initializes this component and its sub-components.- Specified by:
init
in interfaceApplicationComponent<BeaTunes>
-
shutdown
public void shutdown()
Description copied from interface:ApplicationComponent
Shuts down this component and its sub-components.- Specified by:
shutdown
in 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 theJTable
should 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$$$()
-
-