public class FavoriteTreeModel
extends javax.swing.tree.DefaultTreeModel
Modifier and Type | Method and Description |
---|---|
void |
addFavorite(Favorite fav)
Adds a favorite to this tree at the root node.
|
FavoriteNode |
addFavorite(Favorite fav,
FavoriteNode parent)
Adds a favorite to this tree at the given target node.
|
void |
deleteFavorite(Favorite favorite)
Deletes a favorite.
|
void |
deleteFavorite(Favorite favorite,
boolean updateRootNode)
Deletes a favorite.
|
Favorite[] |
getFavoriteArr()
Gets all favorites in an array.
|
Favorite[] |
getFavoriteArr(FavoriteNode node,
boolean withChilds) |
static java.lang.String |
getFavoriteLabel(Favorite favorite,
Program program) |
static java.lang.String |
getFavoriteLabel(Favorite favorite,
Program p,
Channel currentChannel) |
Favorite[] |
getFavoritesContainingProgram(Program program)
get an array of all favorites containing the given program
|
Favorite[] |
getFavoritesContainingReceiveTarget(ProgramReceiveTarget target)
Gets the Favorites containing the given receive target in an array.
|
static FavoriteTreeModel |
getInstance() |
static int[] |
getProgramsCount(FavoriteNode node)
Calculates the number of programs contained in the children
|
static FavoriteTreeModel |
initInstance(Favorite[] favoriteArr) |
static FavoriteTreeModel |
initInstance(java.io.ObjectInputStream in,
int version) |
boolean |
isContainedByOtherFavorites(Favorite favorite,
Program p)
Check if a program is marked by other Favorites to.
|
boolean |
isInMultipleFavorites(Program program) |
boolean |
isLeaf(java.lang.Object nodeObject) |
void |
reload() |
void |
reload(FavoriteTree tree,
javax.swing.tree.TreeNode node) |
void |
reload(javax.swing.tree.TreeNode node) |
void |
resetMultiplesCounter() |
void |
reValidateChannelLimitations() |
void |
sort(FavoriteNode node,
java.util.Comparator<FavoriteNode> comp,
java.lang.String title)
Sorts the path from the given node to all leafs alphabetically.
|
void |
storeData(java.io.ObjectOutputStream out)
Saves the data of this tree into the given stream.
|
void |
updatePluginTree(PluginTreeNode topicNode,
java.util.ArrayList<Program> allPrograms) |
void |
updatePluginTree(PluginTreeNode node,
java.util.ArrayList<Program> allPrograms,
FavoriteNode parentFavorite) |
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
public static FavoriteTreeModel initInstance(Favorite[] favoriteArr)
public static FavoriteTreeModel initInstance(java.io.ObjectInputStream in, int version) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public static FavoriteTreeModel getInstance()
public void reload(javax.swing.tree.TreeNode node)
reload
in class javax.swing.tree.DefaultTreeModel
public void reload(FavoriteTree tree, javax.swing.tree.TreeNode node)
public void reload()
reload
in class javax.swing.tree.DefaultTreeModel
public boolean isLeaf(java.lang.Object nodeObject)
isLeaf
in interface javax.swing.tree.TreeModel
isLeaf
in class javax.swing.tree.DefaultTreeModel
public Favorite[] getFavoriteArr()
public Favorite[] getFavoriteArr(FavoriteNode node, boolean withChilds)
public void deleteFavorite(Favorite favorite)
favorite
- The favorite to delete.public void deleteFavorite(Favorite favorite, boolean updateRootNode)
favorite
- The favorite to delete.updateRootNode
- If the root node should be updated.public boolean isContainedByOtherFavorites(Favorite favorite, Program p)
favorite
- The Favorite that wants to check this.p
- The program to check.public void addFavorite(Favorite fav)
fav
- The favorite to add.public FavoriteNode addFavorite(Favorite fav, FavoriteNode parent)
fav
- The favorite to add.parent
- The parent node to add the favorite to or null
if the
root node should be used.public static java.lang.String getFavoriteLabel(Favorite favorite, Program program)
public static java.lang.String getFavoriteLabel(Favorite favorite, Program p, Channel currentChannel)
public void storeData(java.io.ObjectOutputStream out) throws java.io.IOException
out
- The stream to write the data to.java.io.IOException
- Thrown if something went wrongpublic void updatePluginTree(PluginTreeNode node, java.util.ArrayList<Program> allPrograms, FavoriteNode parentFavorite)
public static int[] getProgramsCount(FavoriteNode node)
node
- use this Nodepublic void sort(FavoriteNode node, java.util.Comparator<FavoriteNode> comp, java.lang.String title)
node
- The node to sort from.comp
- Comparator for sortingtitle
- Title of confirmation message dialogpublic Favorite[] getFavoritesContainingReceiveTarget(ProgramReceiveTarget target)
target
- The target to check.public void updatePluginTree(PluginTreeNode topicNode, java.util.ArrayList<Program> allPrograms)
public Favorite[] getFavoritesContainingProgram(Program program)
program
- program to search forpublic boolean isInMultipleFavorites(Program program)
public void resetMultiplesCounter()
public void reValidateChannelLimitations()
TV-Browser 3.4.4, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)