Java Code Examples for org.jdesktop.swingx.treetable.TreeTableNode#getParent()

The following examples show how to use org.jdesktop.swingx.treetable.TreeTableNode#getParent() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public static int getLevel(TreeTableNode treeNode) {
  int level = 0;
  while (treeNode != null) {
    treeNode = treeNode.getParent();
    level++;
  }
  return level - 1;
}
 
Example 2
@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);
}
 
Example 3
Source Project: gameserver   File: GuildTreeTableModel.java    License: Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example 4
@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);
}
 
Example 5
Source Project: gameserver   File: UserTreeTableModel.java    License: Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example 6
@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);
}
 
Example 7
static TreeTableNode getPrevSibling(TreeTableNode node) {
  TreeTableNode parent = node.getParent();
  int idxPrev = getPrevSibling(parent, node);
  return idxPrev == -1 ? null : parent.getChildAt(idxPrev);
}
 
Example 8
static TreeTableNode getNextSibling(TreeTableNode node) {
  TreeTableNode parent = node.getParent();
  int idxNext = getNextSibling(parent, node);
  return idxNext == -1 ? null : parent.getChildAt(idxNext);
}