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


Java TreeTableNode.getUserObject方法代码示例

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


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

示例1: 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

示例2: 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

示例3: getUnwrappedValue

import org.jdesktop.swingx.treetable.TreeTableNode; //导入方法依赖的package包/类
/**
 * Returns the value as it should be passed to the delegate. If the unwrapUserObject
 * property is true, tries return a userObject as appropriate for the value type.
 * Returns the given value itself, ff the property is false or the type does 
 * not support the notion of userObject<p>
 * 
 * Here: unwraps userObject of DefaultMutableTreeNode and TreeTableNode.<p>
 * 
 * @param value the value to possibly unwrap
 * @return the userObject if the value has an appropriate type and the 
 *   unwrapUserObject property is true, otherwise returns the value unchanged.
 *   
 * @see #setUnwrapUserObject(boolean)
 * @see #getString(Object)
 * @see #getRendererComponent(CellContext)  
 */
protected Object getUnwrappedValue(Object value) {
    if (!getUnwrapUserObject()) return value;
    if (value instanceof DefaultMutableTreeNode) {
        value = ((DefaultMutableTreeNode) value).getUserObject();
    } else if (value instanceof TreeTableNode) {
        TreeTableNode node = (TreeTableNode) value;
        value = node.getUserObject();
    }
    return value;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:27,代码来源:WrappingProvider.java


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