本文整理汇总了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();
}
示例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();
}
示例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);
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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;
}
}
}
}
}
}
}
}
示例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;
}
}
}
}
}
}
}
}
示例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);
}
示例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);
}
示例10: FiledTreeTableModel
import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
public FiledTreeTableModel(TreeTableNode node) {
super(node);
}
示例11: children
import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
@Override
public Enumeration<? extends TreeTableNode> children() {
return Collections.enumeration(children);
}
示例12: getChildAt
import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
@Override
public TreeTableNode getChildAt(int childIndex) {
return children.get(childIndex);
}
示例13: BranchModel
import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
public BranchModel(TreeTableNode root) {
super(root);
}
示例14: setRoot
import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
@Override
public void setRoot(TreeTableNode root) {
Node n = (Node) root;
n.sort();
super.setRoot(root);
}
示例15: CustomTreeTableModel
import org.jdesktop.swingx.treetable.TreeTableNode; //导入依赖的package包/类
/**
* @param root
*/
public CustomTreeTableModel(TreeTableNode root) {
super(root);
}