TV-Browser 2.7.5 API

tvbrowserdataservice
Class TvBrowserDataService

java.lang.Object
  extended by devplugin.AbstractTvDataService
      extended by tvbrowserdataservice.TvBrowserDataService
All Implemented Interfaces:
ContextMenuIf, ButtonActionIf, TvDataService

public class TvBrowserDataService
extends AbstractTvDataService

Author:
Til Schneider, www.murfman.de

Field Summary
protected static String CHANNEL_GROUPS_FILENAME
           
static Localizer mLocalizer
          The localizer for this class.
 
Constructor Summary
TvBrowserDataService()
          Creates a new TvBrowserDataService.
 
Method Summary
 void addGroup(ChannelGroup group)
          Adds a new channel group to the TvBrowserDataService.
(package private)  void checkCancelDownload()
           
 ChannelGroup[] checkForAvailableChannelGroups(ProgressMonitor monitor)
           
 Channel[] checkForAvailableChannels(ChannelGroup g, ProgressMonitor monitor)
          Some TvDataServices may need to connect to the internet to know their channels.
protected  void downloadChannelGroupFile()
           
 Channel[] getAvailableChannels(ChannelGroup g)
          Gets the list of the channels that are available by this data service.
 ChannelGroup[] getAvailableGroups()
           
protected  Channel getChannel(String country, String channelName)
           
(package private)  File getDataDir()
           
 PluginInfo getInfo()
          Gets information about this TvDataService
static TvBrowserDataService getInstance()
          Get the instance of the TvBrowserDataService.
 SettingsPanel getSettingsPanel()
           
 ChannelGroup[] getUserDefinedChannelGroups()
           
static Version getVersion()
           
 File getWorkingDirectory()
           
 boolean hasRightToDownloadIcons()
          Gets if it is allowed to download the channel icons.
 boolean hasSettingsPanel()
          A TvDataService can have a settings panel within the settings dialog.
(package private)  boolean isDayProgramInDataBase(Date date, Channel channel)
           
 void loadSettings(Properties settings)
          Called by the host-application during start-up.
 void removeGroup(ChannelGroup group)
          Removes a channel group from the TvBrowserDataService.
 void setTvDataLevel(TvDataLevel[] levelArr)
          Sets the level of the TV data.
 void setWorkingDirectory(File dataDir)
          This method is called by the host application to set the working folder.
 Properties storeSettings()
          Called by the host-application during shut-down.
 boolean supportsDynamicChannelGroups()
           
 boolean supportsDynamicChannelList()
           
 void updateTvData(TvDataUpdateManager dataBase, Channel[] channelArr, Date startDate, int dateCount, ProgressMonitor monitor)
          Updates the TV listings provided by this data service.
 
Methods inherited from class devplugin.AbstractTvDataService
checkForAvailableChannels, getAPIVersion, getAvailableChannels, getButtonAction, getButtonActionDescription, getContextMenuActions, getId, getParentFrame, getPluginManager, handleTvBrowserStartFinished, setParent, setPluginManager, supportsAutoUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mLocalizer

public static final Localizer mLocalizer
The localizer for this class.


CHANNEL_GROUPS_FILENAME

protected static final String CHANNEL_GROUPS_FILENAME
See Also:
Constant Field Values
Constructor Detail

TvBrowserDataService

public TvBrowserDataService()
Creates a new TvBrowserDataService.

Method Detail

getInstance

public static TvBrowserDataService getInstance()
Get the instance of the TvBrowserDataService. If the instance isn't available it will be created.

Returns:
The instance of the TvBrowserDataService.

setWorkingDirectory

public void setWorkingDirectory(File dataDir)
Description copied from interface: TvDataService
This method is called by the host application to set the working folder. If required, TvDataService implementations should store their data within this 'dataDir' directory


getWorkingDirectory

public File getWorkingDirectory()
Returns:
The data directory of the TvBrowserDataService.

updateTvData

public void updateTvData(TvDataUpdateManager dataBase,
                         Channel[] channelArr,
                         Date startDate,
                         int dateCount,
                         ProgressMonitor monitor)
Updates the TV listings provided by this data service.


checkCancelDownload

void checkCancelDownload()

isDayProgramInDataBase

boolean isDayProgramInDataBase(Date date,
                               Channel channel)

getDataDir

File getDataDir()

getChannel

protected Channel getChannel(String country,
                             String channelName)

addGroup

public void addGroup(ChannelGroup group)
Adds a new channel group to the TvBrowserDataService.

Parameters:
group - The channel group to add.

removeGroup

public void removeGroup(ChannelGroup group)
Removes a channel group from the TvBrowserDataService.

Parameters:
group - The channel group to remove.

loadSettings

public void loadSettings(Properties settings)
Called by the host-application during start-up. Implement this method to load your dataservices settings from the file system.


setTvDataLevel

public void setTvDataLevel(TvDataLevel[] levelArr)
Sets the level of the TV data.

Parameters:
levelArr - The array with the TV data levels.

getUserDefinedChannelGroups

public ChannelGroup[] getUserDefinedChannelGroups()

storeSettings

public Properties storeSettings()
Called by the host-application during shut-down. Implements this method to store your dataservices settings to the file system.


hasSettingsPanel

public boolean hasSettingsPanel()
Description copied from interface: TvDataService
A TvDataService can have a settings panel within the settings dialog. If the hasSettingsPanel() method returns false, the getSettingsPanel() method is never called.

Returns:
true, if the settings panel feature is used by this TvDataService

getSettingsPanel

public SettingsPanel getSettingsPanel()
Returns:
the SettingsPanel of this TvDataService

getAvailableGroups

public ChannelGroup[] getAvailableGroups()
Returns:
an array of the available channel groups.

getAvailableChannels

public Channel[] getAvailableChannels(ChannelGroup g)
Gets the list of the channels that are available by this data service.


downloadChannelGroupFile

protected void downloadChannelGroupFile()
                                 throws TvBrowserException
Throws:
TvBrowserException

checkForAvailableChannelGroups

public ChannelGroup[] checkForAvailableChannelGroups(ProgressMonitor monitor)
                                              throws TvBrowserException
Throws:
TvBrowserException

checkForAvailableChannels

public Channel[] checkForAvailableChannels(ChannelGroup g,
                                           ProgressMonitor monitor)
                                    throws TvBrowserException
Description copied from interface: TvDataService
Some TvDataServices may need to connect to the internet to know their channels. If supportsDanymicChannelList() returns true, this method is called to check for available channels.

Returns:
array of all available channels (new and old)
Throws:
TvBrowserException

supportsDynamicChannelList

public boolean supportsDynamicChannelList()
Returns:
true, if this TvDataService can dynamically load other channels

supportsDynamicChannelGroups

public boolean supportsDynamicChannelGroups()
Returns:
true, if this TvDataService can dynamically load other groups

getVersion

public static Version getVersion()

getInfo

public PluginInfo getInfo()
Gets information about this TvDataService


hasRightToDownloadIcons

public boolean hasRightToDownloadIcons()
Gets if it is allowed to download the channel icons.

Returns:
True if the download of the channel icons is allowed.

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)