Package org.gephi.graph.dhns.node.iterators

Examples of org.gephi.graph.dhns.node.iterators.ChildrenIterator


            absNode.setEnabled(false);
            view.decNodesEnabled(1);
            edgeProcessor.clearMetaEdges(absNode);

            //Enable children
            for (ChildrenIterator itr = new ChildrenIterator(treeStructure, absNode, Tautology.instance); itr.hasNext();) {
                AbstractNode child = itr.next();
                child.setEnabled(true);
                view.incNodesEnabled(1);
                edgeProcessor.computeMetaEdges(child, child);
            }

            //Update counting
            for (ChildrenIterator itr = new ChildrenIterator(treeStructure, absNode, Tautology.instance); itr.hasNext();) {
                AbstractNode child = itr.next();
                edgeProcessor.incrementEdgesCounting(child, absNode);
            }

            edgeProcessor.decrementEdgesCouting(absNode, null);
        }
View Full Code Here


            edgeProcessor.decrementEdgesCouting(absNode, null);
        }

        private void retract(AbstractNode parent) {
            //Disable children
            for (ChildrenIterator itr = new ChildrenIterator(treeStructure, parent, Tautology.instance); itr.hasNext();) {
                AbstractNode child = itr.next();
                child.setEnabled(false);
                view.decNodesEnabled(1);
                edgeProcessor.clearMetaEdges(child);
            }

            //Enable node
            parent.setEnabled(true);
            view.incNodesEnabled(1);
            edgeProcessor.computeMetaEdges(parent, parent);

            //Edges counting
            for (ChildrenIterator itr = new ChildrenIterator(treeStructure, parent, Tautology.instance); itr.hasNext();) {
                AbstractNode child = itr.next();
                edgeProcessor.decrementEdgesCouting(child, parent);
            }
            edgeProcessor.incrementEdgesCounting(parent, null);
        }
View Full Code Here

        }

        private AbstractNode[] ungroup(AbstractNode nodeGroup) {
            //TODO Better implementation. Just remove nodeGroup from the treelist and lower level of children
            int count = 0;
            for (ChildrenIterator itr = new ChildrenIterator(treeStructure, nodeGroup, Tautology.instance); itr.hasNext();) {
                itr.next();
                count++;
            }

            AbstractNode[] ungroupedNodes = new AbstractNode[count];
View Full Code Here

    }

    public int getChildrenCount(Node node) {
        AbstractNode absNode = checkNode(node);
        int count = 0;
        ChildrenIterator itr = new ChildrenIterator(structure, absNode, Tautology.instance);
        for (; itr.hasNext();) {
            itr.next();
            count++;
        }
        return count;
    }
View Full Code Here

    }

    public NodeIterable getChildren(Node node) {
        readLock();
        AbstractNode absNode = checkNode(node);
        return dhns.newNodeIterable(new ChildrenIterator(structure, absNode, Tautology.instance));
    }
View Full Code Here

        return dhns.newNodeIterable(new DescendantIterator(structure, absNode, Tautology.instance));
    }

    public NodeIterable getTopNodes() {
        readLock();
        return dhns.newNodeIterable(new ChildrenIterator(structure, Tautology.instance));
    }
View Full Code Here

TOP

Related Classes of org.gephi.graph.dhns.node.iterators.ChildrenIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.