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

The following examples show how to use org.jdesktop.swingx.treetable.TreeTableNode#getParent() . 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
Source File: TreeUtil.java    From ganttproject with GNU General Public License v3.0 5 votes vote down vote up
public static int getLevel(TreeTableNode treeNode) {
  int level = 0;
  while (treeNode != null) {
    treeNode = treeNode.getParent();
    level++;
  }
  return level - 1;
}
 
Example 2
Source File: GuildBagTreeTableModel.java    From gameserver with 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 3
Source File: GuildTreeTableModel.java    From gameserver with 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
Source File: AccountTreeTableModel.java    From gameserver with 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 5
Source File: UserTreeTableModel.java    From gameserver with 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
Source File: GuildMemberTreeTableModel.java    From gameserver with 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 7
Source File: TreeUtil.java    From ganttproject with GNU General Public License v3.0 4 votes vote down vote up
static TreeTableNode getPrevSibling(TreeTableNode node) {
  TreeTableNode parent = node.getParent();
  int idxPrev = getPrevSibling(parent, node);
  return idxPrev == -1 ? null : parent.getChildAt(idxPrev);
}
 
Example 8
Source File: TreeUtil.java    From ganttproject with GNU General Public License v3.0 4 votes vote down vote up
static TreeTableNode getNextSibling(TreeTableNode node) {
  TreeTableNode parent = node.getParent();
  int idxNext = getNextSibling(parent, node);
  return idxNext == -1 ? null : parent.getChildAt(idxNext);
}