use of com.archimatetool.editor.diagram.commands.MoveBendpointCommand in project archi by archimatetool.
the class ManualBendpointEditPolicy method getMoveBendpointCommand.
@Override
protected Command getMoveBendpointCommand(BendpointRequest request) {
MoveBendpointCommand command = new MoveBendpointCommand();
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