Exception when duplicating workspace through GraphModel.pushFrom()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gephi |
Won't Fix
|
Undecided
|
Mathieu Bastian | ||
Toolkit |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Way to reproduce with the toolkit:
1. Follow http://
2. Add the following code to copy a subgraph into a new workspace:
Graph currentGraphView = dynamicGraph.
final Workspace newWorkspace = pc.newWorkspace
GraphModel gm = Lookup.
gm.pushFrom(
An exception is raised:
java.lang.
at org.gephi.
at org.gephi.
at org.gephi.
at org.gephi.
at org.cnrs.
at org.cnrs.
With the debugger, I found that it occurs with the parameters:
index=2
value=TimeInterval
So basically:
NodeDataImpl.
Changed in gephi: | |
milestone: | none → 0.7beta |
tags: | added: workspace |
Changed in gephi: | |
assignee: | nobody → Mathieu Bastian (mathieu.bastian) |
Another code to reproduce the bug, assuming that the CSV file contains an edge list:
//Init a project - and therefore a workspace getDefault( ).lookup( ProjectControll er.class) ; rkspace( );
ProjectController pc = Lookup.
pc.newProject();
Workspace workspace = pc.getCurrentWo
//Get controllers and models getDefault( ).lookup( ImportControlle r.class) ;
ImportController importController = Lookup.
//Import file r.importFile( file); getLoader( ).setEdgeDefaul t(EdgeDefault. DIRECTED) ; //Force DIRECTED setAllowAutoNod e(false) ; //Don't create missing nodes printStackTrace ();
Container container;
try {
File file = new File("1.csv");
container = importControlle
container.
container.
} catch (Exception ex) {
ex.
return;
}
//Initialize the DynamicProcessor - which will append the container to the workspace r.setDateMode( false); //Set 'true' if you set real dates (ex: yyyy-mm-dd), it's double otherwise r.setLabelmatch ing(false) ; //Set 'true' if node matching is done on labels instead of ids
DynamicProcessor dynamicProcessor = new DynamicProcessor();
dynamicProcesso
dynamicProcesso
//Set date for this file r.setDate( "1");
dynamicProcesso
//Process the container using the DynamicProcessor r.process( container, dynamicProcessor, workspace);
importControlle
GraphModel gm = Lookup. getDefault( ).lookup( GraphController .class) .getModel( workspace) ;
final Workspace newWorkspace = pc.newWorkspace (pc.getCurrentP roject( )); getDefault( ).lookup( GraphController .class) .getModel( newWorkspace) ; gm.getGraph( ));
GraphModel newGm = Lookup.
newGm.pushFrom(