use of com.archimatetool.model.IDiagramModelBendpoint in project archi by archimatetool.
the class DiagramConnectionEditPart method refreshBendpoints.
/**
* Updates the bendpoints, based on the model
*/
protected void refreshBendpoints() {
if (getConnectionFigure().getConnectionRouter() instanceof ManhattanConnectionRouter) {
return;
}
List<Bendpoint> figureConstraint = new ArrayList<Bendpoint>();
EList<IDiagramModelBendpoint> bendpoints = getModel().getBendpoints();
for (int i = 0; i < bendpoints.size(); i++) {
IDiagramModelBendpoint bendpoint = bendpoints.get(i);
RelativeBendpoint rbp = new RelativeBendpoint(getConnectionFigure());
Dimension dim1 = new Dimension(bendpoint.getStartX(), bendpoint.getStartY());
Dimension dim2 = new Dimension(bendpoint.getEndX(), bendpoint.getEndY());
rbp.setRelativeDimensions(dim1, dim2);
rbp.setWeight((i + 1) / ((float) bendpoints.size() + 1));
figureConstraint.add(rbp);
}
getConnectionFigure().setRoutingConstraint(figureConstraint);
}
Aggregations