⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 invisibletreemodel.java

📁 Java中Swing界面库中几个类使用的例子
💻 JAVA
字号:
/*  (swing1.1) */ package jp.gr.java_conf.tame.swing.tree;import javax.swing.tree.*;/** * @version 1.0 01/12/99 */public class InvisibleTreeModel extends DefaultTreeModel {  protected boolean filterIsActive;  public InvisibleTreeModel(TreeNode root) {    this(root, false);  }  public InvisibleTreeModel(TreeNode root, boolean asksAllowsChildren) {    this(root, false, false);  }  public InvisibleTreeModel(TreeNode root, boolean asksAllowsChildren			    ,boolean filterIsActive) {    super(root, asksAllowsChildren);    this.filterIsActive = filterIsActive;  }  public void activateFilter(boolean newValue) {    filterIsActive = newValue;  }  public boolean isActivatedFilter() {    return filterIsActive;  }  public Object getChild(Object parent, int index) {    if (filterIsActive) {      if (parent instanceof InvisibleNode) {	return ((InvisibleNode)parent).getChildAt(index,filterIsActive);      }    }    return ((TreeNode)parent).getChildAt(index);  }  public int getChildCount(Object parent) {    if (filterIsActive) {      if (parent instanceof InvisibleNode) {	return ((InvisibleNode)parent).getChildCount(filterIsActive);      }    }    return ((TreeNode)parent).getChildCount();  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -