ConnectionEndpointLocator relationshipLocator = new ConnectionEndpointLocator(
(PolylineConnection) connection.getConnectionFigure(), true);
relationshipLocator.setUDistance(0);
relationshipLocator.setVDistance(10);
Figure decoractionFigure = new Figure();
ToolbarLayout layout = new ToolbarLayout();
decoractionFigure.setLayoutManager(layout);
decoractionFigure.setOpaque(false);
Label weightLabel = new Label(weight);
weightLabel.setFont(decoractionFontSmall);
decoractionFigure.add(weightLabel);
decoractionFigure.setSize(-1, -1);
((PolylineConnection) connection.getConnectionFigure()).add(
decoractionFigure, relationshipLocator);
}