Source code: com/eireneh/bible/passage/swing/VerseRangeTreeNode.java
1
2 package com.eireneh.bible.passage.swing;
3
4 import java.util.Enumeration;
5 import javax.swing.tree.*;
6 import javax.swing.event.*;
7 import com.eireneh.bible.passage.*;
8
9 /**
10 * BibleTreeNode.
11 *
12 * <table border='1' cellPadding='3' cellSpacing='0' width="100%">
13 * <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
14 * Distribution Licence:<br />
15 * Project B is free software; you can redistribute it
16 * and/or modify it under the terms of the GNU General Public License,
17 * version 2 as published by the Free Software Foundation.<br />
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.<br />
22 * The License is available on the internet
23 * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
24 * <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25 * MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
26 * The copyright to this program is held by it's authors.
27 * </font></td></tr></table>
28 * @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
29 * @see docs.Licence
30 * @author Joe Walker
31 */
32 public class VerseRangeTreeNode implements TreeNode
33 {
34 /**
35 *
36 */
37 public VerseRangeTreeNode(VerseRange range)
38 {
39 this.range = range;
40 }
41
42 /**
43 * Returns the child <code>TreeNode</code> at index i
44 */
45 public TreeNode getChildAt(int index)
46 {
47 return null;
48 }
49
50 /**
51 * Returns the number of children <code>TreeNode</code>s the receiver
52 * contains.
53 */
54 public int getChildCount()
55 {
56 return 0;
57 }
58
59 /**
60 * Returns the parent <code>TreeNode</code> of the receiver.
61 */
62 public TreeNode getParent()
63 {
64 return this;
65 }
66
67 /**
68 * Returns the index of <code>node</code> in the receivers children.
69 * If the receiver does not contain <code>node</code>, -1 will be
70 * returned.
71 */
72 public int getIndex(TreeNode node)
73 {
74 return -1;
75 }
76
77 /**
78 * Returns true if the receiver allows children.
79 */
80 public boolean getAllowsChildren()
81 {
82 return false;
83 }
84
85 /**
86 * Returns true if the receiver is a leaf.
87 */
88 public boolean isLeaf()
89 {
90 return true;
91 }
92
93 /**
94 * Returns the children of the reciever as an Enumeration.
95 */
96 public Enumeration children()
97 {
98 return null;
99 }
100
101 /**
102 * Returns the children of the reciever as an Enumeration.
103 */
104 public String toString()
105 {
106 return range.getName();
107 }
108
109 /** The range that we are displaying */
110 private VerseRange range = null;
111 }
112