Package com.tagtraum.beatunes
Class GeneralPreferences
- java.lang.Object
-
- com.tagtraum.beatunes.GeneralPreferences
-
- All Implemented Interfaces:
ConfigurableComponent
public class GeneralPreferences extends Object implements ConfigurableComponent
BeaTunes general preferences.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description GeneralPreferences(BeaTunes application)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JComponent
$$$getRootComponent$$$()
void
addITunesLibraryDescriptors(Path... files)
void
addLibraryDescriptor(LibraryDescriptor libraryDescriptor)
void
addPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)
BeaTunes
getApplication()
int
getCoverPanelDelay()
Returns the current cover panel delay.Icon
getIcon()
Icon representing the component in the preferences dialog.String
getId()
Identifier that is used to uniquely identify a given component.KeyFormat
getKeyExportFormat()
KeyTextRenderer
getKeyTextRenderer()
LibraryDescriptor
getLibraryDescriptor()
Currently selectedLibraryDescriptor
.LibraryDescriptor
getLibraryDescriptor(String id)
String
getName()
Name that will be used in the preferences dialog for this component.JComponent
getPreferenceView()
Returns a JComponent that allows the user to configure this component.String
getToolTip()
Tooltip that will be shown in the preferences dialog.boolean
isAutomaticallyExportPlaylists()
boolean
isSubmitManuallyEnteredValuesCheckBox()
boolean
isSynchronizeOnActivation()
Indicates whether beaTunes should sync on Window activation.void
load(nu.xom.Element parent)
Is called by the application when preferences are loaded.boolean
selectLibrary(Long id)
Selects a library in this dialog without actually causing the library to be loaded by the application.void
setCoverPanelDelay(int seconds)
Adjusts the preferences UI and then stores the new values.void
setEnableSynchronizeOnActivation(boolean enable)
Determines whether the option to sync everytime beaTunes receives the focus is offered at all.void
setSynchronizeOnActivation(boolean synchronizeOnActivation)
Determines whether beaTunes synchronizes with iTunes every time the beaTunes window receives the focus, i.e.void
store(nu.xom.Element parent)
Will be called by the application when it thinks that configurable components should store their configuration.void
switchTo(LibraryDescriptor newDescriptor)
Switch to a different library.
-
-
-
Constructor Detail
-
GeneralPreferences
public GeneralPreferences(BeaTunes application)
- Parameters:
application
- beaTunes
-
-
Method Detail
-
isSynchronizeOnActivation
public boolean isSynchronizeOnActivation()
Indicates whether beaTunes should sync on Window activation.- Returns:
- sync on window activation
-
setSynchronizeOnActivation
public void setSynchronizeOnActivation(boolean synchronizeOnActivation)
Determines whether beaTunes synchronizes with iTunes every time the beaTunes window receives the focus, i.e. runs in the foreground.- Parameters:
synchronizeOnActivation
- true or false
-
setEnableSynchronizeOnActivation
public void setEnableSynchronizeOnActivation(boolean enable)
Determines whether the option to sync everytime beaTunes receives the focus is offered at all.- Parameters:
enable
- true or false
-
getCoverPanelDelay
public int getCoverPanelDelay()
Returns the current cover panel delay.- Returns:
- Numbers of seconds until artwork is shown. Values <=0 indicate that the artwork is never shown
-
setCoverPanelDelay
public void setCoverPanelDelay(int seconds)
Adjusts the preferences UI and then stores the new values.- Parameters:
seconds
- cover panel delay
-
isAutomaticallyExportPlaylists
public boolean isAutomaticallyExportPlaylists()
-
addPropertyChangeListener
public void addPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)
-
getKeyTextRenderer
public KeyTextRenderer getKeyTextRenderer()
-
getKeyExportFormat
public KeyFormat getKeyExportFormat()
-
switchTo
public void switchTo(LibraryDescriptor newDescriptor) throws IOException, ParserConfigurationException, SAXException
Switch to a different library.- Parameters:
newDescriptor
- new library descriptor- Throws:
IOException
ParserConfigurationException
SAXException
-
getId
public String getId()
Description copied from interface:ConfigurableComponent
Identifier that is used to uniquely identify a given component. This id will be used to mark the component in the persistently stored configuration.- Specified by:
getId
in interfaceConfigurableComponent
- Returns:
- id
- See Also:
PreferencesDialog.getConfigurableComponent(String)
-
getPreferenceView
public JComponent getPreferenceView()
Description copied from interface:ConfigurableComponent
Returns a JComponent that allows the user to configure this component. The preference view will be used as part of the preferences dialog.- Specified by:
getPreferenceView
in interfaceConfigurableComponent
- Returns:
- component
-
getIcon
public Icon getIcon()
Description copied from interface:ConfigurableComponent
Icon representing the component in the preferences dialog.- Specified by:
getIcon
in interfaceConfigurableComponent
- Returns:
- Icon
-
getName
public String getName()
Description copied from interface:ConfigurableComponent
Name that will be used in the preferences dialog for this component.- Specified by:
getName
in interfaceConfigurableComponent
- Returns:
- name of the component
-
getToolTip
public String getToolTip()
Description copied from interface:ConfigurableComponent
Tooltip that will be shown in the preferences dialog.- Specified by:
getToolTip
in interfaceConfigurableComponent
- Returns:
- tool tip
-
getApplication
public BeaTunes getApplication()
-
isSubmitManuallyEnteredValuesCheckBox
public boolean isSubmitManuallyEnteredValuesCheckBox()
-
getLibraryDescriptor
public LibraryDescriptor getLibraryDescriptor(String id)
-
getLibraryDescriptor
public LibraryDescriptor getLibraryDescriptor()
Currently selectedLibraryDescriptor
.- Returns:
- library descriptor or
null
, if no descriptor is selected
-
selectLibrary
public boolean selectLibrary(Long id)
Selects a library in this dialog without actually causing the library to be loaded by the application. If there are multiple libraries with the same id (because some old files are still lying around), the newest one is selected.- Parameters:
id
- persistent id of the library's source- Returns:
- true, if a corresponding library was already configured, false, if the library id is unknown
-
store
public void store(nu.xom.Element parent)
Description copied from interface:ConfigurableComponent
Will be called by the application when it thinks that configurable components should store their configuration.- Specified by:
store
in interfaceConfigurableComponent
- Parameters:
parent
- empty parent element should contain all configuration children for this component once this method returns
-
load
public void load(nu.xom.Element parent)
Description copied from interface:ConfigurableComponent
Is called by the application when preferences are loaded. The component is responsible for interpreting the parent element.- Specified by:
load
in interfaceConfigurableComponent
- Parameters:
parent
- configuration
-
addITunesLibraryDescriptors
public void addITunesLibraryDescriptors(Path... files)
-
addLibraryDescriptor
public void addLibraryDescriptor(LibraryDescriptor libraryDescriptor)
-
$$$getRootComponent$$$
public JComponent $$$getRootComponent$$$()
-
-