当前位置: 首页>>代码示例>>Java>>正文


Java TreeTableNode类代码示例

本文整理汇总了Java中org.jdesktop.swingx.treetable.TreeTableNode的典型用法代码示例。如果您正苦于以下问题:Java TreeTableNode类的具体用法?Java TreeTableNode怎么用?Java TreeTableNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TreeTableNode类属于org.jdesktop.swingx.treetable包,在下文中一共展示了TreeTableNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findFirst

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
public Optional<ChoiceNode> findFirst(Predicate<ChoiceNode> predicate) {
    if (predicate.test(this)) {
        return Optional.of(this);
    }
    for (int index = getChildCount(); --index >= 0; ) {
        TreeTableNode child = getChildAt(index);
        if (child instanceof ChoiceNode) {
            ChoiceNode cnode = (ChoiceNode) child;
            Optional<ChoiceNode> opt = cnode.findFirst(predicate);
            if (opt.isPresent()) {
                return opt;
            }
        }
    }
    return Optional.empty();
}
 
开发者ID:kddart,项目名称:kdxplore,代码行数:17,代码来源:ChoiceNode.java

示例2: getFilteringClause

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
/**
 * 
 * @return String or null
 */
public String getFilteringClause() {
	StringBuilder sb = new StringBuilder();
	String sep = ""; //$NON-NLS-1$

	TreeTableNode root = treeTableModel.getRoot();
	int nChildren = root.getChildCount();
	for (int i = 0; i < nChildren; ++i) {
		LookupTableNode ltnode = (LookupTableNode) root.getChildAt(i);
		String clause = ltnode.getFilteringClause();
		if (clause!=null) {
			sb.append(sep).append(clause);
			sep = "&"; //$NON-NLS-1$
		}
	}
	
	return sb.length()<=0 ? null : sb.toString();
}
 
开发者ID:kddart,项目名称:kdxplore,代码行数:22,代码来源:TrialSelectionSearchOptionsPanel.java

示例3: interactiveNoIconsNoUnwrap

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
/**
 * Requirements
 * - no icons, use IconValue.NONE
 * - don't unwrap user object
 */
public void interactiveNoIconsNoUnwrap() {
    TreeModel model = new ActionMapTreeTableModel(new JXTable());
    JXTree tree = new JXTree(model);
    StringValue sv = new StringValue() {

        public String getString(Object value) {
            if ((value instanceof TreeTableNode) 
                    && ((TreeTableNode) value).getColumnCount() > 0) {
                value = ((TreeTableNode) value).getValueAt(0);
            }
            return StringValues.TO_STRING.getString(value);
        }
        
    };
    DefaultTreeRenderer renderer = new DefaultTreeRenderer(IconValues.NONE, sv);
    ((WrappingProvider) renderer.getComponentProvider()).setUnwrapUserObject(false);
    tree.setCellRenderer(renderer);
    JXFrame frame = wrapWithScrollingInFrame(tree, "WrappingProvider: no icons, no unwrapped userObject");
    frame.pack();
    frame.setSize(400, 200);
    frame.setVisible(true);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:28,代码来源:JXTreeVisualCheck.java

示例4: setChosen

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
protected void setChosen(boolean b, List<ChoiceNode> changed, boolean propagate) {
//        System.out.println("setChosen for " + this.getClass().getSimpleName() + ": " + this);

        if (chosen != b) {
            if (changed != null) {
                changed.add(this);
            }
        }
        chosen = b;

        if (propagate) {
            if (isParent()) {
                // propagate down to children
                for (int index = getChildCount(); --index >= 0; ) {
                    TreeTableNode child = getChildAt(index);
                    if (child instanceof ChoiceNode) {
                        ((ChoiceNode) child).setChosen(b, changed, false);
                    }
                }
            }

            if (isChild()) {
                // propagate upwards to the parent
                TreeTableNode parent = getParent();
                if (parent instanceof ChoiceNode) {
                    ((ChoiceNode) parent).childChanged(this);
                }
            }
        }
    }
 
开发者ID:kddart,项目名称:kdxplore,代码行数:31,代码来源:ChoiceNode.java

示例5: visit

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
public void visit(Predicate<ChoiceNode> visitor) {
    if (visitor.test(this)) {
        for (int index = getChildCount(); --index >= 0; ) {
            TreeTableNode child = getChildAt(index);
            if (child instanceof ChoiceNode) {
                ((ChoiceNode) child).visit(visitor);
            }
        }
    }
}
 
开发者ID:kddart,项目名称:kdxplore,代码行数:11,代码来源:ChoiceNode.java

示例6: pluginsTreeTableMouseClicked

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
private void pluginsTreeTableMouseClicked(MouseEvent e) {
	if (e.getClickCount() == 2) {
		synchronized(this) {
			int selectedRow = this.pluginsTreeTable.getSelectedRow();
			if (selectedRow != -1) {
				TreePath path = this.pluginsTreeTable.getPathForRow(selectedRow);
				Object node = path.getLastPathComponent();
				if (node instanceof DependencyTreeTableNode) {
					Dependency dependency = ((DependencyTreeTableNode) node).getUserObject();
					Enumeration<? extends TreeTableNode> children = this.treeTableModel.getRoot().children();
					TreeTableNode child;
					Object value;
					while (children.hasMoreElements()) {
						child = children.nextElement();
						value = child.getUserObject();
						if (value instanceof Plugin) {
							if (((Plugin) value).getUID().equalsIgnoreCase(dependency.getResolveToPluginUID())) {
								TreePath treePath = new TreePath(new Object[]{this.treeTableModel.getRoot(), child});
								int index = this.pluginsTreeTable.getRowForPath(treePath);
								this.pluginsTreeTable.setRowSelectionInterval(index, index);
								break;
							}
						}
					}
				}
			}
		}
	}
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:30,代码来源:PluginInformationPane.java

示例7: pluginsTreeTableMouseClicked

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
private void pluginsTreeTableMouseClicked(MouseEvent e) {
	if (e.getClickCount() == 2) {
		synchronized(this) {
			int selectedRow = this.pluginsTreeTable.getSelectedRow();
			if (selectedRow != -1) {
				TreePath path = this.pluginsTreeTable.getPathForRow(selectedRow);
				Object node = path.getLastPathComponent();
				if (node instanceof DependencyTreeTableNode) {
					DependencyInfo dependency = ((DependencyTreeTableNode) node).getUserObject();
					Enumeration<? extends TreeTableNode> children = this.treeTableModel.getRoot().children();
					TreeTableNode child;
					Object value;
					while (children.hasMoreElements()) {
						child = children.nextElement();
						value = child.getUserObject();
						if (value instanceof PluginInfo) {
							if (((PluginInfo) value).getUID().equalsIgnoreCase(dependency.getUid())) {
								TreePath treePath = new TreePath(new Object[]{this.treeTableModel.getRoot(), child});
								int index = this.pluginsTreeTable.getRowForPath(treePath);
								this.pluginsTreeTable.setRowSelectionInterval(index, index);
								break;
							}
						}
					}
				}
			}
		}
	}
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:30,代码来源:RepositoryInformationPane.java

示例8: setValueAt

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
@Override
public void setValueAt(Object value, Object node, int column) {
	if ( node != null && node instanceof DBObjectTreeTableNode ) {
		DBObjectTreeTableNode userNode = (DBObjectTreeTableNode)node;
		TreeTableNode parent = userNode.getParent();
		while ( parent.getParent() != root ) {
			parent = parent.getParent();
		}
		userNode = (UserTreeTableNode)parent;
		String userId = (String)userNode.getKey();
		userNodeSet.put(userId, userNode);
	}
	super.setValueAt(value, node, column);
}
 
开发者ID:wangqi,项目名称:gameserver,代码行数:15,代码来源:GuildBagTreeTableModel.java

示例9: setValueAt

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
@Override
public void setValueAt(Object value, Object node, int column) {
	if ( node != null && node instanceof DBObjectTreeTableNode ) {
		DBObjectTreeTableNode userNode = (DBObjectTreeTableNode)node;
		TreeTableNode parent = userNode.getParent();
		while ( parent.getParent() != root ) {
			parent = parent.getParent();
		}
		userNode = (UserTreeTableNode)parent;
		UserId userId = (UserId)userNode.getKey();
		userNodeSet.put(userId, userNode);
	}
	super.setValueAt(value, node, column);
}
 
开发者ID:wangqi,项目名称:gameserver,代码行数:15,代码来源:UserTreeTableModel.java

示例10: FiledTreeTableModel

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
public FiledTreeTableModel(TreeTableNode node) {
    super(node);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:FiledTreeTableModel.java

示例11: children

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
@Override
public Enumeration<? extends TreeTableNode> children() {
    return Collections.enumeration(children);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:5,代码来源:BranchView.java

示例12: getChildAt

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
@Override
public TreeTableNode getChildAt(int childIndex) {
    return children.get(childIndex);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:5,代码来源:BranchView.java

示例13: BranchModel

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
public BranchModel(TreeTableNode root) {
    super(root);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:4,代码来源:BranchView.java

示例14: setRoot

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
@Override
public void setRoot(TreeTableNode root) {
    Node n = (Node) root;
    n.sort();
    super.setRoot(root);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:7,代码来源:BranchView.java

示例15: CustomTreeTableModel

import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
/**
 * @param root
 */
public CustomTreeTableModel(TreeTableNode root) {
    super(root);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:7,代码来源:JXTreeTableIssues.java


注:本文中的org.jdesktop.swingx.treetable.TreeTableNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。