本文整理汇总了Java中org.gephi.project.api.ProjectController类的典型用法代码示例。如果您正苦于以下问题:Java ProjectController类的具体用法?Java ProjectController怎么用?Java ProjectController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProjectController类属于org.gephi.project.api包,在下文中一共展示了ProjectController类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import org.gephi.project.api.ProjectController; //导入依赖的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: main
import org.gephi.project.api.ProjectController; //导入依赖的package包/类
public static void main(String[] args) throws FileNotFoundException {
Lookup.getDefault().lookup(ProjectController.class).newProject();
CxfNetwork network = new CxfNetwork();
network.load(new File(
"/home/ilias/workspace/sg/resources/networks/linear.cxf"));
NetworkStatistics netStats = new NetworkStatistics();
netStats.execute();
System.out.println("~~~ Network Statistics Report ~~~");
System.out.println(netStats.getReport());
System.out.println("~~~~~~~~~ End of Report ~~~~~~~~");
netStats.getReportUI().setVisible(true);
}
示例3: HistoryFrame
import org.gephi.project.api.ProjectController; //导入依赖的package包/类
/**
* Constructor creates new form HistoryFrame
*/
public HistoryFrame() {
super();
initComponents();
this.setVisible(true);
// setup
pc = Lookup.getDefault().lookup(ProjectController.class);
fileSeparator = System.getProperty("file.separator");
// init the project
initProject();
// load history from previous savings
loadHistory();
// set closing operation
this.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent windowEvent) {
saveHistory();
windowEvent.getWindow().dispose();
}
});
}
示例4: initProject
import org.gephi.project.api.ProjectController; //导入依赖的package包/类
/**
* Initialize a Gephi Toolkit project.
*/
private static void initProject() {
ProjectController pc = Lookup.getDefault().lookup(
ProjectController.class);
pc.newProject();
pc.getCurrentWorkspace();
}
示例5: exit
import org.gephi.project.api.ProjectController; //导入依赖的package包/类
private static void exit(int code, String msg) {
if (msg != null && !msg.isEmpty()) {
out(msg);
}
ProjectController pc = Lookup.getDefault().lookup(
ProjectController.class);
pc.closeCurrentWorkspace();
pc.closeCurrentProject();
out("Exit!");
System.exit(code);
}
示例6: bootstrapGephi
import org.gephi.project.api.ProjectController; //导入依赖的package包/类
private GraphModel bootstrapGephi() {
// boostrap gephi
Lookup lookup = Lookup.getDefault();
ProjectController pc = lookup.lookup(ProjectController.class);
pc.newProject();
@SuppressWarnings("unused")
Workspace workspace = pc.getCurrentWorkspace();
GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
return graphModel;
}
示例7: initializing
import org.gephi.project.api.ProjectController; //导入依赖的package包/类
public static void initializing() {
if (!initialized) {
pc = Lookup.getDefault().lookup(ProjectController.class);
pc.newProject();
workspace = pc.getCurrentWorkspace();
graph_model = Lookup.getDefault().lookup(GraphController.class).getModel(workspace);
the_graph = graph_model.getUndirectedGraph();
}
the_graph.clear();
// System.gc();
}
示例8: GephiProcessing
import org.gephi.project.api.ProjectController; //导入依赖的package包/类
public GephiProcessing(final String filePath, final double reportingIntervalCount) {
betweennessAverages = new ArrayList<>();
closenessAverages = new ArrayList<>();
eccentricityAverages = new ArrayList<>();
clusteringCoefficientAverages = new ArrayList<>();
topicDiameterAverages = new ArrayList<>();
degreeAverages = new ArrayList<>();
inDegreeAverages = new ArrayList<>();
outDegreeAverages = new ArrayList<>();
controlMsgsSentAvg = new ArrayList<>();
controlMsgsRcvdAvg = new ArrayList<>();
controlKbSentAvg = new ArrayList<>();
controlKbRcvdAvg = new ArrayList<>();
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
pc.newProject();
workspace = pc.getCurrentWorkspace();
this.filePath = filePath;
open();
graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
this.reportingIntervalCount = reportingIntervalCount;
}
示例9: GephiController
import org.gephi.project.api.ProjectController; //导入依赖的package包/类
public GephiController(DataController dc) {
ProjectController projectController = Lookup.getDefault().lookup(ProjectController.class);
workspace = projectController.getCurrentWorkspace();
projectController.newProject();
this.dataController = dc;
ipMap = dc.getMongoController().getIpToNodeMap();
GraphMouseListener gml = Lookup.getDefault().lookup(GraphMouseListener.class);
gml.setGephiController(this);
// By now the JPanel on which to draw on is not known, so we cannot set up the RenderTarget.
// This is done in setGraphPanel(...)
}
示例10: LouvainClustering
import org.gephi.project.api.ProjectController; //导入依赖的package包/类
public LouvainClustering() {
this.pc = Lookup.getDefault().lookup(ProjectController.class);
pc.newProject();
this.workspace = pc.getCurrentWorkspace();
this.graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
this.factory = graphModel.factory();
this.partitionController = Lookup.getDefault().lookup(PartitionController.class);
}
示例11: convert
import org.gephi.project.api.ProjectController; //导入依赖的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();
}
示例12: GexfToVectorImage
import org.gephi.project.api.ProjectController; //导入依赖的package包/类
public GexfToVectorImage() {
pc = Lookup.getDefault().lookup(ProjectController.class);
pc.newProject();
workspace = pc.getCurrentWorkspace();
}
示例13: load
import org.gephi.project.api.ProjectController; //导入依赖的package包/类
public void load(QueryWindowData newDataset) {
if (newDataset == null)
return;
currentQueryWindow = newDataset;
if (skip) {
skip = false;
return;
}
if (this.selectedNodes == null || this.currentQueryWindow == null) {
logger.info("Not all data yet, not displaying graph");
return;
}
GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
if (graphModel != null) {
if (!keep)
graphModel.getGraph().clear();
else
graphModel.getGraph().clearEdges();
ProjectController projectController = Lookup.getDefault().lookup(ProjectController.class);
projectController.cleanWorkspace(workspace);
// Gephi doesn't terminate these Threads. Since many of these threads lead to OutOfMemory Errors,
// kill all left-over threads manually.
terminateThreads("DHNS View Destructor");
}
// import to container
Container container = Lookup.getDefault().lookup(ContainerFactory.class).newContainer();
GephiImporter gImporter = new GephiImporter(currentQueryWindow, ipMap, this.selectedNodes);
ContainerLoader loader = container.getLoader();
gImporter.execute(loader);
// process data from container into internal graph structure
ImportController importController = Lookup.getDefault().lookup(ImportController.class);
importController.process(container, new CustomProcessor(), workspace);
// update view
setChanged();
notifyObservers();
}