use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.TypeReferenceConnection in project webtools.sourceediting by eclipse.
the class XSDSimpleTypeEditPart method createConnectionFigure.
public TypeReferenceConnection createConnectionFigure() {
TypeReferenceConnection connectionFigure = null;
XSDSimpleTypeDefinitionAdapter adapter = (XSDSimpleTypeDefinitionAdapter) getModel();
IType superType = adapter.getSuperType();
if (superType != null) {
AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart) getTargetEditPart(superType);
if (referenceTypePart != null) {
connectionFigure = new TypeReferenceConnection(true);
// draw a line out from the top
connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.TOP, 1));
// TODO (cs) need to draw the target anchor to look like a UML inheritance relationship
// adding a label to the connection would help to
connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(referenceTypePart.getFigure(), CenteredConnectionAnchor.BOTTOM, 0, 0));
connectionFigure.setConnectionRouter(new ManhattanConnectionRouter());
((CenteredConnectionAnchor) connectionFigure.getSourceAnchor()).setOther((CenteredConnectionAnchor) connectionFigure.getTargetAnchor());
connectionFigure.setHighlight(false);
}
}
return connectionFigure;
}
Aggregations