示例#1
0
 /** Place the given node at the given position but do not reroute its edges. */
 public static final void placeNoReroute(LayoutTarget target, Object node, double x, double y) {
   Rectangle2D bounds = target.getBounds(node);
   target.translate(
       node,
       x - bounds.getWidth() / 2 - bounds.getX(),
       y - bounds.getHeight() / 2 - bounds.getY());
 }
示例#2
0
 /** Iterate over all the visible edges in the given graph and reroute them. */
 public static final void routeVisibleEdges(Object composite, LayoutTarget target) {
   for (Iterator i = GraphUtilities.localEdges(composite, target.getGraphModel()); i.hasNext(); ) {
     Object edge = i.next();
     if (target.isEdgeVisible(edge)) {
       target.route(edge);
     }
   }
 }
示例#3
0
  /** Place the given node at the given position and reroute its edges. */
  public static final void place(LayoutTarget target, Object node, double x, double y) {
    GraphModel model = target.getGraphModel();
    placeNoReroute(target, node, x, y);

    for (Iterator i = model.inEdges(node); i.hasNext(); ) {
      Object edge = i.next();
      if (target.isEdgeVisible(edge)) {
        target.route(edge); // XXX reroute
      }
    }
    for (Iterator i = model.outEdges(node); i.hasNext(); ) {
      Object edge = i.next();
      if (target.isEdgeVisible(edge)) {
        target.route(edge); // XXX reroute
      }
    }
    // XXX reroute children if it's a composite node!
  }