Search in sources :

Example 11 with AbstractConnectionEditPart

use of org.eclipse.gef.editparts.AbstractConnectionEditPart in project dbeaver by serge-rider.

the class DirectedGraphLayoutVisitor method applyEntityResults.

//******************* EntityPart apply methods **********/
public void applyEntityResults(GraphicalEditPart entityPart) {
    Node n = (Node) partToNodesMap.get(entityPart);
    IFigure tableFigure = entityPart.getFigure();
    Dimension preferredSize = tableFigure.getPreferredSize();
    Rectangle bounds = new Rectangle(n.x, n.y, preferredSize.width, preferredSize.height);
    tableFigure.setBounds(bounds);
    for (int i = 0; i < entityPart.getSourceConnections().size(); i++) {
        AbstractConnectionEditPart relationship = (AbstractConnectionEditPart) entityPart.getSourceConnections().get(i);
        applyConnectionResults(relationship);
    }
}
Also used : AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) Rectangle(org.eclipse.draw2d.geometry.Rectangle) Dimension(org.eclipse.draw2d.geometry.Dimension)

Example 12 with AbstractConnectionEditPart

use of org.eclipse.gef.editparts.AbstractConnectionEditPart in project tdi-studio-se by Talend.

the class BusinessReferenceConnectionEditPolicy method shouldDeleteSemantic.

/**
     * @generated
     */
protected boolean shouldDeleteSemantic() {
    Assert.isTrue(getHost() instanceof AbstractConnectionEditPart);
    AbstractConnectionEditPart cep = (AbstractConnectionEditPart) getHost();
    boolean isCanonical = false;
    if (cep.getSource() != null)
        isCanonical = IsCanonical(cep.getSource());
    if (cep.getTarget() != null)
        return isCanonical ? isCanonical : IsCanonical(cep.getTarget());
    return isCanonical;
}
Also used : AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart)

Example 13 with AbstractConnectionEditPart

use of org.eclipse.gef.editparts.AbstractConnectionEditPart in project tdi-studio-se by Talend.

the class TableEntityPart method refreshChildrenTargetConnections.

public void refreshChildrenTargetConnections(TableEntityPart rootPart, boolean expanded) {
    for (Object obj : getChildren()) {
        if (obj instanceof TableEntityPart) {
            TableEntityPart part = (TableEntityPart) obj;
            if (expanded) {
                // do collapse
                part.setRootAnchor(rootPart.getFigure());
            } else {
                part.setRootAnchor(null);
            }
            if (part.getTargetConnections() != null) {
                for (Object conn : part.getTargetConnections()) {
                    if (conn instanceof AbstractConnectionEditPart) {
                        AbstractConnectionEditPart connectionEditPart = (AbstractConnectionEditPart) conn;
                        connectionEditPart.refresh();
                    // if (connectionEditPart.getFigure() instanceof PolylineConnection) {
                    // PolylineConnection connFigure = (PolylineConnection) connectionEditPart.getFigure();
                    // if (expanded) {
                    // connFigure.setLineStyle(SWT.LINE_DASHDOTDOT);
                    // } else {
                    // connFigure.setLineStyle(SWT.LINE_SOLID);
                    // }
                    // }
                    }
                }
            }
            part.refreshChildrenTargetConnections(rootPart, expanded);
        }
    }
}
Also used : AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart)

Example 14 with AbstractConnectionEditPart

use of org.eclipse.gef.editparts.AbstractConnectionEditPart in project dbeaver by dbeaver.

the class DirectedGraphLayoutVisitor method applyEntityResults.

// ******************* EntityPart apply methods **********/
public void applyEntityResults(GraphicalEditPart entityPart) {
    Node n = (Node) partToNodesMap.get(entityPart);
    IFigure tableFigure = entityPart.getFigure();
    Dimension preferredSize = tableFigure.getPreferredSize();
    Rectangle bounds = new Rectangle(n.x, n.y, preferredSize.width, preferredSize.height);
    tableFigure.setBounds(bounds);
    for (int i = 0; i < entityPart.getSourceConnections().size(); i++) {
        AbstractConnectionEditPart relationship = (AbstractConnectionEditPart) entityPart.getSourceConnections().get(i);
        applyConnectionResults(relationship);
    }
}
Also used : AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) Rectangle(org.eclipse.draw2d.geometry.Rectangle) Dimension(org.eclipse.draw2d.geometry.Dimension)

Example 15 with AbstractConnectionEditPart

use of org.eclipse.gef.editparts.AbstractConnectionEditPart in project statecharts by Yakindu.

the class RegionPriorityDecorationProvider method createDecorators.

@Override
public void createDecorators(IDecoratorTarget decoratorTarget) {
    EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
    if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
        EditDomain ed = editPart.getViewer().getEditDomain();
        if (!(ed instanceof DiagramEditDomain)) {
            return;
        }
        if (shouldInstall(((DiagramEditDomain) ed).getEditorPart()) && editPart instanceof RegionEditPart) {
            IDecorator decorator = createStatusDecorator(decoratorTarget);
            decorators.add(decorator);
            decoratorTarget.installDecorator(getDecoratorKey(), decorator);
        }
    }
}
Also used : AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) DiagramEditDomain(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain) EditDomain(org.eclipse.gef.EditDomain) RegionEditPart(org.yakindu.sct.ui.editor.editparts.RegionEditPart) GraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart) EditPart(org.eclipse.gef.EditPart) AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) DiagramEditDomain(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain) RegionEditPart(org.yakindu.sct.ui.editor.editparts.RegionEditPart) GraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart) IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) IDecorator(org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator)

Aggregations

AbstractConnectionEditPart (org.eclipse.gef.editparts.AbstractConnectionEditPart)17 Rectangle (org.eclipse.draw2d.geometry.Rectangle)5 EditPart (org.eclipse.gef.EditPart)5 Dimension (org.eclipse.draw2d.geometry.Dimension)4 EditDomain (org.eclipse.gef.EditDomain)2 AbstractGraphicalEditPart (org.eclipse.gef.editparts.AbstractGraphicalEditPart)2 GraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart)2 IGraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)2 DiagramEditDomain (org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain)2 IDecorator (org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator)2 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 ConnLabelEditPart (org.talend.designer.core.ui.editor.connections.ConnLabelEditPart)1 ConnectionPart (org.talend.designer.core.ui.editor.connections.ConnectionPart)1 ConnectionPerformanceEditPart (org.talend.designer.core.ui.editor.connections.ConnectionPerformanceEditPart)1 NodeLabelEditPart (org.talend.designer.core.ui.editor.nodes.NodeLabelEditPart)1 NoteEditPart (org.talend.designer.core.ui.editor.notes.NoteEditPart)1 ProcessPart (org.talend.designer.core.ui.editor.process.ProcessPart)1 EdgeLabelLocator (org.yakindu.base.xtext.utils.gmf.routing.EdgeLabelLocator)1 RegionEditPart (org.yakindu.sct.ui.editor.editparts.RegionEditPart)1 TransitionEditPart (org.yakindu.sct.ui.editor.editparts.TransitionEditPart)1