PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/worldwind/kml/tree/KMLDocTreeNode.java

http://wwj-kml.googlecode.com/
Java | 44 lines | 29 code | 8 blank | 7 comment | 1 complexity | 7e50b139c2f5c82ad256185797076fde MD5 | raw file
 1package worldwind.kml.tree;
 2
 3import worldwind.kml.model.KMLFile;
 4import worldwind.kml.model.KMLFolder;
 5import worldwind.kml.KMLLayer;
 6
 7import javax.swing.tree.DefaultMutableTreeNode;
 8import java.util.List;
 9
10/**
11 * Created by IntelliJ IDEA.
12 * User: tgleason
13 * Date: Sep 6, 2008
14 * Time: 8:31:14 PM
15 * To change this template use File | Settings | File Templates.
16 */
17public class KMLDocTreeNode extends DefaultMutableTreeNode {
18    KMLFile kmlFile;
19    KMLLayer layer;
20    String name;
21
22    public KMLDocTreeNode(KMLFile kmlFile, String name) {
23        this.kmlFile = kmlFile;
24        this.name = name;
25
26        List<KMLFolder> folders = kmlFile.getRootFolder().getChildFolders();
27        for (KMLFolder folder : folders) {
28            add(new KMLFolderTreeNode(folder));
29        }
30    }
31
32    public KMLDocTreeNode(KMLFile kmlFile, String name, KMLLayer layer) {
33        this(kmlFile, name);
34        this.layer = layer;
35    }
36
37    public String toString() {
38        return name;
39    }
40
41    public KMLLayer getLayer() {
42        return layer;
43    }
44}