本文整理汇总了Java中org.gephi.io.processor.plugin.DefaultProcessor类的典型用法代码示例。如果您正苦于以下问题:Java DefaultProcessor类的具体用法?Java DefaultProcessor怎么用?Java DefaultProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultProcessor类属于org.gephi.io.processor.plugin包,在下文中一共展示了DefaultProcessor类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import org.gephi.io.processor.plugin.DefaultProcessor; //导入依赖的package包/类
/**
* Will load a network file, based on the Gephi ImportController
*
* @param netFile
* @throws IOException
*/
public void load(File netFile) throws IOException {
Workspace workspace = Lookup.getDefault()
.lookup(ProjectController.class).getCurrentWorkspace();
ImportController importController = Lookup.getDefault().lookup(
ImportController.class);
// Import file
Container container;
container = importController.importFile(netFile);
container.getLoader().setEdgeDefault(EdgeDefault.DIRECTED);
// Append imported data to GraphAPI
importController.process(container, new DefaultProcessor(), workspace);
}
示例2: importFile
import org.gephi.io.processor.plugin.DefaultProcessor; //导入依赖的package包/类
private void importFile(String filename)
{
ImportController importController = Lookup.getDefault().lookup(ImportController.class);
Container container = null;
try{
System.out.println("Start reading gexf file");
File file = new File(filename);
System.out.println("Finishing reading gexf file");
container = importController.importFile(file);
container.getLoader().setEdgeDefault(EdgeDefault.UNDIRECTED);
container.setAllowAutoNode(false);
}
catch (Exception ex)
{
System.out.println("Error during reading the file:");
ex.printStackTrace();
}
importController.process(container, new DefaultProcessor(), workspace);
}
示例3: open
import org.gephi.io.processor.plugin.DefaultProcessor; //导入依赖的package包/类
private void open() {
ImportController importController = Lookup.getDefault().lookup(ImportController.class);
Container container;
try {
File file = new File(filePath);
container = importController.importFile(file.getAbsoluteFile());
container.getLoader().setEdgeDefault(EdgeDefault.DIRECTED);
} catch (Exception ex) {
ex.printStackTrace();
return;
}
importController.process(container, new DefaultProcessor(), workspace);
}
示例4: convert
import org.gephi.io.processor.plugin.DefaultProcessor; //导入依赖的package包/类
/**
*
* @param srcpath
* @throws IOException
*/
public void convert(String srcpath) throws IOException {
File graphmlFile = new File(srcpath);
// Init a project - and therefore a workspace
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
pc.newProject();
Workspace workspace = pc.getCurrentWorkspace();
// get import controller
ImportController importController = Lookup.getDefault().lookup(ImportController.class);
// Import file
Container container = importController.importFile(graphmlFile);
// Append imported data to GraphAPI
importController.process(container, new DefaultProcessor(), workspace);
graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
}