本文整理汇总了Java中edu.uci.ics.jung.graph.Graph.getOpposite方法的典型用法代码示例。如果您正苦于以下问题:Java Graph.getOpposite方法的具体用法?Java Graph.getOpposite怎么用?Java Graph.getOpposite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.uci.ics.jung.graph.Graph
的用法示例。
在下文中一共展示了Graph.getOpposite方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addSynsets
import edu.uci.ics.jung.graph.Graph; //导入方法依赖的package包/类
private void addSynsets(ViwnNode v) {
popup.setVisible(false);
Object[] syns = synset_list_.getSelectedValues();
if (syns.length > 0) {
vgvui.deselectAll();
}
ViwnNode other = v;
for (Object obj : syns) {
vgvui.addSynsetFromSet((ViwnNodeSynset) obj);
other = (ViwnNode) obj;
}
if (syns.length > 0) {
ViwnNode p2 = v;
Graph<ViwnNode, ViwnEdge> g = vgvui.getGraph();
ViwnNode parent = v.getSpawner();
boolean dissapear = true;
for (ViwnEdge edge : g.getIncidentEdges(parent)) {
ViwnNode opposite = g.getOpposite(parent, edge);
if (parent.equals(opposite.getSpawner())
&& (opposite.getSpawnDir() != null)) {
if (opposite == v) {
dissapear = false;
}
}
}
if (dissapear) {
if (other != null) {
p2 = other;
} else {
p2 = v.getSpawner();
}
}
vgvui.recreateLayoutWithFix(v, p2);
}
}
示例2: getNeighborsWithHigherCoreness
import edu.uci.ics.jung.graph.Graph; //导入方法依赖的package包/类
private List<V> getNeighborsWithHigherCoreness(Graph<V, E> g, V v) {
List<V> neighborsWithHigherCoreness = new ArrayList<V>();
for( E e : g.getIncidentEdges(v) ) {
V n = g.getOpposite(v, e);
if( coreness.get(n) >= coreness.get(v) ) {
neighborsWithHigherCoreness.add(n);
}
}
return neighborsWithHigherCoreness;
}
示例3: getNeighborsWithHigherCoreness
import edu.uci.ics.jung.graph.Graph; //导入方法依赖的package包/类
private List<V> getNeighborsWithHigherCoreness(Graph<V, E> g, V v) {
List<V> neighborsWithHigherCoreness = new ArrayList<V>();
for (E e : g.getIncidentEdges(v)) {
V n = g.getOpposite(v, e);
if (coreness.get(n) >= coreness.get(v)) {
neighborsWithHigherCoreness.add(n);
}
}
return neighborsWithHigherCoreness;
}
示例4: getNeighborsWithHigherCoreness
import edu.uci.ics.jung.graph.Graph; //导入方法依赖的package包/类
private List<V> getNeighborsWithHigherCoreness(Graph<V, E> g, V v) {
List<V> neighborsWithHigherCoreness = new ArrayList<V>();
for( E e : g.getIncidentEdges(v) ) {
V n = g.getOpposite(v, e);
if( coreness.get(n) > coreness.get(v) ) {
neighborsWithHigherCoreness.add(n);
}
}
return neighborsWithHigherCoreness;
}