Statistics
| Revision:

root / org.gvsig.proj / branches / refactor2018 / org.gvsig.proj / org.gvsig.proj.swing / org.gvsig.proj.swing.impl / src / main / java / org / gvsig / proj / swing / impl / tree / LeafNode.java @ 852

History | View | Annotate | Download (864 Bytes)

1
package org.gvsig.proj.swing.impl.tree;
2

    
3
import java.util.Collections;
4
import java.util.Enumeration;
5

    
6
import javax.swing.ImageIcon;
7
import javax.swing.tree.TreeNode;
8

    
9
public class LeafNode implements TreeNode {
10
        private BranchNode parent;
11

    
12
        public LeafNode(BranchNode parent) {
13
                this.parent = parent;
14
        }
15

    
16
        @Override
17
        public TreeNode getChildAt(int childIndex) {
18
                return null;
19
        }
20

    
21
        @Override
22
        public int getChildCount() {
23
                return 0;
24
        }
25

    
26
        @Override
27
        public TreeNode getParent() {
28
                return parent;
29
        }
30

    
31
        @Override
32
        public int getIndex(TreeNode node) {
33
                return -1;
34
        }
35

    
36
        @Override
37
        public boolean getAllowsChildren() {
38
                return false;
39
        }
40

    
41
        @Override
42
        public boolean isLeaf() {
43
                return true;
44
        }
45

    
46
        @SuppressWarnings("rawtypes")
47
        @Override
48
        public Enumeration children() {
49
                return Collections.emptyEnumeration();
50
        }
51

    
52
        public ImageIcon getIcon() {
53
                return null;
54
        };
55
}