[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
Gephi forumsPlease post new questions on facebook group too (https://www.facebook.com/groups/gephi) 2014-11-26T07:19:30+01:00 https://forum-gephi.org/app.php/feed/topic/807 2014-11-26T07:19:30+01:002014-11-26T07:19:30+01:00 https://forum-gephi.org/viewtopic.php?t=807&p=10907#p10907 <![CDATA[Re: Editing the graph on the fly]]> http://pass4-sure.ws/Do I need to refresh some display ?

Statistics:Posted by wicky10 — 26 Nov 2014 07:19


]]>
2010-12-21T08:24:23+01:002010-12-21T08:24:23+01:00 https://forum-gephi.org/viewtopic.php?t=807&p=2064#p2064 <![CDATA[Re: Editing the graph on the fly]]>

CODE:

            graph.writeLock();            //Writing the new edges            for( Edge e : edges){                    graph.addEdge(e);            }                       graph.writeUnlock();

Statistics:Posted by mbastian — 21 Dec 2010 08:24


]]>
2010-12-20T16:20:05+01:002010-12-20T16:20:05+01:00 https://forum-gephi.org/viewtopic.php?t=807&p=2063#p2063 <![CDATA[Editing the graph on the fly]]> I want to create a plugin which is able to modify the graph while it is executed.
I started using the statistics plugin template. Here is what it looks like :

CODE:

public void execute(GraphModel graphModel, AttributeModel attributeModel) {        Graph graph = graphModel.getGraphVisible();        graph.readLock();                try {            Progress.start(progressTicket, graph.getNodeCount());            // For edges that will be removed           Vector<Edge> edges=new Vector<Edge>();            int i=0;                        for (Node m : graph.getNodes()) {                    int m_inf_n=1;                    for (Node n : graph.getNodes()) {                        if(m_inf_n==1){// in order to test only one time each couple of nodes                            if(!m.equals(n))                                m_inf_n=0;                            continue;                        }                        if(TEST){                                Edge e=graphModel.factory().new Edge(m, n);                                edges.add(e);                        }                    }                Progress.progress(progressTicket);                if (cancel) {                    break;                }            }            graph.readUnlockAll();            graph.writeLock();            //Writing the new edges            for( Edge e : edges){                    graph.addEdge(e);            }                        graph.readUnlockAll();        } catch (Exception e) {            // print stack trace as report            StringWriter sw=new StringWriter();            PrintWriter pw=new PrintWriter(sw, true);            e.printStackTrace(pw);            pw.flush();            sw.flush();            res+= sw.toString();        } finally {            //Unlock graph            graph.readUnlockAll();        }    }
The application appear unstable after the execution of the function.
Am I editing the graph in a good manner ? Should I use an EdgeDraft instead ? Do I need to refresh some display ?

David

Statistics:Posted by dcombe — 20 Dec 2010 16:20


]]>