Package org.eclipse.draw2d

Examples of org.eclipse.draw2d.PolylineConnection


    }

    protected void applyResults(ElementConnectionEditPart connectionPart)    {
        Edge e = (Edge) partToNodesMap.get(connectionPart);
        NodeList nodes = e.vNodes;
        PolylineConnection conn = (PolylineConnection) connectionPart.getConnectionFigure();
        conn.setTargetDecoration(new PolygonDecoration());
        if (nodes != null) {
            List<Bendpoint> bends = new ArrayList<Bendpoint>();
            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


    }
   
    protected abstract ElementConnectionFactory getDefaultElementConnectionFactory();

    protected IFigure createFigure() {
        PolylineConnection result = new PolylineConnection();
        result.setConnectionRouter(new BendpointConnectionRouter());
        result.setTargetDecoration(new PolygonDecoration());
        return result;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
     */
    protected IFigure createFigure() {
        PolylineConnection connection = new ConnectionFigure();
        PolylineDecoration decoration = new PolylineDecoration();
        connection.setTargetDecoration( decoration );
        return connection;
    }
View Full Code Here

      logger.fine("refreshVisuals()");
    }
    super.refreshVisuals();

//    Object model = getModel();
    PolylineConnection figureConnection = (PolylineConnection) getFigure();
    // set color ...
    figureConnection.invalidate();
    //setRoutingConstraint(null);
  }
View Full Code Here

import org.eclipse.gef.requests.GroupRequest;

public class ConnectionPart extends AbstractConnectionEditPart {

  protected IFigure createFigure() {
    PolylineConnection connection = (PolylineConnection) super.createFigure();
    connection.setTargetDecoration(new PolygonDecoration());
    connection.setLineStyle(Graphics.LINE_SOLID);
    return connection;
  }
View Full Code Here

    @Override
    protected IFigure createFigure() {
        IFigure figure = super.createFigure();
        if (getParent() instanceof TransitionGraphicalEditPart) {
            PolylineConnection connection = (PolylineConnection) ((TransitionGraphicalEditPart) getParent()).getConnectionFigure();
            connection.addRoutingListener(new RoutingListener() {
                public void invalidate(Connection connection) {
                }
                public void postRoute(Connection connection) {
                    if (getParent() == null) return;
                    int index = ((Active) getParent().getModel()).getActions().indexOf(getModel());
View Full Code Here

  private Color color;

  @Override
  protected void addSelectionHandles() {
    super.addSelectionHandles();
    PolylineConnection connection = getConnectionFigure();
    color = connection.getForegroundColor();
    Device device = color.getDevice();
    int red = (255 - color.getRed()) / 2;
    int green = (255 - color.getGreen()) / 2;
    int blue = (255 - color.getBlue()) / 2;
    connection.setForegroundColor(new Color(device, red, green, blue));
  }
View Full Code Here

  }

  @Override
  protected void removeSelectionHandles() {
    super.removeSelectionHandles();
    PolylineConnection connection = getConnectionFigure();
    if (color != null) {
      connection.setForegroundColor(color);
    }
  }
View Full Code Here

     * (non-Javadoc)
     *
     * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
     */
    protected IFigure createFigure() {
        PolylineConnection connection = (PolylineConnection) super.createFigure();
        connection.setTargetDecoration(new PolygonDecoration()); // arrow at
                                                                 // target
                                                                 // endpoint
        connection.setLineStyle(getCastedModel().getLineStyle()); // line
                                                                  // drawing
                                                                  // style
        return connection;
    }
View Full Code Here

    }
   
    protected abstract ElementConnectionFactory getDefaultElementConnectionFactory();

    protected IFigure createFigure() {
        PolylineConnection result = new PolylineConnection();
        result.setConnectionRouter(new BendpointConnectionRouter());
        result.setTargetDecoration(new PolygonDecoration());
        return result;
    }
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.