Package org.eclipse.draw2d.graph

Examples of org.eclipse.draw2d.graph.Node


        while (edges.hasNext()) {
          Edge edge = (Edge) edges.next();
          if (edge.vNodes != null) {
            Iterator points = edge.vNodes.iterator();
            while (points.hasNext()) {
              Node node = (Node) points.next();
              node.y -= deltaY;
            }
          }
        }
      }
View Full Code Here


    graph.nodes.add(n);
  }

  @Override
  public void contributeToGraph(CompoundDirectedGraph graph, Map<AbstractGraphicalEditPart, Object> map) {
    Node source = (Node) map.get(getSource());
    Node target = (Node) map.get(getTarget());
    Node n = (Node) map.get(this);
    graph.edges.add(new Edge(source, n));
    graph.edges.add(new Edge(n, target));
  }
View Full Code Here

    }
    applyMaxWidths();
  }

  protected void applyChildrenResultsToOwn(CompoundDirectedGraph graph, Map<AbstractGraphicalEditPart, Object> map) {
    Node n = (Node) map.get(this);
    int bottom = -1;
    for (int i = 0; i < getChildren().size(); i++) {
      ActivityPart part = (ActivityPart) getChildren().get(i);
      if (part.getFigure().getBounds().bottom() > bottom) {
        bottom = part.getFigure().getBounds().getBottom().y;
View Full Code Here

  }

  @Override
  protected void contributeNodesToGraph(CompoundDirectedGraph graph, Subgraph s,
      Map<AbstractGraphicalEditPart, Object> map) {
    Node n = new Node(this, s);
    n.setRowConstraint(getActivity().getSortIndex());
    n.outgoingOffset = getAnchorOffset();
    n.incomingOffset = getAnchorOffset();
    Dimension hint = getFigureHint();
    n.width = hint.width;
    n.height = hint.height;
    if (graph.getDirection() == PositionConstants.EAST) {
      n.setPadding(new Insets(8, 10, 12, 10));
    }
    else {
      n.setPadding(new Insets(10, 8, 10, 12));
    }
    map.put(this, n);
    graph.nodes.add(n);

    for (int i = 0; i < getSourceConnections().size(); i++) {
View Full Code Here

   * java.util.Map)
   */
  @Override
  protected void contributeEdgesToGraph(CompoundDirectedGraph graph, Map<AbstractGraphicalEditPart, Object> map) {
    super.contributeEdgesToGraph(graph, map);
    Node node, prev = null;
    EditPart a;
    List members = getChildren();
    for (int n = 0; n < members.size(); n++) {
      a = (EditPart) members.get(n);
      node = (Node) map.get(a);
View Full Code Here

    super.activate();
    getActivity().addPropertyChangeListener(this);
  }

  protected void applyBoundsResults(CompoundDirectedGraph graph, Map<AbstractGraphicalEditPart, Object> map) {
    Node n = (Node) map.get(this);
    getFigure().setBounds(new Rectangle(n.x, n.y, n.width, n.height));
  }
View Full Code Here

    }
    applyMaxWidths();
  }

  protected void applyChildrenResultsToOwn(CompoundDirectedGraph graph, Map<AbstractGraphicalEditPart, Object> map) {
    Node n = (Node) map.get(this);
    int bottom = -1;
    for (int i = 0; i < getChildren().size(); i++) {
      ActivityPart part = (ActivityPart) getChildren().get(i);
      if (part.getFigure().getBounds().bottom() > bottom) {
        bottom = part.getFigure().getBounds().getBottom().y;
View Full Code Here

  }

  @Override
  protected void applyGraphResults(CompoundDirectedGraph graph, Map<AbstractGraphicalEditPart, Object> map) {
    if (!isManualLayout()) {
      Node n = (Node) map.get(this);
      List bends = new ArrayList();
      applyBends(bends, n.incoming);
      applyBends(bends, n.outgoing);
      getConnectionFigure().setRoutingConstraint(bends);
    }
View Full Code Here

    for (int i = 0; i < edges.size(); i++) {
      Edge e = (Edge) edges.get(i);
      NodeList nodes = e.vNodes;
      if (nodes != null) {
        for (int j = 0; j < nodes.size(); j++) {
          Node vn = nodes.getNode(i);
          int x = vn.x;
          int y = vn.y;
          if (e.isFeedback()) {
            bends.add(new AbsoluteBendpoint(x, y + vn.height));
            bends.add(new AbsoluteBendpoint(x, y));
View Full Code Here

  }

  @Override
  public void contributeNodesToGraph(CompoundDirectedGraph graph, Subgraph s,
      Map<AbstractGraphicalEditPart, Object> map) {
    Node n = new Node(this, s);
    Dimension hint = getConnectionFigure().getPreferredSize();
    n.width = hint.width;
    n.height = hint.height;
    if (graph.getDirection() == PositionConstants.EAST) {
      n.setPadding(new Insets(8, 10, 12, 10));
    }
    else {
      n.setPadding(new Insets(10, 8, 10, 12));
    }
    map.put(this, n);
    graph.nodes.add(n);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.graph.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.