public class FavoriteTreeModel extends DefaultTreeModel
asksAllowsChildren, listenerList, root
Modifier and Type | Method and Description |
---|---|
void |
addFavorite(Favorite fav)
Adds a favorite to this tree at the root node.
|
void |
addFavorite(Favorite fav,
FavoriteNode target)
Adds a favorite to this tree at the given target node.
|
void |
deleteFavorite(Favorite favorite)
Deletes a favorite.
|
Favorite[] |
getFavoriteArr()
Gets all favorites in an array.
|
static String |
getFavoriteLabel(Favorite favorite,
Program program) |
static 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(ObjectInputStream in,
int version) |
boolean |
isContainedByOtherFavorites(Favorite favorite,
Program p)
Check if a program is marked by other Favorites to.
|
boolean |
isLeaf(Object nodeObject) |
void |
reload() |
void |
reload(FavoriteTree tree,
TreeNode node) |
void |
reload(TreeNode node) |
void |
sort(FavoriteNode node,
boolean start,
Comparator<FavoriteNode> comp,
String title)
Sorts the path from the given node to all leafs alphabetically.
|
void |
storeData(ObjectOutputStream out)
Saves the data of this tree into the given stream.
|
void |
updatePluginTree(PluginTreeNode rootNode) |
void |
updatePluginTree(PluginTreeNode node,
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(ObjectInputStream in, int version) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static FavoriteTreeModel getInstance()
public void reload(TreeNode node)
reload
in class DefaultTreeModel
public void reload(FavoriteTree tree, TreeNode node)
public void reload()
reload
in class DefaultTreeModel
public boolean isLeaf(Object nodeObject)
isLeaf
in interface TreeModel
isLeaf
in class DefaultTreeModel
public Favorite[] getFavoriteArr()
public void deleteFavorite(Favorite favorite)
favorite
- The favorite to delete.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 void addFavorite(Favorite fav, FavoriteNode target)
fav
- The favorite to add.target
- The target node to add the favorite to or
null
if the root node should be used.public static String getFavoriteLabel(Favorite favorite, Program p, Channel currentChannel)
public void storeData(ObjectOutputStream out) throws IOException
out
- The stream to write the data to.IOException
- Thrown if something went wrongpublic void updatePluginTree(PluginTreeNode node, FavoriteNode parentFavorite)
public static int[] getProgramsCount(FavoriteNode node)
node
- use this Nodepublic void sort(FavoriteNode node, boolean start, Comparator<FavoriteNode> comp, String title)
node
- The node to sort from.start
- If this is called with the root sort node.comp
- Comparator for sortingtitle
- Title of confirmation message dialogpublic Favorite[] getFavoritesContainingReceiveTarget(ProgramReceiveTarget target)
target
- The target to check.public void updatePluginTree(PluginTreeNode rootNode)
TV-Browser 2.7.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)