Package org.eclipse.draw2d

Examples of org.eclipse.draw2d.PolylineConnection


    graph.edges.add(new Edge(n, target));
  }

  @Override
  protected IFigure createFigure() {
    PolylineConnection conn = (PolylineConnection) super.createFigure();
    l = new TransitionLabel(75);
    l.setForegroundColor(ColorConstants.black);
    l.setOpaque(true);
    conn.add(l, new ConnectionLocator(conn));
    return conn;
  }
View Full Code Here


  }

  protected void applyGraphResults(CompoundDirectedGraph graph, Map<AbstractGraphicalEditPart, Object> map) {
    Edge e = (Edge) map.get(this);
    NodeList nodes = e.vNodes;
    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));
        }
        else {
          bends.add(new AbsoluteBendpoint(x, y));
          bends.add(new AbsoluteBendpoint(x, y + vn.height));
        }
      }
      conn.setRoutingConstraint(bends);
    }
    else {
      conn.setRoutingConstraint(Collections.EMPTY_LIST);
    }
  }
View Full Code Here

  /**
   * @see org.eclipse.gef.editparts.AbstractConnectionEditPart#createFigure()
   */
  @Override
  protected IFigure createFigure() {
    PolylineConnection conn = (PolylineConnection) super.createFigure();
    conn.setConnectionRouter(new BendpointConnectionRouter() {
      @Override
      public void route(Connection conn) {
        GraphAnimation.recordInitialState(conn);
        if (!GraphAnimation.playbackState(conn)) {
          super.route(conn);
        }
      }
    });
    if (((Transition) getModel()).isDirectional()) {
      conn.setTargetDecoration(new PolygonDecoration());
    }
    conn.setLineStyle(((Transition) getModel()).getLineStyle());
    conn.setForegroundColor(ColorConstants.gray);
    conn.setLineWidth(2);
    return conn;
  }
View Full Code Here

   * @return
   *
   * @see org.eclipse.gef.editparts.AbstractConnectionEditPart#createFigure()
   */
  protected IFigure createFigure() {
    PolylineConnection conn = (PolylineConnection) super.createFigure();
    conn.setTargetDecoration(new PolygonDecoration());
    if (!getTransitionModel().isThen()) {
      conn.setLineStyle(Graphics.LINE_DASH);
      conn.setBackgroundColor(ColorConstants.lightGray);
      conn.setForegroundColor(ColorConstants.lightGray);
    }
    return conn;
  }
View Full Code Here

  /*
   * (non-Javadoc)
   * @see org.eclipse.gef.editparts.AbstractConnectionEditPart#createFigure()
   */
  protected IFigure createFigure() {
    PolylineConnection conn = (PolylineConnection) super.createFigure();
    if (getTransitionModel().getActions().size() > 0) {
      label = new Label();
      label.setBorder(new LineBorder());
      label.setBackgroundColor(COLOR);
      label.setOpaque(true);
      label.setIcon(WebflowUIImages
          .getImage(WebflowUIImages.IMG_OBJS_ACTION));
      conn.add(label, new ConnectionLocator(conn));
    }

    conn.setToolTip(new Label(eLabelProvider.getText(getModel(), false,
        true, true)));

    conn.setTargetDecoration(new PolygonDecoration());
    return conn;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.PolylineConnection

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.