com.blackledge.david.tivo.multitasker.plugins
Class GenericBackgroundImage

java.lang.Object
  extended by com.blackledge.david.tivo.multitasker.plugins.GenericBackgroundImage
All Implemented Interfaces:
BackgroundImage, LocalOptionProvider

public class GenericBackgroundImage
extends Object
implements BackgroundImage, LocalOptionProvider

Provide BackgroundImages via URLs listed in OPTION_URLS ("GenericBackgroundImage.urls"). Supports shuffle - if it randomly choose a URL ( MultiTaskerApplication.OPTION_BACKGROUND_IMAGE_RANDOM ) and it is a multi-source like an rss feed, it selects the first one, then puts the rest in a pool of random selections every time that url is randomly chosen again until it needs to re-feed the pool for that URL. (the pool is shared by all URLs, however, so it doesn't work exactly as one might expect, but it should be indistinguishable from normal shuffling)

Version:
$Revision: 1.1 $

Field Summary
static String OPTION_PREVENT_DUPLICATES
           
static String OPTION_URLS
           
 
Fields inherited from interface com.blackledge.david.tivo.multitasker.LocalOptionProvider
TYPE_BOOLEAN, TYPE_CLASS, TYPE_COLOR, TYPE_FILE, TYPE_FLOAT, TYPE_FOLDER, TYPE_IMAGE, TYPE_INTEGER, TYPE_STRING, TYPE_URL
 
Constructor Summary
GenericBackgroundImage()
           
 
Method Summary
 String getLocalOptionDefault(String key)
          no default for URL, just Prevent Duplicates (true).
 Collection getLocalOptionNames()
          just the keySet of getLocalOptionPreferences()
 Map getLocalOptionPreferences()
          Add support for OPTION_URLS and OPTION_PREVENT_DUPLICATES map of your option keys where the value is "Type[+],text [range]" per the MultiTaskerPreferences class.
 String getNextImage()
           
 void init(MultiTaskerApplication app)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTION_URLS

public static final String OPTION_URLS
See Also:
Constant Field Values

OPTION_PREVENT_DUPLICATES

public static final String OPTION_PREVENT_DUPLICATES
See Also:
Constant Field Values
Constructor Detail

GenericBackgroundImage

public GenericBackgroundImage()
Method Detail

init

public void init(MultiTaskerApplication app)
Specified by:
init in interface BackgroundImage

getNextImage

public String getNextImage()
Specified by:
getNextImage in interface BackgroundImage

getLocalOptionNames

public Collection getLocalOptionNames()
just the keySet of getLocalOptionPreferences()

Specified by:
getLocalOptionNames in interface LocalOptionProvider
Returns:

getLocalOptionPreferences

public Map getLocalOptionPreferences()
Add support for OPTION_URLS and OPTION_PREVENT_DUPLICATES map of your option keys where the value is "Type[+],text [range]" per the MultiTaskerPreferences class. Use a LinkedHashMap to maintain the order of your options.

Specified by:
getLocalOptionPreferences in interface LocalOptionProvider
Returns:
See Also:
LocalOptionProvider.getLocalOptionPreferences()

getLocalOptionDefault

public String getLocalOptionDefault(String key)
no default for URL, just Prevent Duplicates (true). defaults for each of the local option keys. Could just return null if there is no provided default. If the local option default starts with a +, it is appended (delimeted by a comma) to the getOptionDefault value, if any.

Specified by:
getLocalOptionDefault in interface LocalOptionProvider
Returns:
Option value to use if none is set or overridden.
See Also:
LocalOptionProvider.getLocalOptionDefault(java.lang.String)