use of com.archimatetool.editor.diagram.commands.CreateBendpointCommand in project archi by archimatetool.
the class ManualBendpointEditPolicy method getCreateBendpointCommand.
@Override
protected Command getCreateBendpointCommand(BendpointRequest request) {
CreateBendpointCommand command = new CreateBendpointCommand();
Point p = request.getLocation();
Connection conn = getConnection();
conn.translateToRelative(p);
command.setLocation(p);
Point ref1 = getConnection().getSourceAnchor().getReferencePoint();
Point ref2 = getConnection().getTargetAnchor().getReferencePoint();
conn.translateToRelative(ref1);
conn.translateToRelative(ref2);
command.setRelativeDimensions(p.getDifference(ref1), p.getDifference(ref2));
command.setDiagramModelConnection((IDiagramModelConnection) request.getSource().getModel());
command.setIndex(request.getIndex());
return command;
}
Aggregations