Module tvbrowser
Package devplugin

Class PluginTreeNode

  • All Implemented Interfaces:
    java.lang.Comparable<PluginTreeNode>

    public class PluginTreeNode
    extends java.lang.Object
    implements java.lang.Comparable<PluginTreeNode>
    The PluginTreeNode class represents a single node of the plugin tree view.
    • Constructor Detail

      • PluginTreeNode

        public PluginTreeNode​(java.lang.String title)
        Creates a new PluginTreeNode object with a specified title
        Parameters:
        title - The title for the node.
      • PluginTreeNode

        public PluginTreeNode​(Marker marker)
        Creates a new root PluginTreeNode On TV listings updates, the PluginTreeListener gets informed.
        Parameters:
        marker - The Marker to create the root node for.
      • PluginTreeNode

        public PluginTreeNode​(Plugin plugin)
        creates a plugin root node WITHOUT marker
        Parameters:
        plugin - The Plugin to create the root node for.
        Since:
        3.0
      • PluginTreeNode

        public PluginTreeNode​(boolean handleTvDataUpdate,
                              Plugin plugin)
        Creates a new root PluginTreeNode
        Parameters:
        plugin - The plugin to create the root node for.
        handleTvDataUpdate - specifies, if the PluginTreeListener should get called on TV listings updates
        Since:
        3.0
      • PluginTreeNode

        public PluginTreeNode​(Marker marker,
                              boolean handleTvDataUpdate)
        Creates a new root PluginTreeNode
        Parameters:
        marker - The Marker to create the root node for.
        handleTvDataUpdate - specifies, if the PluginTreeListener should get called on TV listings updates
      • PluginTreeNode

        public PluginTreeNode​(ProgramItem item)
        Creates a new Node containing a program item.
        Parameters:
        item - The program item to create the node for.
    • Method Detail

      • removeAllNodeListeners

        public void removeAllNodeListeners()
      • getMutableTreeNode

        public Node getMutableTreeNode()
      • addActionMenu

        public void addActionMenu​(ActionMenu menu)
        Adds a an action menu to this node
        Parameters:
        menu - The action menu to add to this node.
      • removeAllActions

        public void removeAllActions()
      • addAction

        public void addAction​(javax.swing.Action action)
      • getActionMenus

        public ActionMenu[] getActionMenus()
      • setNodeFormatter

        public void setNodeFormatter​(NodeFormatter formatter)
        Sets the formatter for this node and all of the child nodes.
        Parameters:
        formatter - the formatter
      • setGroupingByDateEnabled

        public void setGroupingByDateEnabled​(boolean enable)
        Enables/Disables the 'grouping by date'-feature. Default is 'enabled'
        Parameters:
        enable - true if grouping should be enabled, false if not.
      • setGroupingByWeekEnabled

        public void setGroupingByWeekEnabled​(boolean enable)
        Enables/Disables 'grouping by week' for nodes showing programs by date. Only evaluated if "grouping by date" is enabled. Default is 'disabled'
        Parameters:
        enable - true if grouping should be enabled, false if not.
        See Also:
        setGroupingByDateEnabled(boolean)
      • getUserObject

        public java.lang.Object getUserObject()
      • removeAllChildren

        public void removeAllChildren()
      • contains

        public boolean contains​(Program prog,
                                boolean recursive)
      • contains

        public boolean contains​(Program prog)
      • update

        public void update()
        Refreshes the tree in the user interface. Call this method after you have added/removed/changed nodes of the tree or its children. Otherwise those changes will not get visible.
      • addPrograms

        public void addPrograms​(java.util.List<Program> listNew)
        Add several program as children to this tree node. If the programs are already contained in this sub tree, it is not added again.
        After you have finished adding all programs, you need to call update() to refresh the UI.
        Parameters:
        listNew - list of new programs
      • addProgram

        public PluginTreeNode addProgram​(Program program)
        Add a single program as child to this tree node. If the program is already contained in this sub tree, it is not added again.
        After you have finished adding all programs, you need to call update() to refresh the UI.
        Parameters:
        program - The program to add.
        Returns:
        the tree node containing the program
      • addProgramWithoutCheck

        public PluginTreeNode addProgramWithoutCheck​(Program program)
        Add a single program node as child to this tree node. It is not checked if the program is already contained in this sub tree, so you may only use this method with newly created tree nodes!
        After you have finished adding all programs, you need to call update() to refresh the UI.
        Parameters:
        program - The program to add.
        Returns:
        the tree node containing the program
      • removeProgram

        public void removeProgram​(ProgramItem item)
      • removeProgram

        public void removeProgram​(Program program)
      • getProgramItems

        public ProgramItem[] getProgramItems()
      • getPrograms

        public Program[] getPrograms()
      • store

        public void store​(java.io.ObjectOutputStream out)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • load

        public void load​(java.io.ObjectInputStream in)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • size

        public int size()
        Get the number of child nodes.
        Returns:
        number of child nodes
      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • isLeaf

        public boolean isLeaf()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getChildren

        public PluginTreeNode[] getChildren()
        Returns:
        copy of child node collection
        Since:
        3.0