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