Closed friggx closed 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(); }
Duplicate of https://github.com/gephi/gephi/issues/1430
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(); }