Search in sources :

Example 1 with AbstractConnectionEditPart

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

the class TreeNodeEditPart method refreshChildrenTargetConnections.

public void refreshChildrenTargetConnections(TreeNodeEditPart rootPart, boolean expanded) {
    for (Object obj : getChildren()) {
        if (obj instanceof TreeNodeEditPart) {
            TreeNodeEditPart part = (TreeNodeEditPart) 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 2 with AbstractConnectionEditPart

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

the class TalendSelectionManager method appendSelection.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.SelectionManager#appendSelection(org.eclipse.gef.EditPart)
     */
@Override
public void appendSelection(EditPart arg0) {
    // judge whether the refresh operation is executed.
    // see bug 3315.
    boolean needRefresh = false;
    if (getSelection() instanceof StructuredSelection) {
        StructuredSelection selection = (StructuredSelection) getSelection();
        Object selected = null;
        for (Object element : selection.toArray()) {
            selected = element;
        }
        if (getSelection().isEmpty() || (selected instanceof ProcessPart)) {
            this.selectionType = ETalendSelectionType.SINGLE;
            needRefresh = true;
        }
        if (!(arg0 instanceof NodeLabelEditPart) && !(arg0 instanceof ConnLabelEditPart) && !(arg0 instanceof ConnectionPart)) {
            // removes old selections of labels by calling setSelection
            for (Object element : selection.toArray()) {
                if (element instanceof NodeLabelEditPart) {
                    this.deselect(((AbstractGraphicalEditPart) element));
                } else if (element instanceof ConnLabelEditPart) {
                    this.deselect(((AbstractGraphicalEditPart) element));
                } else if (element instanceof ConnectionPart) {
                    this.deselect(((AbstractConnectionEditPart) element));
                }
            }
            needRefresh = true;
        }
        if (arg0 instanceof ConnectionPerformanceEditPart && getSelectPoint() != null) {
            if (needRefresh) {
                EditPart transferPart = transferFocus((ConnectionPerformanceEditPart) arg0);
                if (transferPart == null) {
                    needRefresh = false;
                    setSelectPoint(null);
                    return;
                }
                super.appendSelection(transferPart);
                needRefresh = false;
                return;
            }
        }
        if (needRefresh) {
            super.appendSelection(arg0);
            needRefresh = false;
            setSelectPoint(null);
        }
    }
}
Also used : AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) ConnectionPerformanceEditPart(org.talend.designer.core.ui.editor.connections.ConnectionPerformanceEditPart) AbstractGraphicalEditPart(org.eclipse.gef.editparts.AbstractGraphicalEditPart) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) AbstractGraphicalEditPart(org.eclipse.gef.editparts.AbstractGraphicalEditPart) NoteEditPart(org.talend.designer.core.ui.editor.notes.NoteEditPart) NodeLabelEditPart(org.talend.designer.core.ui.editor.nodes.NodeLabelEditPart) EditPart(org.eclipse.gef.EditPart) AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) ConnLabelEditPart(org.talend.designer.core.ui.editor.connections.ConnLabelEditPart) ConnectionPerformanceEditPart(org.talend.designer.core.ui.editor.connections.ConnectionPerformanceEditPart) NodeLabelEditPart(org.talend.designer.core.ui.editor.nodes.NodeLabelEditPart) ProcessPart(org.talend.designer.core.ui.editor.process.ProcessPart) ConnectionPart(org.talend.designer.core.ui.editor.connections.ConnectionPart) ConnLabelEditPart(org.talend.designer.core.ui.editor.connections.ConnLabelEditPart)

Example 3 with AbstractConnectionEditPart

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

the class DirectedGraphLayoutVisitor method addEntityEdges.

// ******************* Entity contribution methods **********/
protected void addEntityEdges(GraphicalEditPart entityPart) {
    List<?> outgoing = entityPart.getSourceConnections();
    for (int i = 0; i < outgoing.size(); i++) {
        AbstractConnectionEditPart connectionPart = (AbstractConnectionEditPart) entityPart.getSourceConnections().get(i);
        addConnectionEdges(connectionPart);
    }
}
Also used : AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart)

Example 4 with AbstractConnectionEditPart

use of org.eclipse.gef.editparts.AbstractConnectionEditPart in project archi by archimatetool.

the class AllArchimateRelationshipUIProviderTests method testCreateEditPart.

@Override
public void testCreateEditPart() {
    EditPart editPart = provider.createEditPart();
    assertTrue(editPart instanceof AbstractConnectionEditPart);
}
Also used : AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) EditPart(org.eclipse.gef.EditPart) AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart)

Example 5 with AbstractConnectionEditPart

use of org.eclipse.gef.editparts.AbstractConnectionEditPart in project archi by archimatetool.

the class LineConnectionUIProviderTests method testCreateEditPart.

@Override
public void testCreateEditPart() {
    EditPart editPart = provider.createEditPart();
    assertTrue(editPart instanceof AbstractConnectionEditPart);
}
Also used : AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) EditPart(org.eclipse.gef.EditPart) AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart)

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