TV-Browser 2.7.5 API

simplemarkerplugin
Class SimpleMarkerPlugin

java.lang.Object
  extended by devplugin.Plugin
      extended by simplemarkerplugin.SimpleMarkerPlugin
All Implemented Interfaces:
ContextMenuIf, Marker, ProgramReceiveIf, ActionListener, EventListener

public class SimpleMarkerPlugin
extends Plugin
implements ActionListener

SimpleMarkerPlugin 1.4 Plugin for TV-Browser since version 2.3 to only mark programs and add them to the Plugin tree. (Formerly known as Just_Mark ;-)) License: GNU General Public License (GPL)

Author:
René Mach

Field Summary
protected static Localizer mLocalizer
          The localizer for this class.
 
Fields inherited from class devplugin.Plugin
BIG_ICON, DISABLED_ON_TASK_MENU, parent, SINGLE_CLICK_WAITING_TIME
 
Constructor Summary
SimpleMarkerPlugin()
          Standard contructor for this class.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
protected  void addList(MarkList list)
           
protected  void addList(String name)
           
 boolean canReceiveProgramsWithTarget()
          Gets whether the ProgramReceiveIf supports receiving programs from other plugins with a special target.
 boolean canUseProgramTree()
          Signal whether this plugin participates in the plugin tree view or not.
protected  ImageIcon createIconForTree(int i)
           
 Class<? extends PluginsFilterComponent>[] getAvailableFilterComponentClasses()
          Returns the available plugins filter component classes.
 ActionMenu getButtonAction()
          Gets the action to use for the main menu and the toolbar.
 ActionMenu getContextMenuActions(Program p)
          Gets the actions for the context menu of a program.
protected  Icon getIconForFileName(String fileName)
           
 PluginInfo getInfo()
          Gets the meta information about the plugin.
static SimpleMarkerPlugin getInstance()
           
 Icon[] getMarkIconsForProgram(Program p)
          This gets the mark icons for a Program.
protected  MarkList getMarkListForId(String id)
           
protected  MarkList getMarkListForName(String name)
           
protected  String[] getMarkListNames()
           
protected  MarkList[] getMarkLists()
           
 int getMarkPriorityForProgram(Program p)
          Gets the mark priority for the given program that this Plugin uses.
 ProgramReceiveTarget[] getProgramReceiveTargets()
          Returns an array of receive target or null if there is no target
 PluginTreeNode getRootNode()
          Gets the root node of the plugin for the plugin tree.
protected  Properties getSettings()
           
 SettingsTab getSettingsTab()
          Gets the SettingsTab object, which is added to the settings-window.
protected  Frame getSuperFrame()
           
static Version getVersion()
           
 void handleAction(PluginTreeNode node, ActionEvent e)
          Remove all programs of the list
 void handleTvBrowserStartFinished()
          This method is called when the TV-Browser start is finished.
 void handleTvDataUpdateFinished()
          This method is automatically called, when the TV data update is finished.
 void loadSettings(Properties prop)
          Called by the host-application during start-up.
 void onActivation()
          This method is automatically called immediatly before the plugin gets activated.
 void readData(ObjectInputStream in)
          Called by the host-application during start-up.
 boolean receivePrograms(Program[] programs, ProgramReceiveTarget target)
          Receives a list of programs from another plugin with a target.
protected  void refreshManagePanel(boolean scroll)
           
protected  void removeList(MarkList list)
           
protected  void removeListForName(String name)
           
protected  void resetManagePanel()
           
protected  void revalidate(Program[] programs)
           
protected  void save()
           
 Properties storeSettings()
          Called by the host-application during shut-down.
 void updateTree()
          Updates the plugin tree.
 void writeData(ObjectOutputStream out)
          Counterpart to loadData.
 
Methods inherited from class devplugin.Plugin
canReceivePrograms, createImageIcon, createImageIcon, createImageIcon, createImageIconForFileName, execute, execute, execute, getAvailableFilter, getButtonIconName, getButtonText, getContextMenuItemText, getId, getJarFile, getMarkIcon, getMarkIconFromTheme, getMarkIconName, getMarkIcons, getParentFrame, getPluginManager, getProgramFromContextMenuActionEvent, getProgramTableIcons, getProgramTableIconText, getRatingInterfaces, handleTvDataAdded, handleTvDataAdded, handleTvDataChanged, handleTvDataChanged, handleTvDataDeleted, handleTvDataTouched, isAllowedToDeleteProgramFilter, layoutWindow, layoutWindow, onDeactivation, receivePrograms, receiveValues, saveMe, setJarFile, setParent, setPluginManager, storeRootNode, supportMultipleProgramExecution, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mLocalizer

protected static final Localizer mLocalizer
The localizer for this class.

Constructor Detail

SimpleMarkerPlugin

public SimpleMarkerPlugin()
Standard contructor for this class.

Method Detail

onActivation

public void onActivation()
Description copied from class: Plugin
This method is automatically called immediatly before the plugin gets activated.

Overrides:
onActivation in class Plugin

getVersion

public static Version getVersion()

getInstance

public static SimpleMarkerPlugin getInstance()
Returns:
The instance of this class.

getInfo

public PluginInfo getInfo()
Description copied from class: Plugin
Gets the meta information about the plugin.

Override this method to provide information about your plugin.

Overrides:
getInfo in class Plugin
Returns:
The Plugin Info.

loadSettings

public void loadSettings(Properties prop)
Description copied from class: Plugin
Called by the host-application during start-up.

Override this method to load your plugins settings from the file system.

Overrides:
loadSettings in class Plugin
Parameters:
prop - The settings for this plugin (May be empty).

storeSettings

public Properties storeSettings()
Description copied from class: Plugin
Called by the host-application during shut-down.

Override this method to store your plugins settings to the file system. ATTENTION: Don't use any logger, thread or access to Frames in this method.

Overrides:
storeSettings in class Plugin
Returns:
The settings for this plugin or null if this plugin does not need to save any settings.

getMarkIconsForProgram

public Icon[] getMarkIconsForProgram(Program p)
Description copied from class: Plugin
This gets the mark icons for a Program. Please cache the icons in the Plugin.

Overrides:
getMarkIconsForProgram in class Plugin
Parameters:
p - The Program to get the icons for.
Returns:
The MarkIcons.

getSettingsTab

public SettingsTab getSettingsTab()
Description copied from class: Plugin
Gets the SettingsTab object, which is added to the settings-window.

Override this method to provide a settings tab. The settings tab will be shown in the settings dialog in the plugin section.

Overrides:
getSettingsTab in class Plugin
Returns:
the SettingsTab object or null if the plugin does not provide this feature.

getContextMenuActions

public ActionMenu getContextMenuActions(Program p)
Description copied from class: Plugin
Gets the actions for the context menu of a program.

Override this method to provide context menu items for programs (e.g. in the program table). If your plugin shows a context menu only for some programs, but not for all, then you should explicitly return a non-null menu for the example program. Otherwise your context menu will not be shown in the settings dialog for the context menu order.

The following action values will be used:

Specified by:
getContextMenuActions in interface ContextMenuIf
Overrides:
getContextMenuActions in class Plugin
Parameters:
p - The program the context menu will be shown for.
Returns:
The ActionMenu for this Plugin.
See Also:
Plugin.getProgramFromContextMenuActionEvent(ActionEvent)

canReceiveProgramsWithTarget

public boolean canReceiveProgramsWithTarget()
Description copied from class: Plugin
Gets whether the ProgramReceiveIf supports receiving programs from other plugins with a special target.

Specified by:
canReceiveProgramsWithTarget in interface ProgramReceiveIf
Overrides:
canReceiveProgramsWithTarget in class Plugin
Returns:
Whether the ProgramReceiveIf supports receiving programs from other plugins with a special target.
See Also:
Plugin.receivePrograms(Program[],ProgramReceiveTarget)

getProgramReceiveTargets

public ProgramReceiveTarget[] getProgramReceiveTargets()
Description copied from class: Plugin
Returns an array of receive target or null if there is no target

Specified by:
getProgramReceiveTargets in interface ProgramReceiveIf
Overrides:
getProgramReceiveTargets in class Plugin
Returns:
The supported receive targets.
See Also:
Plugin.canReceiveProgramsWithTarget(), Plugin.receivePrograms(Program[],ProgramReceiveTarget)

receivePrograms

public boolean receivePrograms(Program[] programs,
                               ProgramReceiveTarget target)
Description copied from class: Plugin
Receives a list of programs from another plugin with a target.

Specified by:
receivePrograms in interface ProgramReceiveIf
Overrides:
receivePrograms in class Plugin
Parameters:
programs - The programs passed from the other plugin.
target - The receive target of the programs.
Returns:
If the programs were correct received (the target really exists).
See Also:
Plugin.canReceiveProgramsWithTarget()

getMarkPriorityForProgram

public int getMarkPriorityForProgram(Program p)
Description copied from class: Plugin
Gets the mark priority for the given program that this Plugin uses.

The mark priority can be Program.NO_MARK_PRIORITY, Program.MIN_MARK_PRIORITY, Program.LOWER_MEDIUM_MARK_PRIORITY, Program.MEDIUM_MARK_PRIORITY, Program.HIGHER_MEDIUM_MARK_PRIORITY or Program.MAX_MARK_PRIORITY.

Specified by:
getMarkPriorityForProgram in interface Marker
Overrides:
getMarkPriorityForProgram in class Plugin
Parameters:
p - The program to get the mark prioriy for.
Returns:
The mark priority for the given program for this plugin.

handleTvDataUpdateFinished

public void handleTvDataUpdateFinished()
Description copied from class: Plugin
This method is automatically called, when the TV data update is finished.

Override this method to react on this event. If you want to read data from the internet use this method to track if a connection was established. ATTENTION: If you do so take care of the TV-Browser start, at the start this method mustn't use an internet connection. Use the method handleTvBrowserStartFinished() to track if the TV-Browser start was finished before allowing access to the internet in this method.

Overrides:
handleTvDataUpdateFinished in class Plugin
See Also:
Plugin.handleTvBrowserStartFinished(), Plugin.handleTvDataAdded(ChannelDayProgram), Plugin.handleTvDataDeleted(ChannelDayProgram), Plugin.handleTvDataChanged()

getButtonAction

public ActionMenu getButtonAction()
Description copied from class: Plugin
Gets the action to use for the main menu and the toolbar.

Override this method to provide a menu item in the main menu and a toolbar button.

The following action values will be used:

Overrides:
getButtonAction in class Plugin
Returns:
the action to use for the menu and the toolbar or null if the plugin does not provide this feature.

handleTvBrowserStartFinished

public void handleTvBrowserStartFinished()
Description copied from class: Plugin
This method is called when the TV-Browser start is finished.

Overrides:
handleTvBrowserStartFinished in class Plugin

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

readData

public void readData(ObjectInputStream in)
              throws IOException,
                     ClassNotFoundException
Description copied from class: Plugin
Called by the host-application during start-up.

Override this method to load any objects from the file system.

Overrides:
readData in class Plugin
Parameters:
in - The stream to read the objects from.
Throws:
IOException - If reading failed.
ClassNotFoundException - If an object could not be casted correctly.
See Also:
Plugin.writeData(ObjectOutputStream)

writeData

public void writeData(ObjectOutputStream out)
               throws IOException
Description copied from class: Plugin
Counterpart to loadData. Called when the application shuts down.

Override this method to store any objects to the file system. ATTENTION: Don't use any logger, thread or access to Frames in this method.

Overrides:
writeData in class Plugin
Parameters:
out - The stream to write the objects to
Throws:
IOException - If writing failed.
See Also:
Plugin.readData(ObjectInputStream)

canUseProgramTree

public boolean canUseProgramTree()
Description copied from class: Plugin
Signal whether this plugin participates in the plugin tree view or not.

Overrides:
canUseProgramTree in class Plugin
Returns:
true, if the programs of this plugin are handled by the plugin tree view
See Also:
Plugin.getRootNode()

handleAction

public void handleAction(PluginTreeNode node,
                         ActionEvent e)
Remove all programs of the list

Parameters:
node - The parent node that contains the programs
e - The ActionEvent.

updateTree

public void updateTree()
Updates the plugin tree.


createIconForTree

protected ImageIcon createIconForTree(int i)

revalidate

protected void revalidate(Program[] programs)

getMarkLists

protected MarkList[] getMarkLists()

getMarkListNames

protected String[] getMarkListNames()

removeListForName

protected void removeListForName(String name)

removeList

protected void removeList(MarkList list)

getMarkListForName

protected MarkList getMarkListForName(String name)

getMarkListForId

protected MarkList getMarkListForId(String id)

addList

protected void addList(String name)

addList

protected void addList(MarkList list)

getRootNode

public PluginTreeNode getRootNode()
Description copied from class: Plugin
Gets the root node of the plugin for the plugin tree.

Overrides:
getRootNode in class Plugin
Returns:
The root node.
Since:
1.3 Increase update speed, with no double checking of the programs of this Plugin.
See Also:
Plugin.canUseProgramTree()

getIconForFileName

protected Icon getIconForFileName(String fileName)

getSuperFrame

protected Frame getSuperFrame()

refreshManagePanel

protected void refreshManagePanel(boolean scroll)

resetManagePanel

protected void resetManagePanel()

getAvailableFilterComponentClasses

public Class<? extends PluginsFilterComponent>[] getAvailableFilterComponentClasses()
Description copied from class: Plugin
Returns the available plugins filter component classes.
ATTENTON: Use return (Class[]) new Class[] {MyFilterComponent1.class,MyFilterComponent2.class}; because the creation of a class array with generic type didn't work.

Overrides:
getAvailableFilterComponentClasses in class Plugin
Returns:
The available plugins filter components classes or null if no plugins filter components are supported.

getSettings

protected Properties getSettings()

save

protected void save()

TV-Browser 2.7.5 API

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