1 /*
2 * File: TimeBarNode.java
3 * Copyright (c) 2004-2007 Peter Kliem (Peter.Kliem@jaret.de)
4 * A commercial license is available, see http://www.jaret.de.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20 package de.jaret.util.ui.timebars.model;
21
22 import java.util.List;
23
24 /**
25 * Interface describing a time bar row in a hierarchy of rows.
26 *
27 * @author Peter Kliem
28 * @version $Id: TimeBarNode.java 800 2008-12-27 22:27:33Z kliem $
29 */
30 public interface TimeBarNode extends TimeBarRow {
31 /**
32 * Retrieve all children of the node.
33 *
34 * @return chrildren of the node
35 */
36 List<TimeBarNode> getChildren();
37
38 /**
39 * Retrieve the level in the tree.
40 *
41 * @return level in the tree.
42 */
43 int getLevel();
44
45 /**
46 * Tell the node it's level. Storing the level of the node directly with the node is not an optimal solution.
47 * However it is fast and straight forward.
48 *
49 * @param level level of the node
50 */
51 void setLevel(int level);
52
53 /**
54 * Add a node as a child.
55 *
56 * @param node child to be added.
57 */
58 void addNode(TimeBarNode node);
59
60 /**
61 * Remove a child node.
62 *
63 * @param node node to remove
64 */
65 void remNode(TimeBarNode node);
66
67 /**
68 * Add a listener to listen for node changes.
69 *
70 * @param tbnl listener to add
71 */
72 void addTimeBarNodeListener(TimeBarNodeListener tbnl);
73
74 /**
75 * Remove a listener registered for node changes.
76 *
77 * @param tbnl listener to remove
78 */
79 void removeTimeBarNodeListener(TimeBarNodeListener tbnl);
80
81 }