gephi / gephi-plugins

Repository for Gephi Plugins maintained by the team. Each plugin has it's branch.
270 stars 623 forks source link

How imoprt file in gephi 9.1? #95

Closed friggx closed 8 years ago

friggx commented 8 years ago

I would like to write a plugin which just imported graphml the specified path, but on the 48 line - importController.process (container, proc, workspace); I get an error NullPointerException code ->

public class firstImporter { ProjectController pc; Workspace workspace; ImportController importController; Container container; ContainerLoader lController; Processor proc; Importer jhon; GraphModel graphModel; DirectedGraph graph; Project startproj; String pathPskov;

public firstImporter(String path) { path = "C:\Users\Friggx\NEW\Graph\smol.graphml"; pc = Lookup.getDefault().lookup(ProjectController.class); workspace = pc.getCurrentWorkspace(); importController = Lookup.getDefault().lookup(ImportController.class); try { File file = new File(path); container = importController.importFile(file); System.out.println(container.toString()); container.getLoader().setEdgeDefault(EdgeDirectionDefault.UNDIRECTED); } catch (Exception ex) { ex.printStackTrace(); return; } importController.process(container, proc, workspace); graphModel = Lookup.getDefault().lookup(GraphController.class).getGraphModel(); graph = graphModel.getDirectedGraph(); }

eduramiba commented 8 years ago

Duplicate of https://github.com/gephi/gephi/issues/1430