Package org.eclipse.draw2d.graph

Examples of org.eclipse.draw2d.graph.Node


  }

  @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


    PolylineConnection conn = (PolylineConnection) getConnectionFigure();

    if (nodes != null && !isManualLayout()) {
      List<AbsoluteBendpoint> bends = new ArrayList<AbsoluteBendpoint>();
      for (int i = 0; i < nodes.size(); i++) {
        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

    }
  }

  protected void contributeToGraph(CompoundDirectedGraph graph, Map<AbstractGraphicalEditPart, Object> map) {
    GraphAnimation.recordInitialState(getConnectionFigure());
    Node source = (Node) map.get(getSource());
    Node target = (Node) map.get(getTarget());
    Edge e = new Edge(this, source, target);
    graph.edges.add(e);
    map.put(this, e);
  }
View Full Code Here

    // Difference from DGLA; use the unmodified Draw2D DirectedGraph since
    // the extended one from the superclass does not handle the horizontal
    // use case properly.
    DirectedGraph graph = new DirectedGraph();
    for (InternalNode internalNode : entitiesToLayout) {
      Node node = new Node(internalNode);
      // Difference from DGLA; get the height/width from the InternalNode
      // and apply it to the Draw2D Node. Take orientation into account.
      int height = new Double(internalNode.getHeightInLayout()).intValue();
      int width = new Double(internalNode.getWidthInLayout()).intValue();
      if ((layout_styles & SWT.HORIZONTAL) == SWT.HORIZONTAL) {
        node.setSize(new Dimension(height, width));
      }
      else {
        node.setSize(new Dimension(width, height));
      }
      // End difference from DGLA
      mapping.put(internalNode, node);
      graph.nodes.add(node);
    }
    for (InternalRelationship relationship : relationshipsToConsider) {
      Node source = (Node) mapping.get(relationship.getSource());
      Node dest = (Node) mapping.get(relationship.getDestination());
      if (source != null && dest != null) {
        Edge edge = new Edge(relationship, source, dest);
        graph.edges.add(edge);
      }
    }
    DirectedGraphLayout directedGraphLayout = new DirectedGraphLayout();
    directedGraphLayout.visit(graph);

    for (Iterator iterator = graph.nodes.iterator(); iterator.hasNext();) {
      Node node = (Node) iterator.next();
      InternalNode internalNode = (InternalNode) node.data;
      // For horizontal layout transpose the x and y coordinates
      if ((layout_styles & SWT.HORIZONTAL) == SWT.HORIZONTAL) {
        internalNode.setInternalLocation(node.y, node.x);
      }
View Full Code Here

   * @param map
   */
  @SuppressWarnings("unchecked")
  public void contributeToGraph(CompoundDirectedGraph graph, Map map) {
    GraphAnimation.recordInitialState(getConnectionFigure());
    Node source = (Node) map.get(getSource());
    Node target = (Node) map.get(getTarget());
    Edge e = null;
    if (target.data != null && target.data instanceof AbstractStatePart) {
      IState startState = ((IWebflowState) ((AbstractStatePart) target.data)
          .getState().getElementParent()).getStartState();
      IIf sourceState = (IIf) ((AbstractStatePart) source.data)
View Full Code Here

    super(model);
  }

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

   * @param map
   */
  @SuppressWarnings("unchecked")
  public void contributeToGraph(CompoundDirectedGraph graph, Map map) {
    GraphAnimation.recordInitialState(getConnectionFigure());
    Node source = (Node) map.get(getSource());
    Node target = (Node) map.get(getTarget());
    Edge e = null;
    if (target.data != null && target.data instanceof AbstractStatePart) {
      IState startState = ((IWebflowState) ((AbstractStatePart) target.data)
          .getState().getElementParent()).getStartState();
      IState sourceState = ((AbstractStatePart) source.data).getState();
View Full Code Here

   *
   * @param graph
   * @param map
   */
  protected void applyGraphResults(CompoundDirectedGraph graph, Map map) {
    Node n = (Node) map.get(this);
    getFigure().setBounds(
        new Rectangle(n.x, n.y, getFigure().getPreferredSize().width, getFigure().getPreferredSize().height));

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

    }
  }

  protected void applyChildrenResultsToOwn(CompoundDirectedGraph graph,
      Map map) {
    Node n = (Node) map.get(this);
    int bottom = -1;
    for (int i = 0; i < getChildren().size(); i++) {
      AbstractStatePart part = (AbstractStatePart) getChildren().get(i);

      if (part.getFigure().getBounds().bottom() > bottom) {
View Full Code Here

    applyChildrenResults(graph, map);
    applyChildrenResultsToOwn(graph, map);
  }

  protected void applyOwnResults(CompoundDirectedGraph graph, Map map) {
    Node n = (Node) map.get(this);

    if (getModelChildren() != null && getModelChildren().size() > 0) {
      getFigure().setBounds(new Rectangle(n.x, n.y, n.width, n.height));
    }
    else {
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.