本文整理了Java中org.gephi.graph.api.Graph.readUnlockAll()
方法的一些代码示例,展示了Graph.readUnlockAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.readUnlockAll()
方法的具体详情如下:
包路径:org.gephi.graph.api.Graph
类名称:Graph
方法名:readUnlockAll
[英]Closes all read locks for the current thread.
[中]关闭当前线程的所有读取锁定。
代码示例来源:origin: org.gephi/layout-plugin
@Override
public void endAlgo() {
graph.readLock();
try {
for (Node n : graph.getNodes()) {
n.setLayoutData(null);
}
pool.shutdown();
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/layout-plugin
@Override
public void endAlgo() {
graph.readLock();
try {
for (Node n : graph.getNodes()) {
n.setLayoutData(null);
}
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/layout-plugin
@Override
public void endAlgo() {
graph.readLock();
try {
for (Node n : graph.getNodes()) {
n.setLayoutData(null);
}
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/layout-plugin
@Override
public void endAlgo() {
graph.readLock();
try {
for (Node n : graph.getNodes()) {
n.setLayoutData(null);
}
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/layout-plugin
@Override
public void endAlgo() {
graph.readLock();
try {
for (Node n : graph.getNodes()) {
n.setLayoutData(null);
}
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/layout-plugin
@Override
public void goAlgo() {
graph = graphModel.getGraphVisible();
graph.readLock();
try {
for (Node n : graph.getNodes()) {
n.setX((float) (-size / 2 + size * random.nextDouble()));
n.setY((float) (-size / 2 + size * random.nextDouble()));
}
converged = true;
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/algorithms-plugin
graph.readUnlockAll();
代码示例来源:origin: org.gephi/desktop-context
@Override
public void run() {
Graph graph = graphModel.getGraph();
boolean runListener = false;
graph.writeLock();
try {
runListener = initObserver();
} finally {
graph.writeUnlock();
graph.readUnlockAll();
}
if (!runListener) {
runListener = observer.hasGraphChanged();
}
if (runListener) {
graph.readLock();
try {
listener.run();
} 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 {
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/visualization
return false;
} finally {
currentGraphModel.getGraph().readUnlockAll();
代码示例来源:origin: org.gephi/layout-plugin
@Override
public void goAlgo() {
graph = graphModel.getGraphVisible();
graph.readLock();
try {
double sin = Math.sin(-getAngle() * Math.PI / 180);
double cos = Math.cos(-getAngle() * Math.PI / 180);
double px = 0f;
double py = 0f;
for (Node n : graph.getNodes()) {
double dx = n.x() - px;
double dy = n.y() - py;
n.setX((float) (px + dx * cos - dy * sin));
n.setY((float) (py + dy * cos + dx * sin));
}
setConverged(true);
} 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();
}
}
代码示例来源: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/appearance-api
protected void refreshFunctions() {
graph.readLock();
try {
boolean graphHasChanged = graphObserver.isNew() || graphObserver.hasGraphChanged();
if (graphHasChanged) {
if (graphObserver.isNew()) {
graphObserver.hasGraphChanged();
}
refreshGraphFunctions();
}
refreshAttributeFunctions(graphHasChanged);
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/layout-plugin
@Override
public void initAlgo() {
if (graphModel == null) {
return;
}
graph = graphModel.getGraphVisible();
graph.readLock();
try {
energy = Float.POSITIVE_INFINITY;
for (Node n : graph.getNodes()) {
n.setLayoutData(new ForceVector());
}
progress = 0;
setConverged(false);
setStep(initialStep);
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/layout-plugin
@Override
public void initAlgo() {
AbstractLayout.ensureSafeLayoutNodePositions(graphModel);
speed = 1.;
speedEfficiency = 1.;
graph = graphModel.getGraphVisible();
graph.readLock();
try {
Node[] nodes = graph.getNodes().toArray();
// Initialise layout data
for (Node n : nodes) {
if (n.getLayoutData() == null || !(n.getLayoutData() instanceof ForceAtlas2LayoutData)) {
ForceAtlas2LayoutData nLayout = new ForceAtlas2LayoutData();
n.setLayoutData(nLayout);
}
ForceAtlas2LayoutData nLayout = n.getLayoutData();
nLayout.mass = 1 + graph.getDegree(n);
nLayout.old_dx = 0;
nLayout.old_dy = 0;
nLayout.dx = 0;
nLayout.dy = 0;
}
pool = Executors.newFixedThreadPool(threadCount);
currentThreadCount = threadCount;
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/statistics-plugin
private double bruteForce(Graph graph) {
//The atrributes computed by the statistics
Column clusteringColumn = initializeAttributeColunms(graph.getModel());
float totalCC = 0;
graph.readLock();
try {
Progress.start(progress, graph.getNodeCount());
int node_count = 0;
NodeIterable nodesIterable = graph.getNodes();
for (Node node : nodesIterable) {
float nodeClusteringCoefficient = computeNodeClusteringCoefficient(graph, node, isDirected);
if (nodeClusteringCoefficient > -1) {
saveCalculatedValue(node, clusteringColumn, nodeClusteringCoefficient);
totalCC += nodeClusteringCoefficient;
}
if (isCanceled) {
nodesIterable.doBreak();
break;
}
node_count++;
Progress.progress(progress, node_count);
}
double clusteringCoeff = totalCC / graph.getNodeCount();
return clusteringCoeff;
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/layout-plugin
@Override
public void goAlgo() {
graph = graphModel.getGraphVisible();
graph.readLock();
try {
double xMean = 0, yMean = 0;
for (Node n : graph.getNodes()) {
xMean += n.x();
yMean += n.y();
}
xMean /= graph.getNodeCount();
yMean /= graph.getNodeCount();
for (Node n : graph.getNodes()) {
double dx = (n.x() - xMean) * getScale();
double dy = (n.y() - yMean) * getScale();
n.setX((float) (xMean + dx));
n.setY((float) (yMean + dy));
}
setConverged(true);
} finally {
graph.readUnlockAll();
}
}
代码示例来源:origin: org.gephi/statistics-plugin
graph.readUnlockAll();
内容来源于网络,如有侵权,请联系作者删除!