/** * Get the cached children, i.e. do not start any background processes for updating the children. */ @Override public List<ITreeNode> getCachedChildren() { assert SwingUtilities.isEventDispatchThread();// || Starter.isShutdown(); return super.getCachedChildren(); }
/** * Check if the node is a leaf. */ public boolean isLeaf() { return getChildCount() == 0; }
/** * Get the index of a child. */ @Override public int getIndexOfChild(ITreeNode child) { assert SwingUtilities.isEventDispatchThread();// || Starter.isShutdown(); return super.getIndexOfChild(child); }
/** * Remove a child and update the tree. */ public void removeChild(ITreeNode node) { int index = getIndexOfChild(node); if(index != -1) { // boolean removed = children.remove(node); // if(node.getId().toString().startsWith("ANDTest@")) // System.out.println("removed: "+node+", "+removed); model.deregisterNode(node); model.fireNodeRemoved(this, node, index); if (searching) dirty = true; } else { getModel().addZombieNode(node.getId()); } }
List<ITreeNode> newcs = newchildren != null ? new ArrayList<ITreeNode>(newchildren) : null; assert false || checkChildren(oldcs, newcs); searchChildren(); ((AbstractTreeNode)node).setParent(this); expandChildren(dorecurse, children);
int index = getCachedChildren().size(); if(!model.isZombieNode(node.getId())) ((AbstractTreeNode)node).setParent(this);
/** * Get the model. */ @Override public AsyncSwingTreeModel getModel() { return (AsyncSwingTreeModel) super.getModel(); }
/** * Add a child and update the tree. * Must be called from swing thread. */ @Override public void addChild(ITreeNode node) { assert SwingUtilities.isEventDispatchThread();// || Starter.isShutdown(); super.addChild(node); }
/** * Get the given child. */ @Override public ISwingTreeNode getChild(int index) { assert SwingUtilities.isEventDispatchThread();// || Starter.isShutdown(); return (ISwingTreeNode) super.getChild(index); }
/** * Get the current children, i.e. start a new update process and provide the result as a future. */ @Override public IFuture<List<ITreeNode>> getChildren() { assert SwingUtilities.isEventDispatchThread();// || Starter.isShutdown(); return super.getChildren(); }
/** * Test if two nodes are equal. */ public boolean equals(Object obj) { return obj instanceof ITreeNode && SUtil.equals(getId(), ((ITreeNode) obj).getId()); }
/** * Add a child and update the tree. * Must be called from swing thread. */ @Override public void addChild(int index, ITreeNode node) { assert SwingUtilities.isEventDispatchThread();// || Starter.isShutdown(); super.addChild(index, node); }
/** * Get the child count. */ public int getChildCount() { assert SwingUtilities.isEventDispatchThread();// || Starter.isShutdown(); return super.getChildCount(); }