|
TV-Browser 3.3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tvbrowser.core.plugin.AbstractPluginProxy
public abstract class AbstractPluginProxy
An abstract implementation of a plugin proxy. Encapsulates all calls to the plugin.
This means that
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface tvbrowser.core.plugin.PluginProxy |
---|
PluginProxy.Comparator |
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_PLUGIN_ICON_NAME
|
protected static Localizer |
mLocalizer
The localizer for this class. |
Fields inherited from interface devplugin.ContextMenuIf |
---|
ACTIONKEY_KEYBOARD_EVENT |
Constructor Summary | |
---|---|
protected |
AbstractPluginProxy()
|
Method Summary | |
---|---|
void |
addToArtificialPluginTree(MutableProgram program)
|
protected void |
assertActivatedState()
Checks whether the plugin is activated. |
boolean |
canReceiveProgramsWithTarget()
Gets whether the plugin supports receiving programs from other plugins with target. |
boolean |
canUseProgramTree()
|
int |
compareTo(ProgramReceiveIf other)
|
protected abstract boolean |
doCanReceiveProgramsWithTarget()
Really gets whether the plugin supports receiving programs from other plugins with target. |
protected abstract boolean |
doCanUseProgramTree()
|
protected abstract PluginsProgramFilter[] |
doGetAvailableFilter()
Really returns the available program filters that the plugin supports. |
protected abstract java.lang.Class<? extends PluginsFilterComponent>[] |
doGetAvailableFilterComponentClasses()
Really gets the available filter component classes. |
protected abstract ActionMenu |
doGetButtonAction()
Really gets the action to use for the main menu and the toolbar. |
protected abstract ActionMenu |
doGetContextMenuActions(Channel channel)
Really gets the actions for the context menu of a channel. |
protected abstract ActionMenu |
doGetContextMenuActions(Program program)
Really gets the actions for the context menu of a program. |
protected abstract ImportanceValue |
doGetImportanceValueForProgram(Program p)
Gets the importance value of a program.The importance of all active plugins is used to determinate the opacity of the used colors of a program, therefor a mean value of all values is used. |
protected abstract PluginInfo |
doGetInfo()
Really gets the meta information about the plugin. |
protected abstract javax.swing.Icon[] |
doGetMarkIcons(Program p)
Really gets the icon to use for marking programs in the program table. |
protected abstract int |
doGetMarkPriorityForProgram(Program p)
Really gets the mark priority for the given Program. |
protected abstract ProgramReceiveTarget[] |
doGetProgramReceiveTargets()
Really return an array of receive target or null if there is no target |
protected abstract javax.swing.Icon[] |
doGetProgramTableIcons(Program program)
Really gets the icons this Plugin provides for the given program. |
protected abstract java.lang.String |
doGetProgramTableIconText()
Gets the description text for the program table icons provided by this Plugin. |
protected abstract SettingsTabProxy |
doGetSettingsTab()
Rally gets the SettingsTab object, which is added to the settings-window. |
protected abstract void |
doHandleTvBrowserStartFinished()
|
protected abstract void |
doHandleTvDataAdded(ChannelDayProgram newProg)
This method is automatically called, when TV data was added. |
protected abstract void |
doHandleTvDataAdded(MutableChannelDayProgram newProg)
This method is automatically called, when TV data was added. |
protected abstract void |
doHandleTvDataDeleted(ChannelDayProgram oldProg)
This method is automatically called, when TV data was deleted. |
protected abstract void |
doHandleTvDataTouched(ChannelDayProgram removedDayProgram,
ChannelDayProgram addedDayProgram)
This method is automatically called, when TV data was touched. |
protected abstract void |
doHandleTvDataUpdateFinished()
This method is automatically called, when the TV data update is finished. |
protected abstract boolean |
doIsAllowedToDeleteProgramFilter(PluginsProgramFilter programFilter)
Really return if a program filter can be deleted. |
protected abstract void |
doLoadSettings(java.io.File userDirectory)
Really loads the settings for this plugin. |
protected abstract void |
doOnActivation()
|
protected abstract void |
doOnDeactivation()
|
protected abstract boolean |
doReceivePrograms(Program[] programArr,
ProgramReceiveTarget receiveTarget)
Really receives a list of programs from another plugin with target. |
protected abstract boolean |
doReceiveValues(java.lang.String[] values,
ProgramReceiveTarget receiveTarget)
Really receives a list of Strings from another plugin with a target. |
protected abstract void |
doSaveSettings(java.io.File userDirectory,
boolean log)
Really saves the settings for this plugin. |
PluginTreeNode |
getArtificialRootNode()
|
PluginsProgramFilter[] |
getAvailableFilter()
Returns the available program filters that the plugin supports. |
java.lang.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(Channel channel)
Gets the actions for the context menu of a channel. |
ActionMenu |
getContextMenuActions(Program program)
Gets the actions for the context menu of a program. |
ImportanceValue |
getImportanceValueForProgram(Program p)
Gets the importance value of a program.The importance of all active plugins is used to determinate the opacity of the used colors of a program, therefor a mean value of all values is used. |
PluginInfo |
getInfo()
Gets the meta information about the plugin. |
javax.swing.Icon |
getMarkIcon()
Gets the icon to use for marking programs in the program table. |
javax.swing.Icon[] |
getMarkIcons(Program p)
Gets the icons to use for marking programs in the program table. |
int |
getMarkPriorityForProgram(Program p)
Gets the mark priority for the given program that this Plugin uses. |
javax.swing.Icon |
getPluginIcon()
get the icon to represent this plugin in the settings |
ProgramReceiveTarget[] |
getProgramReceiveTargets()
Returns an array of receive target or null if there is no target |
javax.swing.Icon[] |
getProgramTableIcons(Program program)
Gets the icons this Plugin provides for the given program. |
java.lang.String |
getProgramTableIconText()
Gets the description text for the program table icons provided by this Plugin. |
SettingsTabProxy |
getSettingsTab()
Gets the SettingsTab object, which is added to the settings-window. |
void |
handlePluginException(java.lang.Throwable t)
Handles a runtime exception that was caused by the plugin. |
void |
handleTvBrowserStartFinished()
This method is called when the TV-Browser start is complete. |
void |
handleTvDataAdded(ChannelDayProgram newProg)
This method is automatically called, when TV data was added. |
void |
handleTvDataAdded(MutableChannelDayProgram newProg)
This method is automatically called, when TV data was added. |
void |
handleTvDataDeleted(ChannelDayProgram oldProg)
This method is automatically called, when TV data was deleted. |
void |
handleTvDataTouched(ChannelDayProgram removedDayProgram,
ChannelDayProgram addedDayProgram)
This method is automatically called, when TV data was touched (that means something was done with it). |
void |
handleTvDataUpdateFinished()
This method is automatically called, when the TV data update is finished. |
boolean |
hasArtificialPluginTree()
|
boolean |
isActivated()
Gets whether the plugin is currently activated. |
boolean |
isAllowedToDeleteProgramFilter(PluginsProgramFilter programFilter)
Is used to track if a program filter be deleted. |
(package private) void |
loadSettings(java.io.File userDirectory)
Loads the settings for this plugin. |
void |
onActivation()
This method is automatically called after activating the plugin (either during the TV-Browser startup phase or after manually activating the disabled plugin in the settings). |
void |
onDeactivation()
This method is automatically called after deactivating the plugin. |
boolean |
receivePrograms(Program[] programArr,
ProgramReceiveTarget receiveTarget)
Receives a list of programs from another plugin with a target. |
boolean |
receiveValues(java.lang.String[] values,
ProgramReceiveTarget receiveTarget)
Receives a list of Strings from another plugin with a target. |
void |
removeArtificialPluginTree()
|
(package private) void |
saveSettings(java.io.File userDirectory,
boolean log)
Saves the settings for this plugin. |
(package private) void |
setActivated(boolean activated)
Sets whether the plugin is currently activated. |
(package private) abstract void |
setParentFrame(java.awt.Frame parent)
Sets the parent frame to the plugin. |
java.lang.String |
toString()
Gets the name of the plugin. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface tvbrowser.core.plugin.PluginProxy |
---|
getAfterDataUpdateInfoPanel, getPluginCenterPanelWrapper, getPluginFileName, getProgramRatingIfs, getRootNode, handleTvBrowserSettingsChanged, handleTvDataUpdateStarted |
Methods inherited from interface devplugin.PluginAccess |
---|
getId |
Methods inherited from interface tvbrowser.core.plugin.ButtonActionIf |
---|
getButtonActionDescription |
Methods inherited from interface devplugin.InfoIf |
---|
getId, getPluginCategory |
Field Detail |
---|
public static final java.lang.String DEFAULT_PLUGIN_ICON_NAME
protected static final Localizer mLocalizer
Constructor Detail |
---|
protected AbstractPluginProxy()
Method Detail |
---|
public final boolean isActivated()
isActivated
in interface PluginProxy
setActivated(boolean)
,
assertActivatedState()
final void setActivated(boolean activated)
This method may only be called by the PluginProxyManager
(that's
why it is package private).
activated
- Whether the plugin is currently activated.isActivated()
,
assertActivatedState()
abstract void setParentFrame(java.awt.Frame parent)
parent
- The parent frame to set.final void loadSettings(java.io.File userDirectory) throws TvBrowserException
userDirectory
- The directory where the user data is stored.
TvBrowserException
- If loading failed.protected abstract void doLoadSettings(java.io.File userDirectory) throws TvBrowserException
userDirectory
- The directory where the user data is stored.
TvBrowserException
- If loading failed.final void saveSettings(java.io.File userDirectory, boolean log) throws TvBrowserException
userDirectory
- The directory where the user data is stored.
TvBrowserException
- If saving failed.protected abstract void doSaveSettings(java.io.File userDirectory, boolean log) throws TvBrowserException
userDirectory
- The directory where the user data is stored.
TvBrowserException
- If saving failed.public final PluginInfo getInfo()
getInfo
in interface InfoIf
getInfo
in interface PluginAccess
protected abstract PluginInfo doGetInfo()
public final SettingsTabProxy getSettingsTab()
getSettingsTab
in interface PluginProxy
null
if the plugin does
not provide this feature.protected abstract SettingsTabProxy doGetSettingsTab()
null
if the plugin does
not provide this feature.public final ActionMenu getContextMenuActions(Program program)
getContextMenuActions
in interface ContextMenuIf
program
- The program the context menu will be shown for.
null
if the plugin does not provide this feature.protected abstract ActionMenu doGetContextMenuActions(Program program)
program
- The program the context menu will be shown for.
null
if the plugin does not provide this feature.getContextMenuActions(Program)
public final ActionMenu getContextMenuActions(Channel channel)
getContextMenuActions
in interface PluginProxy
channel
- The channel the context menu will be shown for.
null
if the plugin does not provide this feature.protected abstract ActionMenu doGetContextMenuActions(Channel channel)
channel
- The channel the context menu will be shown for.
null
if the plugin does not provide this feature.getContextMenuActions(Program)
public final ActionMenu getButtonAction()
getButtonAction
in interface ButtonActionIf
getButtonAction
in interface PluginProxy
null
if the plugin does not provide this feature.protected abstract ActionMenu doGetButtonAction()
null
if the plugin does not provide this feature.getButtonAction()
public javax.swing.Icon[] getMarkIcons(Program p)
getMarkIcons
in interface Marker
getMarkIcons
in interface PluginAccess
public javax.swing.Icon getMarkIcon()
getMarkIcon
in interface Marker
getMarkIcon
in interface PluginAccess
protected abstract javax.swing.Icon[] doGetMarkIcons(Program p)
public final java.lang.String getProgramTableIconText()
Return null
if your plugin does not provide this feature.
getProgramTableIconText
in interface PluginAccess
null
if the plugin does not provide this feature.getProgramTableIcons(Program)
protected abstract java.lang.String doGetProgramTableIconText()
Return null
if your plugin does not provide this feature.
null
if the plugin does not provide this feature.getProgramTableIcons(Program)
public final javax.swing.Icon[] getProgramTableIcons(Program program)
Return null
if your plugin does not provide this feature.
getProgramTableIcons
in interface PluginAccess
program
- The programs to get the icons for.
null
.getProgramTableIconText()
protected abstract javax.swing.Icon[] doGetProgramTableIcons(Program program)
Return null
if your plugin does not provide this feature.
program
- The programs to get the icons for.
null
.getProgramTableIconText()
public final void handleTvDataUpdateFinished()
handleTvDataUpdateFinished
in interface PluginProxy
handleTvDataAdded(ChannelDayProgram)
,
handleTvDataDeleted(ChannelDayProgram)
protected abstract void doHandleTvDataUpdateFinished()
handleTvDataAdded(ChannelDayProgram)
,
handleTvDataDeleted(ChannelDayProgram)
public void handleTvDataAdded(MutableChannelDayProgram newProg)
The TV data can be modified by the plugin!
Override this method if you want to change/add data.
Don't do other things than changing/adding data,
use handleTvDataAdded(ChannelDayProgram)
instead.
newProg
- The new ChannelDayProgram.handleTvDataDeleted(ChannelDayProgram)
,
handleTvDataTouched(ChannelDayProgram, ChannelDayProgram)
protected abstract void doHandleTvDataAdded(MutableChannelDayProgram newProg)
The TV data can be modified by the plugin!
Override this method if you want to change/add data.
Don't do other things than changing/adding data,
use handleTvDataAdded(ChannelDayProgram)
instead.
newProg
- The new ChannelDayProgram.handleTvDataDeleted(ChannelDayProgram)
,
handleTvDataTouched(ChannelDayProgram, ChannelDayProgram)
public final void handleTvDataAdded(ChannelDayProgram newProg)
The TV data may be modified by the plugin! So this method must be called before new TV data is saved.
handleTvDataAdded
in interface PluginProxy
newProg
- The new ChannelDayProgram.handleTvDataDeleted(ChannelDayProgram)
,
handleTvDataUpdateFinished()
protected abstract void doHandleTvDataAdded(ChannelDayProgram newProg)
The TV data may be modified by the plugin! So this method must be called before new TV data is saved.
newProg
- The new ChannelDayProgram.handleTvDataDeleted(ChannelDayProgram)
,
handleTvDataUpdateFinished()
public final void handleTvDataDeleted(ChannelDayProgram oldProg)
handleTvDataDeleted
in interface PluginProxy
oldProg
- The old ChannelDayProgram which was deleted.handleTvDataAdded(ChannelDayProgram)
,
handleTvDataUpdateFinished()
protected abstract void doHandleTvDataDeleted(ChannelDayProgram oldProg)
oldProg
- The old ChannelDayProgram which was deleted.handleTvDataAdded(ChannelDayProgram)
,
handleTvDataUpdateFinished()
public final void handleTvDataTouched(ChannelDayProgram removedDayProgram, ChannelDayProgram addedDayProgram)
handleTvDataTouched
in interface PluginProxy
removedDayProgram
- The old ChannelDayProgram.addedDayProgram
- The new ChannelDayProgram.handleTvDataAdded(ChannelDayProgram)
,
handleTvDataDeleted(ChannelDayProgram)
,
handleTvDataUpdateFinished()
protected abstract void doHandleTvDataTouched(ChannelDayProgram removedDayProgram, ChannelDayProgram addedDayProgram)
The TV data may be modified by the plugin! So this method must be called before new TV data is saved.
removedDayProgram
- The previous ChannelDayProgram.addedDayProgram
- The new ChannelDayProgram.handleTvDataAdded(ChannelDayProgram)
,
handleTvDataDeleted(ChannelDayProgram)
,
handleTvDataUpdateFinished()
public void onActivation()
PluginProxy
onActivation
in interface PluginProxy
protected abstract void doOnActivation()
public void onDeactivation()
PluginProxy
onDeactivation
in interface PluginProxy
protected abstract void doOnDeactivation()
public boolean canUseProgramTree()
canUseProgramTree
in interface PluginProxy
public void handleTvBrowserStartFinished()
handleTvBrowserStartFinished
in interface PluginProxy
protected abstract void doHandleTvBrowserStartFinished()
protected abstract boolean doCanUseProgramTree()
public final java.lang.String toString()
This way Plugin objects may be used directly in GUI components like JLists.
toString
in class java.lang.Object
public void handlePluginException(java.lang.Throwable t)
handlePluginException
in interface PluginProxy
t
- The exception to handlepublic final boolean canReceiveProgramsWithTarget()
canReceiveProgramsWithTarget
in interface ProgramReceiveIf
receivePrograms(Program[],ProgramReceiveTarget)
protected abstract boolean doCanReceiveProgramsWithTarget()
receivePrograms(Program[],ProgramReceiveTarget)
public final boolean receivePrograms(Program[] programArr, ProgramReceiveTarget receiveTarget)
receivePrograms
in interface ProgramReceiveIf
programArr
- The programs passed from the other plugin.receiveTarget
- The target of the programs.
true
, if the programs were correctly received and the
target really exists.canReceiveProgramsWithTarget()
protected abstract boolean doReceivePrograms(Program[] programArr, ProgramReceiveTarget receiveTarget)
programArr
- The programs passed from the other plugin with target.receiveTarget
- The target of the programs.canReceiveProgramsWithTarget()
public final boolean receiveValues(java.lang.String[] values, ProgramReceiveTarget receiveTarget)
receiveValues
in interface ProgramReceiveIf
values
- The value array passed from the other plugin.receiveTarget
- The receive target of the programs.
true
if the value array was handled correct,
false otherwise.canReceiveProgramsWithTarget()
protected abstract boolean doReceiveValues(java.lang.String[] values, ProgramReceiveTarget receiveTarget)
values
- The value array passed from the other plugin.receiveTarget
- The receive target of the programs.
true
if the value array was handled correct,
false otherwise.canReceiveProgramsWithTarget()
public final ProgramReceiveTarget[] getProgramReceiveTargets()
null
if there is no target
getProgramReceiveTargets
in interface ProgramReceiveIf
canReceiveProgramsWithTarget()
,
receivePrograms(Program[],ProgramReceiveTarget)
protected abstract ProgramReceiveTarget[] doGetProgramReceiveTargets()
null
if there is no target
canReceiveProgramsWithTarget()
,
receivePrograms(Program[],ProgramReceiveTarget)
public PluginsProgramFilter[] getAvailableFilter()
getAvailableFilter
in interface PluginAccess
null
if it supports no filter.protected abstract PluginsProgramFilter[] doGetAvailableFilter()
null
if it supports no filter.public boolean isAllowedToDeleteProgramFilter(PluginsProgramFilter programFilter)
isAllowedToDeleteProgramFilter
in interface PluginProxy
programFilter
- The program filter to delete.
protected abstract boolean doIsAllowedToDeleteProgramFilter(PluginsProgramFilter programFilter)
programFilter
- The program filter to delete.
public java.lang.Class<? extends PluginsFilterComponent>[] getAvailableFilterComponentClasses()
(Class extends PluginsFilterComponent>[]) new Class[] {MyFilterComponent1.class,MyFilterComponent2.class};
because the creation of a class array with generic type didn't work.
getAvailableFilterComponentClasses
in interface PluginAccess
null
if no plugins filter components are supported.protected abstract java.lang.Class<? extends PluginsFilterComponent>[] doGetAvailableFilterComponentClasses()
null
if no plugins filter components are supported.public int getMarkPriorityForProgram(Program p)
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
.
getMarkPriorityForProgram
in interface Marker
p
- The program to get the mark prioriy for.
protected abstract int doGetMarkPriorityForProgram(Program p)
p
- The program to get the mark priority for.
protected void assertActivatedState() throws TvBrowserException
TvBrowserException
- If the plugin is not activatedpublic javax.swing.Icon getPluginIcon()
PluginProxy
getPluginIcon
in interface PluginProxy
public final boolean hasArtificialPluginTree()
hasArtificialPluginTree
in interface PluginProxy
public final void addToArtificialPluginTree(MutableProgram program)
addToArtificialPluginTree
in interface PluginProxy
public final PluginTreeNode getArtificialRootNode()
getArtificialRootNode
in interface PluginProxy
public final void removeArtificialPluginTree()
public int compareTo(ProgramReceiveIf other)
compareTo
in interface java.lang.Comparable<ProgramReceiveIf>
public final ImportanceValue getImportanceValueForProgram(Program p)
The importance value can be created as a weighted total of the following values.
Program.DEFAULT_PROGRAM_IMPORTANCE
,Program.MIN_PROGRAM_IMPORTANCE
,Program.LOWER_MEDIUM_PROGRAM_IMPORTANCE
,Program.MEDIUM_PROGRAM_IMPORTANCE
,Program.HIGHER_MEDIUM_PROGRAM_IMPORTANCE
orProgram.MAX_PROGRAM_IMPORTANCE
.
getImportanceValueForProgram
in interface PluginProxy
p
- The program to get the importance value for.
protected abstract ImportanceValue doGetImportanceValueForProgram(Program p)
The importance value can be created as a weighted total of the following values.
Program.DEFAULT_PROGRAM_IMPORTANCE
,Program.MIN_PROGRAM_IMPORTANCE
,Program.LOWER_MEDIUM_PROGRAM_IMPORTANCE
,Program.MEDIUM_PROGRAM_IMPORTANCE
,Program.HIGHER_MEDIUM_PROGRAM_IMPORTANCE
orProgram.MAX_PROGRAM_IMPORTANCE
.
p
- The program to get the importance value for.
|
TV-Browser 3.3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |