本文整理了Java中edu.uci.ics.jung.graph.Graph.removeVertex()
方法的一些代码示例,展示了Graph.removeVertex()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.removeVertex()
方法的具体详情如下:
包路径:edu.uci.ics.jung.graph.Graph
类名称:Graph
方法名:removeVertex
暂无
代码示例来源:origin: net.sf.jung/jung-api
/**
* @see edu.uci.ics.jung.graph.Hypergraph#removeVertex(java.lang.Object)
*/
public synchronized boolean removeVertex(V vertex) {
return delegate.removeVertex(vertex);
}
代码示例来源:origin: geogebra/geogebra
/**
* @see edu.uci.ics.jung.graph.Hypergraph#removeVertex(java.lang.Object)
*/
@Override
public synchronized boolean removeVertex(V vertex) {
return delegate.removeVertex(vertex);
}
代码示例来源:origin: geogebra/geogebra
/**
* @see edu.uci.ics.jung.graph.Hypergraph#removeVertex(java.lang.Object)
*/
@Override
public boolean removeVertex(V vertex) {
return delegate.removeVertex(vertex);
}
代码示例来源:origin: net.sf.jung/jung-api
/**
* @see edu.uci.ics.jung.graph.Hypergraph#removeVertex(java.lang.Object)
*/
public boolean removeVertex(V vertex) {
return delegate.removeVertex(vertex);
}
代码示例来源:origin: net.sf.jung/jung-visualization
public boolean removeVertex(V vertex) {
return graph.removeVertex(vertex);
}
}
代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer
/**
* Removes a vertex.
* @param vertex The vertex.
* @return <code>true</code> if success.
*/
public boolean removeVertex(Object vertex)
{
internal_removeVertex(vertex);
return delegate.removeVertex(vertex);
}
代码示例来源:origin: dstl/baleen
/**
* Remove an outer layer of the graph (i.e. any nodes with an inDegree of 0)
*
* <p>Returns the set of removed vertices
*/
public static <V, E> Set<V> removeLayer(Graph<V, E> graph) {
Set<V> toRemove = new HashSet<>();
for (V v : graph.getVertices()) {
if (graph.inDegree(v) == 0) {
toRemove.add(v);
}
}
for (V v : toRemove) graph.removeVertex(v);
return toRemove;
}
代码示例来源:origin: uk.gov.dstl.baleen/baleen-orderers
/**
* Remove an outer layer of the graph (i.e. any nodes with an inDegree of 0)
*
* <p>Returns the set of removed vertices
*/
public static <V, E> Set<V> removeLayer(Graph<V, E> graph) {
Set<V> toRemove = new HashSet<>();
for (V v : graph.getVertices()) {
if (graph.inDegree(v) == 0) {
toRemove.add(v);
}
}
for (V v : toRemove) graph.removeVertex(v);
return toRemove;
}
代码示例来源:origin: net.sf.jung/jung-visualization
public void actionPerformed(ActionEvent e) {
pickedVertexState.pick(vertex, false);
graph.removeVertex(vertex);
vv.repaint();
}});
} else if(edge != null) {
代码示例来源:origin: geogebra/geogebra
/**
* remove the passed node, and all nodes that are descendants of the passed
* node.
*
* @param vertex
* @return <code>true</code> iff the tree was modified
* @see edu.uci.ics.jung.graph.Graph#removeVertex(java.lang.Object)
*/
@Override
public boolean removeVertex(V vertex) {
if (!delegate.containsVertex(vertex)) {
return false;
}
for (V v : getChildren(vertex)) {
removeVertex(v);
vertex_depths.remove(v);
}
// recalculate height
vertex_depths.remove(vertex);
return delegate.removeVertex(vertex);
}
代码示例来源:origin: net.sf.jung/jung-graph-impl
/**
* remove the passed node, and all nodes that are descendants of the
* passed node.
* @param vertex the vertex to remove
* @return <code>true</code> iff the tree was modified
* @see edu.uci.ics.jung.graph.Graph#removeVertex(java.lang.Object)
*/
@Override
public boolean removeVertex(V vertex) {
if (!delegate.containsVertex(vertex))
return false;
for(V v : getChildren(vertex)) {
removeVertex(v);
vertex_depths.remove(v);
}
// recalculate height
vertex_depths.remove(vertex);
return delegate.removeVertex(vertex);
}
代码示例来源:origin: SINTEF-9012/cloudml
public ArrayList<Vertex> drawFromDeploymentModel() {
Collection<Edge> c = new ArrayList<Edge>(graph.getEdges());
for (Edge e : c) {
graph.removeEdge(e);
}
Collection<Vertex> vs = new ArrayList<Vertex>(graph.getVertices());
for (Vertex ve : vs) {
graph.removeVertex(ve);
}
ArrayList<Vertex> v = drawVerticesFromDeploymentModel(dmodel);
drawEdgesFromDeploymentModel(dmodel, v);
System.out.println(vv);
return v;
}
代码示例来源:origin: net.sf.jung/jung-graph-impl
/**
* Removes <code>vertex</code> from this tree.
* If <code>remove_subtrees</code> is <code>true</code>, removes
* the subtrees rooted at the children of <code>vertex</code>.
* Otherwise, leaves these subtrees intact as new component trees of this
* forest.
* @param vertex the vertex to remove
* @param remove_subtrees if <code>true</code>, remove the subtrees
* rooted at <code>vertex</code>'s children
* @return <code>true</code> iff the tree was modified
*/
public boolean removeVertex(V vertex, boolean remove_subtrees)
{
if (!delegate.containsVertex(vertex))
return false;
if (remove_subtrees)
for(V v : new ArrayList<V>(delegate.getSuccessors(vertex)))
removeVertex(v, true);
return delegate.removeVertex(vertex);
}
代码示例来源:origin: geogebra/geogebra
/**
* Removes <code>vertex</code> from this tree. If
* <code>remove_subtrees</code> is <code>true</code>, removes the subtrees
* rooted at the children of <code>vertex</code>. Otherwise, leaves these
* subtrees intact as new component trees of this forest.
*
* @param vertex
* the vertex to remove
* @param remove_subtrees
* if <code>true</code>, remove the subtrees rooted at
* <code>vertex</code>'s children
* @return <code>true</code> iff the tree was modified
*/
public boolean removeVertex(V vertex, boolean remove_subtrees) {
if (!delegate.containsVertex(vertex)) {
return false;
}
if (remove_subtrees) {
for (V v : new ArrayList<V>(delegate.getSuccessors(vertex))) {
removeVertex(v, true);
}
}
return delegate.removeVertex(vertex);
}
代码示例来源:origin: org.cloudml/ui.graph
public void drawFromDeploymentModel(){
Collection<Edge> c = new ArrayList<Edge>(graph.getEdges());
for(Edge e : c)
graph.removeEdge(e);
Collection<Vertex> vs =new ArrayList<Vertex>(graph.getVertices());
for(Vertex ve : vs)
graph.removeVertex(ve);
ArrayList<Vertex> v = drawVerticesFromDeploymentModel(dmodel);
drawEdgesFromDeploymentModel(dmodel, v);
nodeTypes.removeAll();
nodeTypes.setModel(fillList());
}
代码示例来源:origin: net.sf.jung/jung-api
/**
* @see edu.uci.ics.jung.graph.Hypergraph#removeVertex(java.lang.Object)
*/
@Override
public boolean removeVertex(V vertex) {
// remove all incident edges first, so that the appropriate events will
// be fired (otherwise they'll be removed inside {@code delegate.removeVertex}
// and the events will not be fired)
Collection<E> incident_edges = new ArrayList<E>(delegate.getIncidentEdges(vertex));
for (E e : incident_edges)
this.removeEdge(e);
boolean state = delegate.removeVertex(vertex);
if(state) {
GraphEvent<V,E> evt = new GraphEvent.Vertex<V,E>(delegate, GraphEvent.Type.VERTEX_REMOVED, vertex);
fireGraphEvent(evt);
}
return state;
}
代码示例来源:origin: net.sf.jung/jung-samples
/**
* @return the graph for this demo
*/
Graph<String,Number> getGraph() {
Graph<String,Number> g =
new EppsteinPowerLawGenerator<String,Number>(
new GraphFactory(), new VertexFactory(), new EdgeFactory(), 26, 50, 50).get();
Set<String> removeMe = new HashSet<String>();
for (String v : g.getVertices()) {
if ( g.degree(v) == 0 ) {
removeMe.add( v );
}
}
for(String v : removeMe) {
g.removeVertex(v);
}
return g;
}
代码示例来源:origin: org.opendaylight.faas/fabric-mgr-impl
tree.removeVertex(id);
代码示例来源:origin: girtel/Net2Plan
@Override
public void rebuildGraph()
{
for (GUILink gl : new ArrayList<>(g.getEdges()))
g.removeEdge(gl);
for (GUINode gn : new ArrayList<>(g.getVertices()))
g.removeVertex(gn);
for (GUINode gn : callback.getVisualizationState().getCanvasAllGUINodes()) g.addVertex(gn);
for (GUILink gl : callback.getVisualizationState().getCanvasAllGUILinks(true, true))
g.addEdge(gl, gl.getOriginNode(), gl.getDestinationNode());
updateAllVerticesXYPosition();
refresh();
}
代码示例来源:origin: org.opendaylight.controller/routing.dijkstra_implementation
&& (topo.outDegree(src.getNode()) == 0)) {
log.debug("Removing vertex {}", src);
topo.removeVertex(src.getNode());
&& (topo.outDegree(dst.getNode()) == 0)) {
log.debug("Removing vertex {}", dst);
topo.removeVertex(dst.getNode());
内容来源于网络,如有侵权,请联系作者删除!