/** * 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(); }
/** * @see edu.uci.ics.jung.algorithms.layout.Layout#getGraph() */ public Graph<V, E> getGraph() { return delegate.getGraph(); }
public Graph<V, E> getGraph() { return layout.getGraph(); }
public BoundingRectangleCollector(RenderContext<V, E> rc, Layout<V, E> layout) { this.rc = rc; this.layout = layout; this.graph = layout.getGraph(); compute(); }
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); } } }
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); } } }
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); } } }
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(); } }
/** * 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); }
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); } }
/** * 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>(); }
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(); } }});
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(); } }});
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(); } }});
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(); } }});
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); }
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); }
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(); }
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(); } }});
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(); } }});