当前位置: 首页>>代码示例>>Java>>正文


Java GraphModel类代码示例

本文整理汇总了Java中org.gephi.graph.api.GraphModel的典型用法代码示例。如果您正苦于以下问题:Java GraphModel类的具体用法?Java GraphModel怎么用?Java GraphModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GraphModel类属于org.gephi.graph.api包,在下文中一共展示了GraphModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bResetColorsActionPerformed

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
/**
 * Click on button "Reset Colors"
 * @param evt ActionEvent
 */
private void bResetColorsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bResetColorsActionPerformed
    GraphModel model = Lookup.getDefault().lookup(GraphController.class).getModel();
    
    // color all nodes black
    Node[] nodes = model.getUndirectedGraph().getNodes().toArray();
    for(Node n : nodes) {
        n.getNodeData().setColor(0, 0, 0);
    }
    
    // color all edges black
    Edge[] edges = model.getUndirectedGraph().getEdges().toArray();
    for(Edge e : edges) {
        e.getEdgeData().setColor(0, 0, 0);
    }
}
 
开发者ID:KSD-research-group,项目名称:plugin4gephi,代码行数:20,代码来源:ArchitecturalGraphMLTopComponent.java

示例2: layoutGraph

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
public void layoutGraph() {

		GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
		ForceAtlas2 layout = new ForceAtlas2(null);
		//		YifanHuLayout layout = new YifanHuLayout(null, new StepDisplacement(1f));
		layout.setGraphModel(graphModel);
		layout.initAlgo();
		layout.resetPropertiesValues();
		//		layout.setOptimalDistance(200f);
		layout.setEdgeWeightInfluence(0.1);
		layout.setScalingRatio(50.0);
		layout.setLinLogMode(false);
		int maxSteps = 100;

		for (int i = 0; i < maxSteps && layout.canAlgo(); i++) {
			layout.goAlgo();
		}
		layout.endAlgo();

	}
 
开发者ID:nullbox,项目名称:Data-and-Information-Visualization-Project,代码行数:21,代码来源:GraphJPanel.java

示例3: setGraph

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
private void setGraph() {
    GraphModel graphModel = workspace.getLookup().lookup(GraphModel.class);
    if (exportVisible) {
        graph = graphModel.getGraphVisible();
    } else {
        graph = graphModel.getGraph();
    }
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:9,代码来源:CxfExport.java

示例4: setGraphModel

import org.gephi.graph.api.GraphModel; //导入依赖的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();
}
 
开发者ID:nolanlab,项目名称:vortex,代码行数:12,代码来源:ForceAtlas2.java

示例5: bootstrapGephi

import org.gephi.graph.api.GraphModel; //导入依赖的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;
}
 
开发者ID:ServiceCutter,项目名称:ServiceCutter,代码行数:11,代码来源:GephiSolver.java

示例6: getAverageClusteringCoefficient

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
/**
 * Indicates to which degree nodes in the network tend to cluster together
 */
public  static double getAverageClusteringCoefficient(GraphModel graphModel, AttributeModel attributeModel) {
    ClusteringCoefficient clusteringCoefficient = new ClusteringCoefficient();
    clusteringCoefficient.execute(graphModel, attributeModel);

    double sum = 0;
    for (Node node : graphModel.getGraph().getNodes()) {
        sum += (double)node.getAttributes().getValue(ClusteringCoefficient.CLUSTERING_COEFF);
    }
    return sum / graphModel.getGraph().getNodeCount();
}
 
开发者ID:vizpub,项目名称:vizpub,代码行数:14,代码来源:GephiMetrics.java

示例7: getAverageGraphDistance

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
private static double getAverageGraphDistance(GraphModel graphModel, AttributeModel attributeModel, String distanceType) {
    GraphDistance graphDistance = new GraphDistance();
    graphDistance.setDirected(true);
    graphDistance.setNormalized(true);
    graphDistance.execute(graphModel, attributeModel);

    double sum = 0;
    for (Node node : graphModel.getGraph().getNodes()) {
        sum += (double)node.getAttributes().getValue(distanceType);
    }
    return sum / graphModel.getGraph().getNodeCount();
}
 
开发者ID:vizpub,项目名称:vizpub,代码行数:13,代码来源:GephiMetrics.java

示例8: getAverageDegree

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
private static double getAverageDegree(GraphModel graphModel, AttributeModel attributeModel, String degreeType) {
    Degree degree = new Degree();
    degree.execute(graphModel, attributeModel);
    int sum = 0;
    for (Node node : graphModel.getGraph().getNodes()) {
        sum += (int)node.getAttributes().getValue(degreeType);
    }
    return sum / graphModel.getGraph().getNodeCount();
}
 
开发者ID:vizpub,项目名称:vizpub,代码行数:10,代码来源:GephiMetrics.java

示例9: filterGraph

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
private void filterGraph() {
	FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
	GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();

	SelectionFilter degreeFilter = new SelectionFilter(controller.getSelectedNodes());
	Query query = filterController.createQuery(degreeFilter);

	GraphView view = filterController.filter(query);
	graphModel.setVisibleView(view);

}
 
开发者ID:nullbox,项目名称:Data-and-Information-Visualization-Project,代码行数:12,代码来源:GraphJPanel.java

示例10: setGraphModel

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
@Override
public void setGraphModel(GraphModel graphModel) {
	this.graphModel = graphModel;
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:5,代码来源:FixedLayout.java

示例11: setGraphModel

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
@Override
public void setGraphModel(GraphModel graphModel) {
    this.graphModel = graphModel;
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:5,代码来源:ARFLayout.java

示例12: setGraphModel

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
@Override
public void setGraphModel(GraphModel gm) {
    this.graphModel = gm;
}
 
开发者ID:nolanlab,项目名称:vortex,代码行数:5,代码来源:TreeLayout.java

示例13: setGraphModel

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
@Override
public void setGraphModel(GraphModel graphModel) {
    this.graphModel = graphModel;
    // Trick: reset here to take the profile of the graph in account for default values
    resetPropertiesValues();
}
 
开发者ID:WouterSpekkink,项目名称:EventGraphLayout_0.8.2,代码行数:7,代码来源:TimeForce.java

示例14: getAverageInDegree

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
public static double getAverageInDegree(GraphModel graphModel, AttributeModel attributeModel) {
    return getAverageDegree(graphModel, attributeModel, Degree.INDEGREE);
}
 
开发者ID:vizpub,项目名称:vizpub,代码行数:4,代码来源:GephiMetrics.java

示例15: getAverageOutDegree

import org.gephi.graph.api.GraphModel; //导入依赖的package包/类
public static double getAverageOutDegree(GraphModel graphModel, AttributeModel attributeModel) {
    return getAverageDegree(graphModel, attributeModel, Degree.OUTDEGREE);
}
 
开发者ID:vizpub,项目名称:vizpub,代码行数:4,代码来源:GephiMetrics.java


注:本文中的org.gephi.graph.api.GraphModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。