Package com.tagtraum.beatunes.songtable
Class SongTable
- java.lang.Object
-
- com.tagtraum.beatunes.songtable.SongTable
-
- All Implemented Interfaces:
DetailView,DoubleClickListener,TableView,View,ApplicationComponent<BeaTunes>
public class SongTable extends Object implements DetailView, TableView, DoubleClickListener, ApplicationComponent<BeaTunes>
Main song table in the UI.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description SongTable(MainWindow mainWindow)Creates the main song table.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JComponent$$$getRootComponent$$$()voiddoubleClick(ActionEvent event)Called when a double click occurs.BeaTunesgetApplication()Returns the main application component.JComponentgetComponent()The actual visual component for this view.SongTableModelgetFilterTableModel()Return the song table model.JComponentgetFocusRoot()The component that should be focused by default, when view is shown.StringgetId()Unique id for each instance of this object.MainWindowgetMainWindow()Returns the owning window.AudioSonggetSelectedSong()Returns the first selected song.JPanelgetSongContextButtonPanel()The panel the buttons/action forSongContextComponents live in.JComponentgetSongContextComponent()Returns currently selected song context component.List<SongContextComponent>getSongContextComponents()JPanelgetSongContextPanel()Returns the actual song context panel.@NotNull StringgetStatusLabel()Status label to show in the status bar when this component becomes visible.PlayList.SubstringFilterPropertygetSubstringFilterProperty()ButtonModelgetSyncButtonModel()SpinnerModelgetSyncTempoModel()JTablegetTable()The actual table component showing songs.voidinit()Initializes this component and its sub-components.booleanisIndeterminateProgress()Indicates that the current status is an operation with indeterminate progress which should be reflected in the rendering of the status bar.voidregisterDoubleClick(String actionId)Registers the id of the action to execute upon a double click.voidresetSorting()Clear all sorting flags and sort the current playlist by natural order.voidselect(long id)Select the given song in the current SongTable and scroll to it so that it becomes visible.voidselect(AudioSong song)Select the given song in the current SongTable and scroll to it so that it becomes visible.voidsetApplication(BeaTunes beaTunes)Sets the main application component.voidsetSongContextComponent(JComponent component)voidsetSubstringFilterProperty(PlayList.SubstringFilterProperty substringFilterProperty)voidshutdown()Shuts down this component and its sub-components.voidstartEditingPlaylistName()Start editing of the playlist's name.
-
-
-
Constructor Detail
-
SongTable
public SongTable(MainWindow mainWindow)
Creates the main song table.- Parameters:
mainWindow- main window
-
-
Method Detail
-
getSyncButtonModel
public ButtonModel getSyncButtonModel()
-
getSyncTempoModel
public SpinnerModel getSyncTempoModel()
-
getSubstringFilterProperty
public PlayList.SubstringFilterProperty getSubstringFilterProperty()
-
setSubstringFilterProperty
public void setSubstringFilterProperty(PlayList.SubstringFilterProperty substringFilterProperty)
-
startEditingPlaylistName
public void startEditingPlaylistName()
Start editing of the playlist's name.
-
$$$getRootComponent$$$
public JComponent $$$getRootComponent$$$()
-
getSongContextButtonPanel
public JPanel getSongContextButtonPanel()
The panel the buttons/action forSongContextComponents live in.- Returns:
- master button panel
- See Also:
SongContextComponentShowHideAction,getSongContextPanel()
-
getSongContextComponents
public List<SongContextComponent> getSongContextComponents()
-
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
-
isIndeterminateProgress
public boolean isIndeterminateProgress()
Description copied from interface:DetailViewIndicates that the current status is an operation with indeterminate progress which should be reflected in the rendering of the status bar.- Specified by:
isIndeterminateProgressin interfaceDetailView- Returns:
- true if an indeterminate progress indicator is supposed to be rendered
-
getStatusLabel
@NotNull public @NotNull String getStatusLabel()
Description copied from interface:DetailViewStatus label to show in the status bar when this component becomes visible.- Specified by:
getStatusLabelin interfaceDetailView- Returns:
- label
- See Also:
MainWindow.getStatusLabel()
-
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>
-
doubleClick
public void doubleClick(ActionEvent event)
Description copied from interface:DoubleClickListenerCalled when a double click occurs.- Specified by:
doubleClickin interfaceDoubleClickListener- Parameters:
event- event
-
registerDoubleClick
public void registerDoubleClick(String actionId)
Registers the id of the action to execute upon a double click.- Parameters:
actionId- action id
-
getSongContextComponent
public JComponent getSongContextComponent()
Returns currently selected song context component.- Returns:
- song context component
-
setSongContextComponent
public void setSongContextComponent(JComponent component)
- Parameters:
component- component
-
getSongContextPanel
public JPanel getSongContextPanel()
Returns the actual song context panel. To get the corresponding button panel, usegetSongContextButtonPanel().- Returns:
- song context panel
-
getTable
public JTable getTable()
The actual table component showing songs.
-
getMainWindow
public MainWindow getMainWindow()
Returns the owning window.- Returns:
- main window
-
getFilterTableModel
public SongTableModel getFilterTableModel()
Return the song table model.- Specified by:
getFilterTableModelin interfaceTableView- Returns:
- song tablemodel
-
getComponent
public JComponent getComponent()
Description copied from interface:ViewThe actual visual component for this view.- Specified by:
getComponentin interfaceView- Returns:
- detail component
-
getFocusRoot
public JComponent getFocusRoot()
Description copied from interface:ViewThe component that should be focused by default, when view is shown.- Specified by:
getFocusRootin interfaceView- Returns:
- component
-
getSelectedSong
public AudioSong getSelectedSong()
Returns the first selected song. This call may be expensive when many songs are selected. You can check the number of songs selected withgetSongTable().getSelectedRowCount().- Returns:
- first selected song, or null if no songs are selected.
-
select
public void select(AudioSong song)
Select the given song in the current SongTable and scroll to it so that it becomes visible.- Parameters:
song- song
-
select
public void select(long id)
Select the given song in the current SongTable and scroll to it so that it becomes visible.- Parameters:
id- id
-
resetSorting
public void resetSorting()
Clear all sorting flags and sort the current playlist by natural order.
-
-