installEditPolicy(EditPolicy.COMPONENT_ROLE, new DiagramConnectionEditPolicy());
}
@Override
protected IFigure createFigure() {
PolylineConnection connection = new DiagramConnectionFigure();
IDiagramConnectionDef def = getCastedModel().getModelPart().getConnectionDef();
ConnectionEndpointType type1 = ConnectionEndpointType.NONE;
if (def.getEndpoint1() != null) {
type1 = def.getEndpoint1().getType().content();
}
if (type1.equals(ConnectionEndpointType.ARROW)) {
connection.setSourceDecoration(new PolygonDecoration());
}
ConnectionEndpointType type2 = ConnectionEndpointType.NONE;
if (def.getEndpoint2() != null) {
type2 = def.getEndpoint2().getType().content();
}
if (type2.equals(ConnectionEndpointType.ARROW)) {
connection.setTargetDecoration(new PolygonDecoration());
}
updateStyle(connection);
return connection;
}