本文整理汇总了Java中org.gephi.project.api.Workspace类的典型用法代码示例。如果您正苦于以下问题:Java Workspace类的具体用法?Java Workspace怎么用?Java Workspace使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Workspace类属于org.gephi.project.api包,在下文中一共展示了Workspace类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import org.gephi.project.api.Workspace; //导入依赖的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: GephiProcessing
import org.gephi.project.api.Workspace; //导入依赖的package包/类
public GephiProcessing(Workspace workspace, GraphModel graphModel, 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<>();
this.workspace = workspace;
this.graphModel = graphModel;
this.reportingIntervalCount = reportingIntervalCount;
filePath = null;
}
示例3: mouseReleased
import org.gephi.project.api.Workspace; //导入依赖的package包/类
@Override
public void mouseReleased(PreviewMouseEvent event, PreviewProperties properties, Workspace workspace) {
if (!isReactiveFor(event))
return;
if (startX != endX || startY != endY) {
logger.info("Dragged from (" + startX + "," + startY + ") to (" + endX + "," + endY + ")");
Lookup.getDefault().lookup(MouseRenderer.class).endDragging();
gc.selectNodesFromCoords(startX, startY, endX, endY);
} else {
gc.showNodeInfo(startX, startY);
}
}
示例4: setGraphModel
import org.gephi.project.api.Workspace; //导入依赖的package包/类
@Override
public void setGraphModel(GraphModel graphModel) {
this.graphModel = graphModel;
Workspace workspace = graphModel.getWorkspace();
DynamicController dynamicController = Lookup.getDefault().lookup(DynamicController.class);
if (dynamicController != null && workspace != null) {
dynamicModel = dynamicController.getModel(workspace);
}
// Trick: reset here to take the profile of the graph in account for default values
resetPropertiesValues();
}
示例5: bootstrapGephi
import org.gephi.project.api.Workspace; //导入依赖的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;
}
示例6: mouseDragged
import org.gephi.project.api.Workspace; //导入依赖的package包/类
@Override
public void mouseDragged(PreviewMouseEvent event, PreviewProperties properties, Workspace workspace) {
if (!isReactiveFor(event))
return;
if (startX == endX && startY == endY) {
Lookup.getDefault().lookup(MouseRenderer.class).startDragging(startX, startY);
}
endX = event.x;
endY = event.y;
Lookup.getDefault().lookup(MouseRenderer.class).dragStep(endX, endY);
event.setConsumed(true);
}
示例7: mousePressed
import org.gephi.project.api.Workspace; //导入依赖的package包/类
@Override
public void mousePressed(PreviewMouseEvent event, PreviewProperties properties, Workspace workspace) {
if (!isReactiveFor(event))
return;
startX = endX = event.x;
startY = endY = event.y;
event.setConsumed(true);
}
示例8: setWorkspace
import org.gephi.project.api.Workspace; //导入依赖的package包/类
@Override
public void setWorkspace(Workspace workspace) {
this.workspace = workspace;
}
示例9: getWorkspace
import org.gephi.project.api.Workspace; //导入依赖的package包/类
@Override
public Workspace getWorkspace() {
return workspace;
}
示例10: setWorkspace
import org.gephi.project.api.Workspace; //导入依赖的package包/类
@Override
public void setWorkspace(Workspace workspace) {
this.workspace = workspace;
}
示例11: getWorkspace
import org.gephi.project.api.Workspace; //导入依赖的package包/类
@Override
public Workspace getWorkspace() {
return workspace;
}
示例12: mouseClicked
import org.gephi.project.api.Workspace; //导入依赖的package包/类
@Override
public void mouseClicked(PreviewMouseEvent event, PreviewProperties properties, Workspace workspace) {
return;
}
示例13: mouseDragged
import org.gephi.project.api.Workspace; //导入依赖的package包/类
@Override
public void mouseDragged(PreviewMouseEvent event,
PreviewProperties properties, Workspace workspace) {
}
示例14: mouseReleased
import org.gephi.project.api.Workspace; //导入依赖的package包/类
@Override
public void mouseReleased(PreviewMouseEvent event,
PreviewProperties properties, Workspace workspace) {
}
示例15: convert
import org.gephi.project.api.Workspace; //导入依赖的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();
}