Package prefuse.data

Examples of prefuse.data.Node


    private void buildUsesNode( Node parent, Iterable<LayerDetailDescriptor> iter )
    {
        for( LayerDetailDescriptor descriptor : iter )
        {
            Node source = findNode( parent, descriptor );

            for( LayerDetailDescriptor usesDescriptor : descriptor.usedLayers() )
            {
                Node target = findNode( parent, usesDescriptor );
                if( target == null )
                {
                    continue;
                }
                Edge edge = graph.addEdge( source, target );
View Full Code Here


        }
    }

    private Node findNode( Node parent, Object userObject )
    {
        Node node = null;

        for( int i = 0; i < parent.getChildCount(); i++ )
        {
            Node tNode = parent.getChild( i );
            Object obj = tNode.get( GraphDisplay.USER_OBJECT );
            if( obj.equals( userObject ) )
            {
                node = tNode;
                break;
            }
View Full Code Here

        return node;
    }

    private Node addChild( Node parent, String name, Object object )
    {
        Node childNode = graph.addNode();
        childNode.set( GraphDisplay.NAME_LABEL, name );
        childNode.set( GraphDisplay.USER_OBJECT, object );

        // check for application node
        if( parent != null )
        {
            graph.addEdge( parent, childNode );
View Full Code Here

    private void buildLayersNode( Node parent, Iterable<LayerDetailDescriptor> iter )
    {
        for( LayerDetailDescriptor descriptor : iter )
        {
            Node childNode = addChild( parent, descriptor.descriptor().name(), descriptor );
            buildModulesNode( childNode, descriptor.modules() );
        }
    }
View Full Code Here

    private void buildModulesNode( Node parent, Iterable<ModuleDetailDescriptor> iter )
    {
        for( ModuleDetailDescriptor descriptor : iter )
        {
            Node childNode = addChild( parent, descriptor.descriptor().name(), descriptor );

            buildServicesNode( childNode, descriptor.services() );
            buildImportedServicesNode( childNode, descriptor.importedServices() );
            buildEntitiesNode( childNode, descriptor.entities() );
            buildTransientsNode( childNode, descriptor.composites() );
View Full Code Here

        // compute offset due to children's angular width
        double dt = 0;
        Iterator iter = sortedChildren(r);
        while ( iter.hasNext() ) {
            Node n = (Node)iter.next();
            if ( n == p ) break;
            dt += ((Params)n.get(PARAMS)).width;
        }
        double rw = ((Params)r.get(PARAMS)).width;
        double pw = ((Params)p.get(PARAMS)).width;
        dt = -MathLib.TWO_PI * (dt+pw/2)/rw;

 
View Full Code Here

    public static int[] analyzeGraphGrid(TupleSet ts) {
        // TODO: more robust grid analysis?
        int m, n;
        Iterator iter = ts.tuples(); iter.next();
        for ( n=2; iter.hasNext(); n++ ) {
            Node nd = (Node)iter.next();
            if ( nd.getDegree() == 2 )
                break;
        }
        m = ts.getTupleCount() / n;
        return new int[] {m,n};
    }
View Full Code Here

        /**
         * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
         */
        public Object getChild(Object node, int idx) {
            Node c = ((Node)node).getChild(idx);
            if ( c == null ) {
                throw new IllegalArgumentException("Index out of range: "+idx);
            }
            return c;
        }
View Full Code Here

            else if ( type == EventConstants.UPDATE && !nodeTable )
                return;
           
            for ( int row = start; row <= end; ++row ) {
                // create the event
                Node n = null;
                if ( nodeTable )
                    n = g.getNode(row);
                else
                    n = g.getEdge(row).getTargetNode();
                Object[] path = new Object[n.getDepth()+1];
                for ( int i=path.length; --i>=0; n=n.getParent() ) {
                    path[i] = n;
                }
                TreeModelEvent e = new TreeModelEvent(this, path);
               
                // fire it
View Full Code Here

    public static Graph getNodes(int n) {
        Graph g = new Graph();
        g.getNodeTable().addColumns(LABEL_SCHEMA);
       
        for ( int i=0; i < n; i++ ) {
            Node node = g.addNode();
            node.setString(LABEL, String.valueOf(i));
        }
        return g;
    }
View Full Code Here

TOP

Related Classes of prefuse.data.Node

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.