Package prefuse.data

Examples of prefuse.data.Graph$Listener


        // now get the appropriate source tuple
        // graphs maintain their own tuple managers so treat them specially
        String cgroup = PrefuseLib.getChildGroup(group);
        if ( cgroup != null ) {
            String pgroup = PrefuseLib.getParentGroup(group);
            Graph g = (Graph)getSourceData(pgroup);
            if ( t == g.getNodeTable() ) {
                return g.getNode(row);
            } else {
                return g.getEdge(row);
            }
        } else {
            return t.getTuple(row);
        }
    }
View Full Code Here


        TupleSet ts = getVisualGroup(group);
        VisualTable vt;
        if ( ts instanceof VisualTable ) {
            vt = (VisualTable)ts;
        } else if ( ts instanceof Graph ) {
            Graph g = (Graph)ts;
            vt = (VisualTable)(t instanceof Node ? g.getNodeTable()
                                                 : g.getEdgeTable());
        } else {
            return null;
        }
        int pr = t.getRow();
        int cr = vt.getChildRow(pr);
View Full Code Here

    public static JPanel demo() {
        return demo(DATA_FILE, "name");
    }
   
    public static JPanel demo(String datafile, final String label) {
        Graph g = null;
        try {
            g = new GraphMLReader().readGraph(datafile);
        } catch ( Exception e ) {
            e.printStackTrace();
            System.exit(1);
View Full Code Here

        }
        public void run(double frac) {
            TupleSet focus = m_vis.getGroup(Visualization.FOCUS_ITEMS);
            if ( focus==null || focus.getTupleCount() == 0 ) return;
           
            Graph g = (Graph)m_vis.getGroup(m_group);
            Node f = null;
            Iterator tuples = focus.tuples();
            while (tuples.hasNext() && !g.containsTuple(f=(Node)tuples.next()))
            {
                f = null;
            }
            if ( f == null ) return;
            g.getSpanningTree(f);
        }
View Full Code Here

    }
   
    private void initDataGroups() {
        // create sample graph
        // 9 nodes broken up into 3 interconnected cliques
        Graph g = new Graph();
        for ( int i=0; i<3; ++i ) {
            Node n1 = g.addNode();
            Node n2 = g.addNode();
            Node n3 = g.addNode();
            g.addEdge(n1, n2);
            g.addEdge(n1, n3);
            g.addEdge(n2, n3);
        }
        g.addEdge(0, 3);
        g.addEdge(3, 6);
        g.addEdge(6, 0);
       
        // add visual data groups
        VisualGraph vg = m_vis.addGraph(GRAPH, g);
        m_vis.setInteractive(EDGES, null, false);
        m_vis.setValue(NODES, null, VisualItem.SHAPE,
View Full Code Here

        this.frame = frame;
        this.config = config;
        this.colorManager = colorManager;
        this.monitor = monitor;
        this.orientation = orientation;
        g = new Graph(true);
        g.addColumn(VisualItem.LABEL, String.class);
        g.addColumn(Constants.USER_OBJECT, Object.class);
        g.addColumn(Constants.STATE, int.class);

        addControlListener(new GraphListener(g, frame));
View Full Code Here

        public void run(final double frac) {
            TupleSet focus = vis.getGroup(Visualization.FOCUS_ITEMS);
            if (focus == null || focus.getTupleCount() == 0)
                return;           
            Graph g = (Graph) vis.getGroup(m_group);
            Node f = null;
            Iterator tuples = focus.tuples();
            while (tuples.hasNext() &&
                   !g.containsTuple(f=(Node)tuples.next())) {
                f = null;
            }
            if (f == null) {
                return;
            }
            Object uo = f.get(Constants.USER_OBJECT);
            if(uo!=null && uo instanceof GraphNode) {
                GraphNode node = (GraphNode)uo;
                if(node.isServiceInstance())
                    return;
            }
            g.getSpanningTree(f);

        }
View Full Code Here

TOP

Related Classes of prefuse.data.Graph$Listener

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.