edu.uci.ics.jung.algorithms.layout.Layout.getGraph()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中edu.uci.ics.jung.algorithms.layout.Layout.getGraph()方法的一些代码示例,展示了Layout.getGraph()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Layout.getGraph()方法的具体详情如下:
包路径:edu.uci.ics.jung.algorithms.layout.Layout
类名称:Layout
方法名:getGraph

Layout.getGraph介绍

[英]Returns the full graph (the one that was passed in at construction time) that this Layout refers to.
[中]返回此布局引用的完整图形(在构建时传入的图形)。

代码示例

代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2

/**
 * Returns the graph for which this layout is defined.
 * @return the graph for which this layout is defined
 * @see edu.uci.ics.jung.algorithms.layout.Layout#getGraph()
 */
public Graph<V, E> getGraph() {
  return delegate.getGraph();
}

代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2

/**
 * @see edu.uci.ics.jung.algorithms.layout.Layout#getGraph()
 */
public Graph<V, E> getGraph() {
  return delegate.getGraph();
}

代码示例来源:origin: net.sf.jung/jung-visualization

public Graph<V, E> getGraph() {
  return layout.getGraph();
}

代码示例来源:origin: net.sf.jung/jung-visualization

public BoundingRectangleCollector(RenderContext<V, E> rc, Layout<V, E> layout) {
  this.rc = rc;
  this.layout = layout;
  this.graph = layout.getGraph();
  compute();
}

代码示例来源:origin: com.github.fburato/highwheel-core

private void shift(final Layout<ElementName, Dependency> l, final int dx,
   final int dy) {
  for (final ElementName each : l.getGraph().getVertices()) {
   final Point2D point = l.transform(each);
   point.setLocation(point.getX() + dx, point.getY() + dy);
  }
 }
}

代码示例来源:origin: hcoles/highwheel

private void shift(final Layout<ElementName, Dependency> l, final int dx,
   final int dy) {
  for (final ElementName each : l.getGraph().getVertices()) {
   final Point2D point = l.transform(each);
   point.setLocation(point.getX() + dx, point.getY() + dy);
  }
 }
}

代码示例来源:origin: org.pitest/highwheel-core

private void shift(final Layout<ElementName, Dependency> l, final int dx,
   final int dy) {
  for (final ElementName each : l.getGraph().getVertices()) {
   final Point2D point = l.transform(each);
   point.setLocation(point.getX() + dx, point.getY() + dy);
  }
 }
}

代码示例来源:origin: net.sf.jung/jung-visualization

protected Collection<V> getFilteredVertices(Layout<V,E> layout) {
  if(verticesAreFiltered()) {
    Collection<V> unfiltered = layout.getGraph().getVertices();
    Collection<V> filtered = new LinkedHashSet<V>();
    for(V v : unfiltered) {
      if(isVertexRendered(Context.<Graph<V,E>,V>getInstance(layout.getGraph(),v))) {
        filtered.add(v);
      }
    }
    return filtered;
  } else {
    return layout.getGraph().getVertices();
  }
}

代码示例来源:origin: net.sf.jung/jung-algorithms

/**
 * Locks this vertex in the main layout and in any sublayouts whose graph contains
 * this vertex.
 * @param v the vertex whose locked state is to be set
 * @param state {@code true} if the vertex is to be locked, and {@code false} if unlocked
 */
public void lock(V v, boolean state) {
  for(Layout<V,E> layout : layouts.keySet()) {
    if(layout.getGraph().getVertices().contains(v)) {
      layout.lock(v, state);
    }
  }
  delegate.lock(v, state);
}

代码示例来源:origin: net.sf.jung/jung-visualization

public void paintVertex(RenderContext<V,E> rc, Layout<V,E> layout, V v) {
  Graph<V,E> graph = layout.getGraph();
  if (rc.getVertexIncludePredicate().apply(Context.<Graph<V,E>,V>getInstance(graph,v))) {
    paintIconForVertex(rc, v, layout);
  }
}

代码示例来源:origin: net.sf.jung/jung-visualization

/**
 * create an instance with a passed layout
 * create containers for graph components
 * @param layout the layout whose positions are to be persisted
 */
public PersistentLayoutImpl(Layout<V,E> layout) {
  super(layout);
this.locations = Maps.asMap(
  ImmutableSet.copyOf(layout.getGraph().getVertices()),
  new RandomPointFactory<V>(getSize()));
  this.dontmove = new HashSet<V>();
}

代码示例来源:origin: net.sf.jung/jung-samples

public void actionPerformed(ActionEvent e) {
  Collection picked = vv.getPickedVertexState().getPicked();
  if(picked.size() == 2) {
    Pair pair = new Pair(picked);
    Graph graph = layout.getGraph();
    Collection edges = new HashSet(graph.getIncidentEdges(pair.getFirst()));
    edges.retainAll(graph.getIncidentEdges(pair.getSecond()));
    exclusions.addAll(edges);
    vv.repaint();
  }
  
}});

代码示例来源:origin: net.sf.jung/jung-samples

public void actionPerformed(ActionEvent e) {
  Collection picked = vv.getPickedVertexState().getPicked();
  if(picked.size() == 2) {
    Pair pair = new Pair(picked);
    Graph graph = layout.getGraph();
    Collection edges = new HashSet(graph.getIncidentEdges(pair.getFirst()));
    edges.retainAll(graph.getIncidentEdges(pair.getSecond()));
    exclusions.removeAll(edges);
    vv.repaint();
  }
  
}});

代码示例来源:origin: net.sf.jung/jung-samples

public void actionPerformed(ActionEvent e) {
  Collection picked = vv.getPickedVertexState().getPicked();
  if(picked.size() == 2) {
    Pair pair = new Pair(picked);
    Graph graph = layout.getGraph();
    Collection edges = new HashSet(graph.getIncidentEdges(pair.getFirst()));
    edges.retainAll(graph.getIncidentEdges(pair.getSecond()));
    exclusions.removeAll(edges);
    vv.repaint();
  }
  
}});

代码示例来源:origin: net.sf.jung/jung-samples

public void actionPerformed(ActionEvent e) {
  Collection picked = vv.getPickedVertexState().getPicked();
  if(picked.size() == 2) {
    Pair pair = new Pair(picked);
    Graph graph = layout.getGraph();
    Collection edges = new HashSet(graph.getIncidentEdges(pair.getFirst()));
    edges.retainAll(graph.getIncidentEdges(pair.getSecond()));
    exclusions.addAll(edges);
    vv.repaint();
  }
  
}});

代码示例来源:origin: net.sf.jung/jung-visualization

public void endEdgeCreate(BasicVisualizationServer<V, E> vv, V endVertex) {
  if(startVertex != null) {
    Graph<V,E> graph = vv.getGraphLayout().getGraph();
    graph.addEdge(edgeFactory.get(), startVertex, endVertex, edgeType);
    vv.repaint();
  }
  startVertex = null;
  edgeType = EdgeType.UNDIRECTED;
  edgeEffects.endEdgeEffects(vv);
  edgeEffects.endArrowEffects(vv);
}

代码示例来源:origin: net.sf.jung/jung-visualization

public LayoutTransition(VisualizationViewer<V,E> vv, Layout<V, E> startLayout, Layout<V, E> endLayout) {
  this.vv = vv;
  this.startLayout = startLayout;
  this.endLayout = endLayout;
  if(endLayout instanceof IterativeContext) {
    Relaxer relaxer = new VisRunner((IterativeContext)endLayout);
    relaxer.prerelax();
  }
  this.transitionLayout =
    new StaticLayout<V,E>(startLayout.getGraph(), startLayout);
  vv.setGraphLayout(transitionLayout);
}

代码示例来源:origin: net.sf.jung/jung-visualization

public void startVertexCreate(BasicVisualizationServer<V, E> vv,
    Point2D point) {
  V newVertex = vertexFactory.get();
  Layout<V,E> layout = vv.getGraphLayout();
  Graph<V,E> graph = layout.getGraph();
  graph.addVertex(newVertex);
  layout.setLocation(newVertex, vv.getRenderContext().getMultiLayerTransformer().inverseTransform(point));
  vv.repaint();
}

代码示例来源:origin: net.sf.jung/jung-samples

public void actionPerformed(ActionEvent e) {
  Collection picked = new HashSet(vv.getPickedVertexState().getPicked());
  for(Object v : picked) {
    if(v instanceof Graph) {
      
      Graph g = collapser.expand(layout.getGraph(), (Graph)v);
      vv.getRenderContext().getParallelEdgeIndexFunction().reset();
      layout.setGraph(g);
    }
    vv.getPickedVertexState().clear();
    vv.repaint();
  }
}});

代码示例来源:origin: net.sf.jung/jung-samples

public void actionPerformed(ActionEvent e) {
  Collection picked = new HashSet(vv.getPickedVertexState().getPicked());
  for(Object v : picked) {
    if(v instanceof Graph) {
      
      Graph g = collapser.expand(layout.getGraph(), (Graph)v);
      vv.getRenderContext().getParallelEdgeIndexFunction().reset();
      layout.setGraph(g);
    }
    vv.getPickedVertexState().clear();
    vv.repaint();
  }
}});

相关文章