TV-Browser 3.3.3 API

tvbrowser.extras.favoritesplugin.dlgs
Class FavoriteNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by tvbrowser.extras.favoritesplugin.dlgs.FavoriteNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<FavoriteNode>, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class FavoriteNode
extends javax.swing.tree.DefaultMutableTreeNode
implements java.lang.Comparable<FavoriteNode>

A node for the favorite tree.

Since:
2.6
Author:
René Mach
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
  FavoriteNode(java.lang.Object userObject)
          Creates an instance of this class with the given Object as userObject of this node.
protected FavoriteNode(java.io.ObjectInputStream in, int version)
          Reads the node from an ObjectInputStream.
 
Method Summary
 FavoriteNode add(Favorite fav)
          Add a favorite to this node if this is a directory node.
 int compareTo(FavoriteNode other)
           
 boolean containsFavorite()
          Gets if this node contains a favorite.
 boolean equals(java.lang.Object o)
           
 Program[] getAllPrograms(boolean onlyNotExpiredPrograms)
          Gets all programs contained in this node and all children of it.
 Favorite getFavorite()
          Gets the favorite contained by this node if there is one.
 boolean isDirectoryNode()
          Gets if this node is a directory node.
 void reValidateChannelLimitations()
          Tries to load the channel limitation for all childs again.
protected  void setWasExpanded(boolean expanded)
           
protected  void store(java.io.ObjectOutputStream out)
           
 java.lang.String toString()
           
protected  boolean wasExpanded()
           
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FavoriteNode

public FavoriteNode(java.lang.Object userObject)
Creates an instance of this class with the given Object as userObject of this node.

Parameters:
userObject - The user object for this node.

FavoriteNode

protected FavoriteNode(java.io.ObjectInputStream in,
                       int version)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException
Reads the node from an ObjectInputStream.

Parameters:
in - The ObjectInputStream to read from.
version - The version of the data file.
Throws:
java.io.IOException - Thrown if something went wrong.
java.lang.ClassNotFoundException - Thrown if something went wrong.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode

containsFavorite

public boolean containsFavorite()
Gets if this node contains a favorite.

Returns:
True if this node contains a favorite, false otherwise.

isDirectoryNode

public boolean isDirectoryNode()
Gets if this node is a directory node.

Returns:
True if this node is a directory node, false otherwise.

getFavorite

public Favorite getFavorite()
Gets the favorite contained by this node if there is one.

Returns:
The favorite contained by this node or null if there is no favorite.

wasExpanded

protected boolean wasExpanded()

setWasExpanded

protected void setWasExpanded(boolean expanded)

add

public FavoriteNode add(Favorite fav)
Add a favorite to this node if this is a directory node.

Parameters:
fav - The favorite to add.
Returns:
the newly created sub node or null

store

protected void store(java.io.ObjectOutputStream out)
              throws java.io.IOException
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(FavoriteNode other)
Specified by:
compareTo in interface java.lang.Comparable<FavoriteNode>

getAllPrograms

public Program[] getAllPrograms(boolean onlyNotExpiredPrograms)
Gets all programs contained in this node and all children of it.

Parameters:
onlyNotExpiredPrograms - true if only not expired programs should be returned, false otherwise.
Returns:
All programs contained in this node and all children of it.

reValidateChannelLimitations

public void reValidateChannelLimitations()
Tries to load the channel limitation for all childs again.


TV-Browser 3.3.3 API

TV-Browser 3.3.3, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)