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);
}
}
}
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);
}
}
}
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);
}
}
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);
}
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);
}
Aggregations