1 7 8 package org.jdesktop.jdnc; 9 10 import javax.swing.JScrollPane ; 11 import javax.swing.tree.DefaultTreeModel ; 12 import javax.swing.tree.TreeModel ; 13 14 import org.jdesktop.swing.decorator.FilterPipeline; 15 import org.jdesktop.swing.decorator.HighlighterPipeline; 16 import org.jdesktop.swing.JXTree; 17 18 32 public class JNTree extends JNComponent { 33 36 public JNTree() { 37 this(new DefaultTreeModel (null)); 38 } 39 40 47 public JNTree(TreeModel model) { 48 tree = new JXTree(model); 49 add(new JScrollPane (tree)); } 51 52 57 public JXTree getTree() { 58 return tree; 59 } 60 61 66 public TreeModel getTreeModel() { 67 return getTree().getModel(); 68 } 69 70 79 public void setTreeModel(TreeModel model) { 80 getTree().setModel(model); 81 } 82 83 97 public int getRowHeight() { 98 return getTree().getRowHeight(); 99 } 100 101 104 public void setRowHeight(int value) { 105 getTree().setRowHeight(value); 106 } 107 108 117 public int getSelectionMode() { 118 return getTree().getSelectionModel().getSelectionMode(); 119 } 120 121 124 public void setSelectionMode(int mode) { 125 getTree().getSelectionModel().setSelectionMode(mode); 126 } 127 128 137 138 public FilterPipeline getFilters() { 139 return getTree().getFilters(); 140 } 141 142 public void setFilters(FilterPipeline pipeline) { 143 getTree().setFilters(pipeline); 144 } 145 146 public HighlighterPipeline getHighlighters() { 147 return getTree().getHighlighters(); 148 } 149 150 153 public void setHighlighters(HighlighterPipeline pipeline) { 154 getTree().setHighlighters(pipeline); 155 } 156 157 160 public void collapseRow(int row) { 161 getTree().collapseRow(row); 162 } 163 164 167 public void expandRow(int row) { 168 getTree().expandRow(row); 169 } 170 171 174 public void collapseAll() { 175 getTree().collapseAll(); 176 } 177 178 181 public void expandAll() { 182 getTree().expandAll(); 183 } 184 185 protected JXTree tree = null; 186 } 187 | Popular Tags |