Class PlayListTree
- java.lang.Object
-
- com.tagtraum.beatunes.playlisttree.PlayListTree
-
- All Implemented Interfaces:
DetailView
,DoubleClickListener
,View
,ApplicationComponent<BeaTunes>
public class PlayListTree extends Object implements DetailView, ApplicationComponent<BeaTunes>, DoubleClickListener
Main tree view (sidebar) on the left of the UI (MainWindow
).- Author:
- Hendrik Schreiber
-
-
Field Summary
Fields Modifier and Type Field Description static int
ADDITIONAL_LEFT_SPACING_FOR_SOURCE_LIST
-
Constructor Summary
Constructors Constructor Description PlayListTree(MainWindow mainWindow)
Creates view.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JComponent
$$$getRootComponent$$$()
void
addPlaylist(PlayList beaTunesPlayList)
Adds a playlist to the tree in beaTunes in the currently selected folder.void
addPlaylist(PlayList beaTunesPlayList, PlayList parentSibling)
Adds a playlist to the tree in beaTunes.void
doubleClick(ActionEvent event)
Called when a double click occurs.BeaTunes
getApplication()
Returns the main application component.JComponent
getComponent()
The actual visual component for this view.String
getId()
Unique id for each instance of this object.JTree
getPlayListTree()
Returns the actual tree component.PlayListTreeModel
getPlayListTreeModel()
Returns the current model for the tree.DetailView
getSelectedDetailView()
Returns the DetailView selected in the tree view whether the tree view has the focus or notPlayList
getSelectedPlayList()
Returns the PlayList selected in the tree view whether the tree view has the focus or notPlayList
getSelectedPlayListsParentFolder()
Parent folder of the currently selected playlist or the selected folder itself.DefaultMutableTreeNode
getSelectedPlayListTreeNode()
Returns the playlist tree node selected in the tree view whether the tree view has the focus or notObject
getSelectedUserObject()
Returns the user object/detailview selected in the tree view whether the tree view has the focus or notString
getStatusLabel()
Status label to show in the status bar when this component becomes visible.void
init()
Initializes this component and its sub-components.boolean
isIndeterminateProgress()
Indicates that the current status is an operation with indeterminate progress which should be reflected in the rendering of the status bar.void
registerDoubleClick(String actionId)
Registers the id of the action to execute upon a double click.void
restoreView()
Makes sure that the correct category nodes are installed below the root node.void
select(Object object)
Selects the tree node that has the given object as the user object of itsPlayListTreeModel.UO
.void
select(DefaultMutableTreeNode node)
Select a tree node.void
selectFirstInspectorWithIssues()
Select the firstInspectorView
with issues.void
setApplication(BeaTunes beaTunes)
Sets the main application component.void
setPlayLists(List<PlayList> playLists)
Refreshes all models.void
showCharts()
Manipulate the tree model in a way that makes the charts node visible.void
showInspection()
Manipulate the tree model in a way that makes the inspection node visible.void
showLibrary()
Manipulate the tree model in a way that makes the library node visible.void
showTaskQueue()
Manipulate the tree model in a way that makes the task queue node visible.void
shutdown()
Shuts down this component and its sub-components.-
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.View
getFocusRoot
-
-
-
-
Field Detail
-
ADDITIONAL_LEFT_SPACING_FOR_SOURCE_LIST
public static final int ADDITIONAL_LEFT_SPACING_FOR_SOURCE_LIST
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PlayListTree
public PlayListTree(MainWindow mainWindow)
Creates view.- Parameters:
mainWindow
- main window
-
-
Method Detail
-
showInspection
public void showInspection()
Manipulate the tree model in a way that makes the inspection node visible.
-
showTaskQueue
public void showTaskQueue()
Manipulate the tree model in a way that makes the task queue node visible.
-
showLibrary
public void showLibrary()
Manipulate the tree model in a way that makes the library node visible.
-
showCharts
public void showCharts()
Manipulate the tree model in a way that makes the charts node visible.
-
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
-
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
-
registerDoubleClick
public void registerDoubleClick(String actionId)
Registers the id of the action to execute upon a double click.- Parameters:
actionId
- action id
-
getPlayListTreeModel
public PlayListTreeModel getPlayListTreeModel()
Returns the current model for the tree.- Returns:
- tree
-
getSelectedPlayListTreeNode
public DefaultMutableTreeNode getSelectedPlayListTreeNode()
Returns the playlist tree node selected in the tree view whether the tree view has the focus or not- Returns:
- currently selected playlist tree node or null, if none is selected
-
addPlaylist
public void addPlaylist(PlayList beaTunesPlayList)
Adds a playlist to the tree in beaTunes in the currently selected folder.- Parameters:
beaTunesPlayList
- beaTunes PlayList
-
addPlaylist
public void addPlaylist(PlayList beaTunesPlayList, PlayList parentSibling)
Adds a playlist to the tree in beaTunes.- Parameters:
beaTunesPlayList
- beaTunes PlayListparentSibling
- null, parent folder or sibling playlist
-
setPlayLists
public void setPlayLists(List<PlayList> playLists)
Refreshes all models.- Parameters:
playLists
- playlists
-
getSelectedPlayListsParentFolder
public PlayList getSelectedPlayListsParentFolder()
Parent folder of the currently selected playlist or the selected folder itself.- Returns:
- parent folder
-
getSelectedDetailView
public DetailView getSelectedDetailView()
Returns the DetailView selected in the tree view whether the tree view has the focus or not- Returns:
- currently selected DetailView or null, if none is selected
-
getSelectedPlayList
public PlayList getSelectedPlayList()
Returns the PlayList selected in the tree view whether the tree view has the focus or not- Returns:
- currently selected PlayList or null, if none is selected
-
getSelectedUserObject
public Object getSelectedUserObject()
Returns the user object/detailview selected in the tree view whether the tree view has the focus or not- Returns:
- currently selected user object or null, if none is selected
-
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>
-
restoreView
public void restoreView()
Makes sure that the correct category nodes are installed below the root node.
-
select
public void select(DefaultMutableTreeNode node)
Select a tree node.- Parameters:
node
- node
-
selectFirstInspectorWithIssues
public void selectFirstInspectorWithIssues()
Select the firstInspectorView
with issues.
-
select
public void select(Object object)
Selects the tree node that has the given object as the user object of itsPlayListTreeModel.UO
.
-
getPlayListTree
public JTree getPlayListTree()
Returns the actual tree component.- Returns:
- tree
-
getComponent
public JComponent getComponent()
Description copied from interface:View
The actual visual component for this view.- Specified by:
getComponent
in interfaceView
- Returns:
- detail component
-
isIndeterminateProgress
public boolean isIndeterminateProgress()
Description copied from interface:DetailView
Indicates that the current status is an operation with indeterminate progress which should be reflected in the rendering of the status bar.- Specified by:
isIndeterminateProgress
in interfaceDetailView
- Returns:
- true if an indeterminate progress indicator is supposed to be rendered
-
getStatusLabel
public String getStatusLabel()
Description copied from interface:DetailView
Status label to show in the status bar when this component becomes visible.- Specified by:
getStatusLabel
in interfaceDetailView
- Returns:
- label
- See Also:
MainWindow.getStatusLabel()
-
$$$getRootComponent$$$
public JComponent $$$getRootComponent$$$()
-
-