Package prefuse.data

Examples of prefuse.data.Node


     * numberOfNodes)
     */
    Table nodeTable = g.getNodeTable();
    for (IntIterator ii = nodeTable.rows(); ii.hasNext();) {
      int nodeID = ii.nextInt();
      Node node = g.getNode(nodeID);
     
      int numEdges = g.getInDegree(node) + g.getOutDegree(node);
     
      Integer currentFrequency =
        (Integer) nodeDegreeFrequencies.get(new Integer(numEdges));
View Full Code Here


     * numberOfNodes)
     */
    Table nodeTable = g.getNodeTable();
    for (IntIterator ii = nodeTable.rows(); ii.hasNext();) {
      int nodeID = ii.nextInt();
      Node node = g.getNode(nodeID);
     
      int numEdges = g.getInDegree(node) + g.getOutDegree(node);
     
      Integer currentFrequency =
        (Integer) nodeDegreeFrequencies.get(new Integer(numEdges));
View Full Code Here

        this.graph = initializeGraph();
        this.nodes = new HashMap();
    }

    public void addDependency(final Dependency dependency) {
        Node componentNode = addNode(dependency.getComponentType());
        Node dependencyNode = addNode(dependency.getDependencyType());
        if (dependencyNode != null) {
            graph.addEdge(componentNode, dependencyNode);
        }
    }
View Full Code Here

        return (Node[]) nodes.values().toArray(new Node[nodes.size()]);
    }

    private Node addNode(final Class type) {
        if (type != null && !nodes.containsKey(type)) {
            Node node = graph.addNode();
            node.set("type", type);
            nodes.put(type, node);
        }
        return (Node) nodes.get(type);
    }
View Full Code Here

   {
       //==== Iterate through all the nodes in this graph
       Iterator items = this.getRadialGraph().getDataGraph().nodes();
       while(items.hasNext())
       {
           Node node = (Node)items.next();
           //=== If it is a focus node, check its citation list for new papers
           if(node.getString("refType").equals("FOCUS"))
           {
               String bibcode = node.getString("bibcode");
               int focusKey = node.getInt("DEFAULT_NODE_KEY");
               SecondaryResults newNodes = executeSecondaryQuery(bibcode, "cit", focusKey, this.getRadialGraph().getDataGraph().getNodeTable());
               //=== Take the new nodes, and their associated edges, and add them into the graph
               for(int i=0; i<newNodes.getGraph().getNodeCount(); i++)
               {
                   int key = newNodes.getGraph().getNodeTable().getInt(i, "DEFAULT_NODE_KEY");
                   Node addMe = newNodes.getGraph().getNodeFromKey(key);
                   this.getRadialGraph().getDataGraph().getNodes().addTuple(addMe);
                   Iterator edgeIt = newNodes.getGraph().edges();
                   while(edgeIt.hasNext())
                   {
                       Edge edge = (Edge)edgeIt.next();
                       if(edge.getInt("source") == addMe.getInt("DEFAULT_NODE_KEY"))
                       {
                           this.getRadialGraph().getDataGraph().addEdge(edge.getInt("source"), edge.getInt("target"));
                       }
                   }
               }
View Full Code Here

            int citLimit = Integer.parseInt(input);
            Iterator nodeIt = currentGraph.nodes();
            while (nodeIt.hasNext())
            {
                //=== Get the node
                Node node = (Node)nodeIt.next();           
           
                //=== If the node has a high enough citCount, add a red border
                if(Integer.parseInt(node.getString("citCount"))>citLimit)
                {
                    v.getFocusGroup("citHighlight").addTuple(v.getVisualItem(treeNodes, node));
                }
            }
        }
View Full Code Here

    {
        //==== Iterate through all the nodes, hiding those that have visibility set to "false"
        Iterator nodeIt = currentGraph.nodes();
        while(nodeIt.hasNext())
        {
            Node node = (Node)nodeIt.next();
            if(node.getString("visible").equals("false"))
            {
                m_vis.getVisualItem(treeNodes, node).setVisible(false);
                //==== Hide all the hidden node's edges too
                Iterator edgeIt = node.edges();
                while(edgeIt.hasNext())
                {
                    m_vis.getVisualItem(treeEdges, (Edge)edgeIt.next()).setVisible(false);
                }
                   
View Full Code Here

    public void saveGraphLayout()
    {
        Iterator nodes = m_vis.items(treeNodes);
        while (nodes.hasNext())
        {
            Node node = (Node)nodes.next();
            VisualItem item = m_vis.getVisualItem(treeNodes, node);
            double x = item.getX();
            double y = item.getY();
            node.setDouble("xCoordinate", x);
            node.setDouble("yCoordinate", y);           
        }
    }
View Full Code Here

    public void loadGraphLayout()
    {
        Iterator nodes = m_vis.items(treeNodes);
        while (nodes.hasNext())
        {
            Node node = (Node)nodes.next();
            VisualItem item = m_vis.getVisualItem(treeNodes, node);
            double x = node.getDouble("xCoordinate");
            double y = node.getDouble("yCoordinate");
            item.setX(x);
            item.setY(y);           
        }
        m_vis.repaint();
    }
View Full Code Here

    public void hideLowCitations(int count)
    {
        Iterator nodeIt = m_vis.items(treeNodes);
        while(nodeIt.hasNext())
        {
            Node node = (Node)nodeIt.next();
            //=== If the citation count for a paper is lower than the limit
            if((Integer.parseInt(node.getString("citCount"))<count) && !node.getString("refType").equals("FOCUS"))
            {
                //== Hide the node's VisualItem, save its status as hidden
                m_vis.getVisualItem(treeNodes, node).setVisible(false);
                m_vis.getSourceTuple(m_vis.getVisualItem(treeNodes, node)).setString("visible", "false");
                //== Hide all edges to the node
                Iterator edgeIt = node.edges();
                while(edgeIt.hasNext())
                {
                    m_vis.getVisualItem(treeEdges, (Edge)edgeIt.next()).setVisible(false);
                }
            } //end if
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.