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$$$()voidaddITunesLibraryDescriptors(Path... files)voidaddLibraryDescriptor(LibraryDescriptor libraryDescriptor)voidaddPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)BeaTunesgetApplication()intgetCoverPanelDelay()Returns the current cover panel delay.IcongetIcon()Icon representing the component in the preferences dialog.StringgetId()Identifier that is used to uniquely identify a given component.KeyFormatgetKeyExportFormat()KeyTextRenderergetKeyTextRenderer()LibraryDescriptorgetLibraryDescriptor()Currently selectedLibraryDescriptor.LibraryDescriptorgetLibraryDescriptor(String id)StringgetName()Name that will be used in the preferences dialog for this component.JComponentgetPreferenceView()Returns a JComponent that allows the user to configure this component.StringgetToolTip()Tooltip that will be shown in the preferences dialog.booleanisAutomaticallyExportPlaylists()booleanisSubmitManuallyEnteredValuesCheckBox()booleanisSynchronizeOnActivation()Indicates whether beaTunes should sync on Window activation.voidload(nu.xom.Element parent)Is called by the application when preferences are loaded.booleanselectLibrary(Long id)Selects a library in this dialog without actually causing the library to be loaded by the application.voidsetCoverPanelDelay(int seconds)Adjusts the preferences UI and then stores the new values.voidsetEnableSynchronizeOnActivation(boolean enable)Determines whether the option to sync everytime beaTunes receives the focus is offered at all.voidsetSynchronizeOnActivation(boolean synchronizeOnActivation)Determines whether beaTunes synchronizes with iTunes every time the beaTunes window receives the focus, i.e.voidstore(nu.xom.Element parent)Will be called by the application when it thinks that configurable components should store their configuration.voidswitchTo(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:
IOExceptionParserConfigurationExceptionSAXException
-
getId
public String getId()
Description copied from interface:ConfigurableComponentIdentifier 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:
getIdin interfaceConfigurableComponent- Returns:
- id
- See Also:
PreferencesDialog.getConfigurableComponent(String)
-
getPreferenceView
public JComponent getPreferenceView()
Description copied from interface:ConfigurableComponentReturns a JComponent that allows the user to configure this component. The preference view will be used as part of the preferences dialog.- Specified by:
getPreferenceViewin interfaceConfigurableComponent- Returns:
- component
-
getIcon
public Icon getIcon()
Description copied from interface:ConfigurableComponentIcon representing the component in the preferences dialog.- Specified by:
getIconin interfaceConfigurableComponent- Returns:
- Icon
-
getName
public String getName()
Description copied from interface:ConfigurableComponentName that will be used in the preferences dialog for this component.- Specified by:
getNamein interfaceConfigurableComponent- Returns:
- name of the component
-
getToolTip
public String getToolTip()
Description copied from interface:ConfigurableComponentTooltip that will be shown in the preferences dialog.- Specified by:
getToolTipin 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:ConfigurableComponentWill be called by the application when it thinks that configurable components should store their configuration.- Specified by:
storein 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:ConfigurableComponentIs called by the application when preferences are loaded. The component is responsible for interpreting the parent element.- Specified by:
loadin interfaceConfigurableComponent- Parameters:
parent- configuration
-
addITunesLibraryDescriptors
public void addITunesLibraryDescriptors(Path... files)
-
addLibraryDescriptor
public void addLibraryDescriptor(LibraryDescriptor libraryDescriptor)
-
$$$getRootComponent$$$
public JComponent $$$getRootComponent$$$()
-
-