本文整理了Java中org.gephi.graph.api.Graph.getModel()
方法的一些代码示例,展示了Graph.getModel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.getModel()
方法的具体详情如下:
包路径:org.gephi.graph.api.Graph
类名称:Graph
方法名:getModel
[英]Returns the model this graph belongs to.
[中]返回此图所属的模型。
代码示例来源:origin: org.gephi/appearance-api
public EdgeTypePartitionImpl(Graph graph) {
super();
this.graph = graph;
this.model = graph.getModel();
}
代码示例来源:origin: org.gephi/datalab-plugin
private void refreshAvailableEdgeTypes() {
for (Object edgeType : graph.getModel().getEdgeTypeLabels()) {
edgeTypeComboBox.addItem(edgeType);
}
}
代码示例来源:origin: org.gephi/appearance-api
@Override
public Table getTable() {
return graph.getModel().getNodeTable();
}
代码示例来源:origin: org.gephi/appearance-api
@Override
public Table getTable() {
return graph.getModel().getEdgeTable();
}
代码示例来源:origin: org.gephi/appearance-api
protected ElementFunctionsModel(Graph graph) {
this.graph = graph;
simpleFunctions = new HashMap<>();
graphFunctions = new HashMap<>();
attributeFunctions = new HashMap<>();
columnObservers = new HashMap<>();
graphObserver = graph.getModel().createGraphObserver(graph, false);
partitions = new HashMap<>();
rankings = new HashMap<>();
// Init simple
initSimpleFunctions();
}
代码示例来源:origin: org.gephi/appearance-api
@Override
public Index<Node> getIndex(boolean localScale) {
return localScale ? graph.getModel().getNodeIndex(graph.getView()) : graph.getModel().getNodeIndex();
}
代码示例来源:origin: org.gephi/desktop-appearance
public GraphChangeObserver(Graph graph, Column column) {
timer = new Timer("GraphChangeObserver", true);
graphObserver = graph.getModel().createGraphObserver(graph, false);
columnObserver = column != null ? column.createColumnObserver(false) : null;
}
代码示例来源:origin: org.gephi/filters-plugin
@Override
public boolean init(Graph graph) {
partition = appearanceModel.getNodePartition(graph.getModel().getGraph(), column);
return partition != null;
}
代码示例来源:origin: org.gephi/filters-plugin
@Override
public boolean init(Graph graph) {
partition = appearanceModel.getEdgePartition(graph.getModel().getGraph(), column);
return partition != null;
}
}
代码示例来源:origin: org.gephi/filters-plugin
@Override
public boolean init(Graph graph) {
partition = appearanceModel.getNodePartition(graph.getModel().getGraph(), column);
return partition != null;
}
代码示例来源:origin: org.gephi/filters-plugin
@Override
public boolean init(Graph graph) {
partition = appearanceModel.getNodePartition(graph.getModel().getGraph(), column);
return partition != null;
}
}
代码示例来源:origin: org.gephi/filters-plugin
@Override
public boolean init(Graph graph) {
partition = appearanceModel.getEdgePartition(graph.getModel().getGraph(), column);
return partition != null;
}
}
代码示例来源:origin: org.gephi/filters-plugin
@Override
public boolean init(Graph graph) {
partition = appearanceModel.getNodePartition(graph.getModel().getGraph(), column);
return partition != null;
}
}
代码示例来源:origin: org.gephi/datalab-api
private Node buildNode(Graph graph, String label, String id) {
Node newNode;
if (id != null) {
newNode = graph.getModel().factory().newNode(id);
} else {
newNode = graph.getModel().factory().newNode();
}
newNode.setSize(DEFAULT_NODE_SIZE);
newNode.setLabel(label);
//Set random position to the node:
newNode.setX((float) ((0.01 + Math.random()) * 1000) - 500);
newNode.setY((float) ((0.01 + Math.random()) * 1000) - 500);
return newNode;
}
代码示例来源:origin: org.gephi/filters-plugin
@Override
public boolean init(Graph graph) {
ConnectedComponents cc = new ConnectedComponents();
UndirectedGraph undirectedGraph = graph.getModel().getUndirectedGraph(graph.getView());
cc.weaklyConnected(undirectedGraph);
componentId = cc.getGiantComponent();
column = graph.getModel().getNodeTable().getColumn(ConnectedComponents.WEAKLY);
return column != null && componentId != -1;
}
代码示例来源:origin: org.gephi/statistics-plugin
private void saveValues(int[] struct, Graph graph, CommunityStructure theStructure) {
Table nodeTable = graph.getModel().getNodeTable();
Column modCol = nodeTable.getColumn(MODULARITY_CLASS);
if (modCol == null) {
modCol = nodeTable.addColumn(MODULARITY_CLASS, "Modularity Class", Integer.class, 0);
}
for (Node n : graph.getNodes()) {
int n_index = theStructure.map.get(n);
n.setAttribute(modCol, struct[n_index]);
}
}
代码示例来源:origin: org.gephi/statistics-plugin
public void execute(Graph graph) {
isDirected = graph.isDirected();
isCanceled = false;
initializeDegreeDists();
initializeAttributeColunms(graph.getModel());
graph.readLock();
try {
avgWDegree = calculateAverageWeightedDegree(graph, isDirected, true);
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/statistics-plugin
public void execute(Graph graph) {
isCanceled = false;
Column column = initializeAttributeColunms(graph.getModel());
graph.readLock();
try {
HashMap<Node, Integer> indicies = createIndiciesMap(graph);
pageranks = calculatePagerank(graph, indicies, isDirected, useEdgeWeight, epsilon, probability);
saveCalculatedValues(graph, column, indicies, pageranks);
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/statistics-plugin
public void execute(Graph graph) {
isDirected = graph.isDirected();
isCanceled = false;
initializeDegreeDists();
initializeAttributeColunms(graph.getModel());
graph.readLock();
try {
avgDegree = calculateAverageDegree(graph, isDirected, true);
graph.setAttribute(AVERAGE_DEGREE, avgDegree);
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/statistics-plugin
public void execute(Graph graph) {
initializeAttributeColunms(graph.getModel());
graph.readLock();
try {
int N = graph.getNodeCount();
authority = new double[N];
hubs = new double[N];
Map<Node, Integer> indices = createIndicesMap(graph);
calculateHits(graph, hubs, authority, indices, !useUndirected, epsilon);
saveCalculatedValues(indices, authority, hubs);
} finally {
graph.readUnlockAll();
}
}
内容来源于网络,如有侵权,请联系作者删除!