use of org.jkiss.dbeaver.erd.model.ERDAssociation in project dbeaver by dbeaver.
the class AssociationPart method createFigure.
@Override
protected IFigure createFigure() {
PolylineConnection conn = new PolylineConnection();
conn.setForegroundColor(UIUtils.getColorRegistry().get(ERDUIConstants.COLOR_ERD_LINES_FOREGROUND));
boolean showComments = getDiagramPart().getDiagram().hasAttributeStyle(ERDViewStyle.COMMENTS);
if (showComments) {
ERDAssociation association = getAssociation();
if (association != null && association.getObject() != null && !CommonUtils.isEmpty(association.getObject().getDescription())) {
ConnectionLocator descLabelLocator = new ConnectionLocator(conn, ConnectionLocator.MIDDLE);
// descLabelLocator.setRelativePosition(50);
// descLabelLocator.setGap(50);
Label descLabel = new Label(association.getObject().getDescription());
descLabel.setForegroundColor(UIUtils.getColorRegistry().get(ERDUIConstants.COLOR_ERD_ATTR_FOREGROUND));
// Border border = new MarginBorder(20, 0, 0, 0);
// descLabel.setBorder(border);
conn.add(descLabel, descLabelLocator);
}
}
setConnectionStyles(conn);
setConnectionRouting(conn);
setConnectionToolTip(conn);
return conn;
}
Aggregations