|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<java.lang.Object,java.lang.Object>
java.util.Properties
core.options.Options
public class Options
This class is used to handle options that a user makes, including file types to filter, the itunes xml file, the directory to search for duplicates,the directory to add tracks to iTunes from, whether or not to query a server for updates to iTunesDSM, and startup options.
Nested Class Summary | |
---|---|
class |
Options.FindITunesXMLFile
This class locates the iTunes XML file in the background and reports the progress to a StatusProgressMonitor object. |
Field Summary | |
---|---|
static java.lang.String |
newLine
The newline character that is system dependent. |
static java.lang.String |
OPTIONS_FILE_NAME
The string path for the options file. |
static java.lang.String |
PROPERTY_FILE_COMMENT
The comments given to the properties file when outputing. |
Fields inherited from class java.util.Properties |
---|
defaults |
Constructor Summary | |
---|---|
Options()
Creates a new Options object. |
Method Summary | |
---|---|
void |
addMusicDirectory(java.io.File newMusicDir)
Add a new music directory to the array of music directories. |
void |
addOptionsChangeListener(OptionsChangeListener listener)
Adds an OptionsChangeListener to the options object. |
static void |
checkFileExists()
Checks that the options file exists. |
boolean |
equals(Options testOptions)
Tests whether two options objects are equal. |
long |
getBackgroundDelay()
Returns the set time delay for background monitoring the music directory folder. |
int |
getBackgroundDelayHours()
Returns the set time delay for background monitoring in hours. |
static java.io.File[] |
getChildDirectories(java.util.ArrayList<java.io.File> allFoldersToGetRoots)
Returns an array of all the child folders given the array list of folders. |
java.lang.String[] |
getExtensions()
Gets the file extensions to filter with. |
java.io.File |
getiTunesXMLFile()
Returns the iTunes XML file. |
java.io.File |
getiTunesXMLMusicDir()
Returns the music directory iTunes stores music to by reading the iTunes XML file. |
java.util.ArrayList<java.io.File> |
getMusicDirectories()
Returns the music directories. |
boolean |
isAddTracksInBackgroundEnabled()
Returns the boolean value as to whether or not iTunesDSM should monitor the music directory in the background for new tracks to add iTunes. |
boolean |
isAddTracksInBackgroundRunning()
Returns whether or not the boolean for background monitoring is running. |
boolean |
isCheckForUpdate()
Returns the boolean value for whether or not to check for an update when the application starts. |
boolean |
isiTunesCopiesToFolder()
Returns the boolean value for whether or not iTunes copies music to the iTunes music folder when it is added to the library. |
boolean |
isiTunesKeepsOrganized()
The boolean as to whether or not iTunes keeps the music folder organized. |
boolean |
isMinimizeToTrayWhenClose()
If true, the iTunesDSM window will not exit the system, rather it will hide the window from the user. |
boolean |
isReady()
Returns a boolean value that is found by checking whether file extensions have been set, a music directory has been set by the user or read from the options file, and the iTunes Music Directory is known. |
boolean |
isStartOnBoot()
Sets whether or not to add the iTunesDSM.exe file shortcut to the startup folder in the user's start menu. |
boolean |
isStartVisible()
If true, iTunesDSM will start with a window visible to the user. |
static Options |
loadDefaultOptions()
Returns a default options object. |
static void |
main(java.lang.String[] args)
|
static Options |
read()
Reads the xml properties file and loads a new Options object. |
void |
removeMusicDirectory(java.io.File musicDirToRemove)
Removes a directory from the array of music directories. |
void |
removeOptionsChangeListener(OptionsChangeListener listener)
Removes an OptionsChangeListener object from the Options object. |
void |
setAddTracksInBackgroundEnabled(boolean addTracksInBackground)
Changes the boolean value to the desired boolean as to whether or not iTunesDSM should monitor the music directory for new tracks to add to iTunes in the background. |
void |
setAddTracksInBackgroundRunning(boolean addTracksInBackgroundRunning)
Sets the boolean value for background monitoring running. |
void |
setBackgroundDelay(long millisecs)
Changes the time delay to the specified value for background monitoring the music directory. |
void |
setBackgroundDelayHours(int hours)
Sets the background folder watching delay time to the given time in hours. |
void |
setCheckForUpdate(boolean checkForUpdate)
Sets the boolean value for whether or not to update check for an update to the application on start up. |
void |
setExtensions(java.lang.String str)
Sets the extensions to a string that is parsed by an Extensions object. |
void |
setExtensions(java.lang.String[] ext)
Sets the extensions to a known set of extensions. |
void |
setiTunesCopiesToFolder(boolean iTunesCopiesToFolder)
Sets the boolean value for whether or not iTunes copies music to the iTunes music folder set in Edit > Preferences > Advanced. |
void |
setiTunesKeepsOrganized(boolean iTunesKeepsOrganized)
Sets whether or not iTunes keeps the music folder organized. |
void |
setiTunesXMLFile()
Sets the iTunes XML file to one that will be found by the user. |
void |
setiTunesXMLFile(java.io.File xmlFile)
Sets the iTunes XML file. |
void |
setiTunesXMLMusicDir(java.io.File xmlMusicDir)
Sets the music directory that iTunes stores music in to a new directory. |
void |
setMinimizeToTrayWhenClose(boolean minimizeToTrayWhenClose)
Sets the closing behavior of iTunesDSM when the user closes the window. |
void |
setMusicDirectories(java.util.ArrayList<java.io.File> musicDirectories)
Sets the music directories to the given array list of directories. |
void |
setStartOnBoot(boolean startOnBoot)
Sets the boolean of starting iTunesDSM on boot. |
void |
setStartVisible(boolean startVisible)
Sets the value to start the iTunesDSM window visible to the user. |
java.lang.String |
toString()
Returns the Properties class toString method string. |
void |
write()
Outputs the Options object to a properties xml file. |
Methods inherited from class java.util.Properties |
---|
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames |
Methods inherited from class java.util.Hashtable |
---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String OPTIONS_FILE_NAME
public static java.lang.String newLine
public static java.lang.String PROPERTY_FILE_COMMENT
Constructor Detail |
---|
public Options()
read()
Method Detail |
---|
public boolean isiTunesCopiesToFolder()
public void setiTunesCopiesToFolder(boolean iTunesCopiesToFolder)
iTunesCopiesToFolder
- If true, iTunes copies music to the iTunes
music directory set in Edit > Preferences > Advanced. Currently, this must
be set manually.public boolean isiTunesKeepsOrganized()
public void setiTunesKeepsOrganized(boolean iTunesKeepsOrganized)
iTunesKeepsOrganized
- The boolean value as to whether or no iTunes keeps
the iTunes music directory organized.isiTunesKeepsOrganized()
public long getBackgroundDelay()
public int getBackgroundDelayHours()
public void setBackgroundDelay(long millisecs)
millisecs
- The new time delay for background monitoring the
music directory.public void setBackgroundDelayHours(int hours)
hours
- The amount of time in hours between background
folder monitoring.public boolean isStartVisible()
public void setStartVisible(boolean startVisible)
startVisible
- If true, iTunesDSM will start with the window visible
to the user.public boolean isMinimizeToTrayWhenClose()
public void setMinimizeToTrayWhenClose(boolean minimizeToTrayWhenClose)
minimizeToTrayWhenClose
- If true, iTunesDSM will hide from the user
rather than exiting the system.public boolean isStartOnBoot()
public void setStartOnBoot(boolean startOnBoot)
startOnBoot
- The boolean for starting for iTunesDSM on start on a
windows system.public boolean isAddTracksInBackgroundRunning()
public void setAddTracksInBackgroundRunning(boolean addTracksInBackgroundRunning)
addTracksInBackgroundRunning
- The boolean value
for whether or not background monitoring is running.public boolean isAddTracksInBackgroundEnabled()
public void setAddTracksInBackgroundEnabled(boolean addTracksInBackground)
addTracksInBackground
- The boolean value as to whether or not
iTunesDSM should monitor the music directory for new tracks to add to
iTunes in the background.public boolean isCheckForUpdate()
public void setCheckForUpdate(boolean checkForUpdate)
checkForUpdate
- The boolean value to set whether or not the applicatio
will check for an update startup.public java.util.ArrayList<java.io.File> getMusicDirectories()
public void setMusicDirectories(java.util.ArrayList<java.io.File> musicDirectories)
musicDirectories
- The music directories to set the Options
object's music directories to.public void addMusicDirectory(java.io.File newMusicDir)
newMusicDir
- The music directory to add to the array of music directories.public void removeMusicDirectory(java.io.File musicDirToRemove)
musicDirToRemove
- The directory to remove from the array of music
directories.public static java.io.File[] getChildDirectories(java.util.ArrayList<java.io.File> allFoldersToGetRoots)
allFoldersToGetRoots
- The array list of all directories to retrieve
child folders from.
public java.io.File getiTunesXMLMusicDir()
public void setiTunesXMLMusicDir(java.io.File xmlMusicDir)
xmlMusicDir
- the new directory that iTunes stores music to.public void setExtensions(java.lang.String[] ext)
ext
- the array of file extensions to set.public void setExtensions(java.lang.String str)
str
- The string to parse file type extensions from.public java.lang.String[] getExtensions()
public java.io.File getiTunesXMLFile()
public void setiTunesXMLFile(java.io.File xmlFile)
xmlFile
- The iTunes XML file to set to.public void setiTunesXMLFile()
public boolean equals(Options testOptions)
testOptions
- The options object to test against.
public boolean isReady()
public static void checkFileExists()
public java.lang.String toString()
toString
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
public static Options read()
public static Options loadDefaultOptions()
public void write()
public void addOptionsChangeListener(OptionsChangeListener listener)
listener
- The listener to add to the Options object.public void removeOptionsChangeListener(OptionsChangeListener listener)
listener
- The listener to remove from the Options object.public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |