org.jdesktop.swingx.treetable.TreeTableNode Java Examples

The following examples show how to use org.jdesktop.swingx.treetable.TreeTableNode. 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: 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 #2
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 #3
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 #4
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 #5
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 #6
Source File: GanttTree2.java    From ganttproject with GNU General Public License v3.0 5 votes vote down vote up
/** Refresh the expansion (recursive function) */
public void expandRefresh(TreeTableNode moved) {
  if (moved instanceof TaskNode) {
    Task movedTask = (Task) moved.getUserObject();
    if (movedTask.getExpand()) {
      getTreeTable().getTree().expandPath(TreeUtil.createPath(moved));
    }
    for (int i = 0; i < moved.getChildCount(); i++) {
      expandRefresh(moved.getChildAt(i));
    }
  }
}
 
Example #7
Source File: ResourceTreeTable.java    From ganttproject with GNU General Public License v3.0 5 votes vote down vote up
@Override
public String getToolTipText(MouseEvent event) {
  int column = columnAtPoint(event.getPoint());
  if (column >= 0 && isHierarchical(column)) {
    TreePath pathAtPoint = getTreeTable().getPathForLocation(event.getX(), event.getY());
    TreeTableNode nodeAtPoint = pathAtPoint == null ? null : (TreeTableNode) pathAtPoint.getLastPathComponent();
    if (nodeAtPoint instanceof AssignmentNode) {
      Task task = ((AssignmentNode)nodeAtPoint).getTask();
      return "<html><body>" + buildPath(task) + "</body></html>";
    }
  }
  return super.getToolTipText(event);
}
 
Example #8
Source File: TreeTableContainer.java    From ganttproject with GNU General Public License v3.0 5 votes vote down vote up
private void collapseAll(TreePath root) {
  TreeTableNode node = (TreeTableNode) root.getLastPathComponent();
  for (int i = 0; i < node.getChildCount(); i++) {
    collapseAll(root.pathByAddingChild(node.getChildAt(i)));
  }
  getTree().collapsePath(root);
}
 
Example #9
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 #10
Source File: TreeTableContainer.java    From ganttproject with GNU General Public License v3.0 5 votes vote down vote up
private void expandAll(TreePath root) {
  getTree().expandPath(root);
  TreeTableNode node = (TreeTableNode) root.getLastPathComponent();
  for (int i = 0; i < node.getChildCount(); i++) {
    expandAll(root.pathByAddingChild(node.getChildAt(i)));
  }
}
 
Example #11
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);
}
 
Example #12
Source File: FiledTreeTableModel.java    From GsonFormat with Apache License 2.0 4 votes vote down vote up
public FiledTreeTableModel(TreeTableNode node) {
    super(node);
}
 
Example #13
Source File: FileSystemPanel.java    From aion-germany with GNU General Public License v3.0 4 votes vote down vote up
public SimpleTreeModel(TreeTableNode root)
{
    super(root);
}
 
Example #14
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 #15
Source File: BranchView.java    From ramus with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void setRoot(TreeTableNode root) {
    Node n = (Node) root;
    n.sort();
    super.setRoot(root);
}
 
Example #16
Source File: BranchView.java    From ramus with GNU General Public License v3.0 4 votes vote down vote up
public BranchModel(TreeTableNode root) {
    super(root);
}
 
Example #17
Source File: BranchView.java    From ramus with GNU General Public License v3.0 4 votes vote down vote up
@Override
public TreeTableNode getChildAt(int childIndex) {
    return children.get(childIndex);
}
 
Example #18
Source File: BranchView.java    From ramus with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Enumeration<? extends TreeTableNode> children() {
    return Collections.enumeration(children);
}
 
Example #19
Source File: PacketViewTableModel.java    From aion-germany with GNU General Public License v3.0 4 votes vote down vote up
public PacketViewTableModel(TreeTableNode root)
{
    super(root);
}