/** * @param v * @param location * @see edu.uci.ics.jung.algorithms.layout.Layout#setLocation(java.lang.Object, java.awt.geom.Point2D) */ public void setLocation(V v, Point2D location) { delegate.setLocation(v, location); }
@Override public void moveVertexToXYPosition(GUINode npNode, Point2D point) { l.setLocation(npNode, point); }
public void setLocation(V v, Point2D location) { layout.setLocation(v, location); }
public void setLocation(V v, Point2D location) { delegate.setLocation(v, location); }
public void setLocation(V v, Point2D location) { boolean wasInSublayout = false; for(Layout<V,E> layout : layouts.keySet()) { if(layout.getGraph().getVertices().contains(v)) { Point2D center = layouts.get(layout); // transform by the layout itself, but offset to the // center of the sublayout Dimension d = layout.getSize(); AffineTransform at = AffineTransform.getTranslateInstance(-center.getX()+d.width/2,-center.getY()+d.height/2); Point2D localLocation = at.transform(location, null); layout.setLocation(v, localLocation); wasInSublayout = true; } } if(wasInSublayout == false && getGraph().getVertices().contains(v)) { delegate.setLocation(v, location); } }
/** * @param v * @param location * @see edu.uci.ics.jung.algorithms.layout.Layout#setLocation(java.lang.Object, java.awt.geom.Point2D) */ public void setLocation(V v, Point2D location) { boolean wasInSublayout = false; for(Layout<V,E> layout : layouts.keySet()) { if(layout.getGraph().getVertices().contains(v)) { Point2D center = layouts.get(layout); // transform by the layout itself, but offset to the // center of the sublayout Dimension d = layout.getSize(); AffineTransform at = AffineTransform.getTranslateInstance(-center.getX()+d.width/2,-center.getY()+d.height/2); Point2D localLocation = at.transform(location, null); layout.setLocation(v, localLocation); wasInSublayout = true; } } if(wasInSublayout == false && getGraph().getVertices().contains(v)) { delegate.setLocation(v, location); } }
public void step() { Graph<V,E> g = transitionLayout.getGraph(); for(V v : g.getVertices()) { Point2D tp = transitionLayout.apply(v); Point2D fp = endLayout.apply(v); double dx = (fp.getX()-tp.getX())/(count-counter); double dy = (fp.getY()-tp.getY())/(count-counter); transitionLayout.setLocation(v, new Point2D.Double(tp.getX()+dx,tp.getY()+dy)); } counter++; if(counter >= count) { done = true; vv.setGraphLayout(endLayout); } vv.repaint(); } }
double dx = (fp.getX() - tp.getX()) / (count - counter); double dy = (fp.getY() - tp.getY()) / (count - counter); transitionLayout.setLocation(v, new Point2D.Double(tp.getX() + dx, tp.getY() + dy));
layout.setLocation(vertices[i], coord);
public void actionPerformed(ActionEvent e) { V newVertex = vertexFactory.get(); graph.addVertex(newVertex); layout.setLocation(newVertex, vv.getRenderContext().getMultiLayerTransformer().inverseTransform(p)); vv.repaint(); } });
@SuppressWarnings({ "unchecked", "rawtypes" }) public void collapse(Layout layout, Forest tree, Object subRoot) throws InstantiationException, IllegalAccessException { // get a sub tree from subRoot Forest subTree = TreeUtils.getSubTree(tree, subRoot); Object parent = null; Object edge = null; if(tree.getPredecessorCount(subRoot) > 0) { parent = tree.getPredecessors(subRoot).iterator().next(); edge = tree.getInEdges(subRoot).iterator().next(); } tree.removeVertex(subRoot); if(parent != null) { tree.addEdge(edge, parent, subTree); } else { tree.addVertex(subTree); } layout.setLocation(subTree, (Point2D)layout.apply(subRoot)); }
@Override public void updateNodesXYPosition() { for (GUINode vertex : canvas.getAllVertices()) canvas.getLayout().setLocation(vertex, canvas.getTransformer().transform(vertex)); }
Point2D vp = layout.apply(v); vp.setLocation(vp.getX()+dx, vp.getY()+dy); layout.setLocation(v, vp);
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()); if(picked.size() > 1) { Graph inGraph = layout.getGraph(); Graph clusterGraph = collapser.getClusterGraph(inGraph, picked); Graph g = collapser.collapse(layout.getGraph(), clusterGraph); collapsedGraph = g; double sumx = 0; double sumy = 0; for(Object v : picked) { Point2D p = (Point2D)layout.apply(v); sumx += p.getX(); sumy += p.getY(); } Point2D cp = new Point2D.Double(sumx/picked.size(), sumy/picked.size()); vv.getRenderContext().getParallelEdgeIndexFunction().reset(); layout.setGraph(g); layout.setLocation(clusterGraph, cp); vv.getPickedVertexState().clear(); vv.repaint(); } }});
public void actionPerformed(ActionEvent e) { Collection picked = new HashSet(vv.getPickedVertexState().getPicked()); if(picked.size() > 1) { Graph inGraph = layout.getGraph(); Graph clusterGraph = collapser.getClusterGraph(inGraph, picked); Graph g = collapser.collapse(layout.getGraph(), clusterGraph); double sumx = 0; double sumy = 0; for(Object v : picked) { Point2D p = (Point2D)layout.apply(v); sumx += p.getX(); sumy += p.getY(); } Point2D cp = new Point2D.Double(sumx/picked.size(), sumy/picked.size()); vv.getRenderContext().getParallelEdgeIndexFunction().reset(); layout.setGraph(g); layout.setLocation(clusterGraph, cp); vv.getPickedVertexState().clear(); vv.repaint(); } }});
viz.getGraphLayout().setLocation(concept, new Point2D.Float(width, height));
Vertex v=new Vertex(nodeType+cnt, "soft", ai); graph.addVertex(v); vv.getModel().getGraphLayout().setLocation(v, vv.getRenderContext().getMultiLayerTransformer().inverseTransform(e.getPoint())); Edge newEdge=new Edge(ai.getDestination().getName()+cnt, "destination"); Vertex dest=null; Vertex v=new Vertex(nodeType+cnt, "node", ai); graph.addVertex(v); vv.getModel().getGraphLayout().setLocation(v, vv.getRenderContext().getMultiLayerTransformer().inverseTransform(e.getPoint()));
for (ONDEXMetaConcept mc : layout.getGraph().getVertices()) { if (mc.getConceptClass().getId().equals(id)) { layout.setLocation(mc, p); break;
vv.getModel().getGraphLayout().setLocation(v, vv.getRenderContext().getMultiLayerTransformer().inverseTransform(e.getPoint())); Edge newEdge = new Edge(ai.getRequiredExecutionPlatform().getName() + cnt, "destination"); Vertex dest = null; Vertex v = new Vertex(nodeType + cnt, "node", ai); graph.addVertex(v); vv.getModel().getGraphLayout().setLocation(v, vv.getRenderContext().getMultiLayerTransformer().inverseTransform(e.getPoint()));