use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor in project webtools.sourceediting by eclipse.
the class ModelGroupDefinitionReferenceEditPart method createConnectionFigure.
public ReferenceConnection createConnectionFigure(BaseEditPart child) {
ReferenceConnection connectionFigure = new ReferenceConnection();
connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(((GenericGroupFigure) getFigure()).getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
if (child instanceof ModelGroupEditPart) {
connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((ModelGroupEditPart) child).getTargetFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
} else // for the cyclic group references
{
connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((GenericGroupFigure) getFigure()).getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
}
connectionFigure.setHighlight(false);
return connectionFigure;
}
use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor 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;
}
use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor in project webtools.sourceediting by eclipse.
the class AttributeGroupDefinitionEditPart method createConnectionFigure.
public ReferenceConnection createConnectionFigure(BaseEditPart child) {
ReferenceConnection connectionFigure = new ReferenceConnection();
connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(((GenericGroupFigure) getFigure()).getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
if (child instanceof AttributeGroupDefinitionEditPart) {
connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((AttributeGroupDefinitionEditPart) child).getTargetFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
} else if (child instanceof TargetConnectionSpacingFigureEditPart) {
// TargetConnectionSpacingFigureEditPart elem = (TargetConnectionSpacingFigureEditPart) child;
connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((TargetConnectionSpacingFigureEditPart) child).getFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
}
connectionFigure.setHighlight(false);
figure = connectionFigure;
return connectionFigure;
}
use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor in project webtools.sourceediting by eclipse.
the class ModelGroupEditPart method createConnectionFigure.
public ReferenceConnection createConnectionFigure(BaseEditPart child) {
ReferenceConnection connectionFigure = new ReferenceConnection();
GenericGroupFigure modelGroupFigure = (GenericGroupFigure) getFigure();
connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(modelGroupFigure.getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
if (child instanceof ModelGroupEditPart) {
connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((ModelGroupEditPart) child).getTargetFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
} else if (child instanceof TargetConnectionSpacingFigureEditPart) {
TargetConnectionSpacingFigureEditPart elem = (TargetConnectionSpacingFigureEditPart) child;
connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(elem.getFigure(), CenteredConnectionAnchor.LEFT, 0, 1));
} else if (child instanceof ModelGroupDefinitionReferenceEditPart) {
ModelGroupDefinitionReferenceEditPart elem = (ModelGroupDefinitionReferenceEditPart) child;
connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(elem.getFigure(), CenteredConnectionAnchor.LEFT, 0, 1));
}
connectionFigure.setHighlight(false);
return connectionFigure;
}
Aggregations