本文整理了Java中org.gephi.graph.api.Graph.writeUnlock()
方法的一些代码示例,展示了Graph.writeUnlock()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.writeUnlock()
方法的具体详情如下:
包路径:org.gephi.graph.api.Graph
类名称:Graph
方法名:writeUnlock
[英]Closes a write lock for the current thread.
[中]关闭当前线程的写锁。
代码示例来源:origin: gephi/gephi-plugins-bootcamp
@Override
public void actionPerformed(ActionEvent e) {
//Get the current graph model
GraphController gc = Lookup.getDefault().lookup(GraphController.class);
GraphModel graphModel = gc.getGraphModel();
if (graphModel != null) {
//Remove self loops
int removed = 0;
Graph graph = graphModel.getGraph();
graph.writeLock();
for (Edge edge : graph.getEdges().toArray()) {
if (edge.isSelfLoop()) {
graph.removeEdge(edge);
removed++;
}
}
graph.writeUnlock();
//Notification message
NotifyDescriptor d = new NotifyDescriptor.Message(removed + " self-loop have been removed", NotifyDescriptor.INFORMATION_MESSAGE);
DialogDisplayer.getDefault().notify(d);
} else {
//Error message
NotifyDescriptor d = new NotifyDescriptor.Message("No active workspace", NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(d);
}
}
}
代码示例来源: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-api
graph.writeUnlock();
graph.readUnlockAll();
代码示例来源:origin: org.gephi/visualization
graph.writeUnlock();
graph.readUnlockAll();
代码示例来源:origin: org.gephi/visualization
force = true;
} finally {
graphModel.getGraph().writeUnlock();
graphModel.getGraph().readUnlockAll();
内容来源于网络,如有侵权,请联系作者删除!