Search in sources :

Example 41 with PolylineConnection

use of org.eclipse.draw2d.PolylineConnection in project archi by archimatetool.

the class Graph method removeConnection.

void removeConnection(GraphConnection connection) {
    IFigure figure = connection.getConnectionFigure();
    PolylineConnection sourceContainerConnectionFigure = connection.getSourceContainerConnectionFigure();
    PolylineConnection targetContainerConnectionFigure = connection.getTargetContainerConnectionFigure();
    connection.removeFigure();
    this.getConnections().remove(connection);
    figure2ItemMap.remove(figure);
    if (sourceContainerConnectionFigure != null) {
        figure2ItemMap.remove(sourceContainerConnectionFigure);
    }
    if (targetContainerConnectionFigure != null) {
        figure2ItemMap.remove(targetContainerConnectionFigure);
    }
}
Also used : IFigure(org.eclipse.draw2d.IFigure) PolylineConnection(org.eclipse.draw2d.PolylineConnection)

Example 42 with PolylineConnection

use of org.eclipse.draw2d.PolylineConnection in project jbosstools-hibernate by jbosstools.

the class DummyEdgePart method createFigure.

/**
 * @see org.eclipse.gef.editparts.AbstractConnectionEditPart#createFigure()
 */
protected IFigure createFigure() {
    PolylineConnection conn = new PolylineConnection();
    conn.setConnectionRouter(new BendpointConnectionRouter());
    conn.setVisible(false);
    return conn;
}
Also used : BendpointConnectionRouter(org.eclipse.draw2d.BendpointConnectionRouter) PolylineConnection(org.eclipse.draw2d.PolylineConnection)

Example 43 with PolylineConnection

use of org.eclipse.draw2d.PolylineConnection in project jbosstools-hibernate by jbosstools.

the class AssociationEditPart method createFigure.

protected IFigure createFigure() {
    PolylineConnection polylineConnection = new PolylineConnection();
    AssociationViewAdapter association = (AssociationViewAdapter) getModel();
    polylineConnection.setTargetDecoration(association.getTargetDecoration());
    ConnectionRouter connectionRouter = association.getConnectionRouter();
    if (connectionRouter != null) {
        polylineConnection.setConnectionRouter(connectionRouter);
    }
    AssociationViewAdapter ava = (AssociationViewAdapter) getModel();
    if (ava.getAssociationName() != null) {
        MidpointLocator mpl = new MidpointLocator(polylineConnection, 0);
        polylineConnection.add(new Label(ava.getAssociationName()), mpl);
    }
    polylineConnection.setForegroundColor(ColorConstants.gray);
    return polylineConnection;
}
Also used : MidpointLocator(org.eclipse.draw2d.MidpointLocator) Label(org.eclipse.draw2d.Label) ConnectionRouter(org.eclipse.draw2d.ConnectionRouter) PolylineConnection(org.eclipse.draw2d.PolylineConnection) AssociationViewAdapter(org.hibernate.eclipse.graph.model.AssociationViewAdapter)

Aggregations

PolylineConnection (org.eclipse.draw2d.PolylineConnection)43 Point (org.eclipse.draw2d.geometry.Point)11 PolygonDecoration (org.eclipse.draw2d.PolygonDecoration)10 IFigure (org.eclipse.draw2d.IFigure)8 BendpointConnectionRouter (org.eclipse.draw2d.BendpointConnectionRouter)6 Label (org.eclipse.draw2d.Label)6 BaseConnectionEditPart (org.talend.designer.gefabstractmap.part.BaseConnectionEditPart)5 Edge (org.eclipse.draw2d.graph.Edge)3 ArrayList (java.util.ArrayList)2 AbsoluteBendpoint (org.eclipse.draw2d.AbsoluteBendpoint)2 ManhattanConnectionRouter (org.eclipse.draw2d.ManhattanConnectionRouter)2 Dimension (org.eclipse.draw2d.geometry.Dimension)2 Rectangle (org.eclipse.draw2d.geometry.Rectangle)2 Node (org.eclipse.draw2d.graph.Node)2 NodeList (org.eclipse.draw2d.graph.NodeList)2 ConnectionEditPart (org.eclipse.gef.ConnectionEditPart)2 CurveConnectionRouter (org.talend.designer.gefabstractmap.figures.routers.CurveConnectionRouter)2 TableTreeEntityFigure (org.talend.designer.gefabstractmap.figures.table.entity.TableTreeEntityFigure)2 InputTablePart (org.talend.designer.gefabstractmap.part.InputTablePart)2 LookupConnectionPart (org.talend.designer.gefabstractmap.part.LookupConnectionPart)2