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 intADDITIONAL_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$$$()voidaddPlaylist(PlayList beaTunesPlayList)Adds a playlist to the tree in beaTunes in the currently selected folder.voidaddPlaylist(PlayList beaTunesPlayList, PlayList parentSibling)Adds a playlist to the tree in beaTunes.voiddoubleClick(ActionEvent event)Called when a double click occurs.BeaTunesgetApplication()Returns the main application component.JComponentgetComponent()The actual visual component for this view.StringgetId()Unique id for each instance of this object.JTreegetPlayListTree()Returns the actual tree component.PlayListTreeModelgetPlayListTreeModel()Returns the current model for the tree.DetailViewgetSelectedDetailView()Returns the DetailView selected in the tree view whether the tree view has the focus or notPlayListgetSelectedPlayList()Returns the PlayList selected in the tree view whether the tree view has the focus or notPlayListgetSelectedPlayListsParentFolder()Parent folder of the currently selected playlist or the selected folder itself.DefaultMutableTreeNodegetSelectedPlayListTreeNode()Returns the playlist tree node selected in the tree view whether the tree view has the focus or notObjectgetSelectedUserObject()Returns the user object/detailview selected in the tree view whether the tree view has the focus or notStringgetStatusLabel()Status label to show in the status bar when this component becomes visible.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.voidrestoreView()Makes sure that the correct category nodes are installed below the root node.voidselect(Object object)Selects the tree node that has the given object as the user object of itsPlayListTreeModel.UO.voidselect(DefaultMutableTreeNode node)Select a tree node.voidselectFirstInspectorWithIssues()Select the firstInspectorViewwith issues.voidsetApplication(BeaTunes beaTunes)Sets the main application component.voidsetPlayLists(List<PlayList> playLists)Refreshes all models.voidshowCharts()Manipulate the tree model in a way that makes the charts node visible.voidshowInspection()Manipulate the tree model in a way that makes the inspection node visible.voidshowLibrary()Manipulate the tree model in a way that makes the library node visible.voidshowTaskQueue()Manipulate the tree model in a way that makes the task queue node visible.voidshutdown()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: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
-
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
-
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: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>
-
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 firstInspectorViewwith 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:ViewThe actual visual component for this view.- Specified by:
getComponentin interfaceView- Returns:
- detail component
-
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
public 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()
-
$$$getRootComponent$$$
public JComponent $$$getRootComponent$$$()
-
-