use of org.yakindu.sct.ui.editor.commands.SetConnectionBendpointsAndLabelCommmand in project statecharts by Yakindu.
the class InitialPointsConnectionBendpointEditPolicy method getBendpointsChangedCommand.
@Override
protected Command getBendpointsChangedCommand(BendpointRequest request) {
PointList originalPoints = InitialPointsOfRequestDataManager.getOriginalPoints(request);
Command result = super.getBendpointsChangedCommand(request);
if (result instanceof ICommandProxy) {
ICommand iCommand = ((ICommandProxy) result).getICommand();
if (iCommand instanceof SetConnectionBendpointsAndLabelCommmand) {
((SetConnectionBendpointsAndLabelCommmand) iCommand).setLabelsToUpdate((org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart) getHost(), originalPoints);
}
}
return result;
}
use of org.yakindu.sct.ui.editor.commands.SetConnectionBendpointsAndLabelCommmand in project statecharts by Yakindu.
the class InitialPointsConnectionBendpointEditPolicy method getBendpointsChangedCommand.
@Override
protected Command getBendpointsChangedCommand(Connection connection, Edge edge) {
Point ptRef1 = connection.getSourceAnchor().getReferencePoint();
getConnection().translateToRelative(ptRef1);
Point ptRef2 = connection.getTargetAnchor().getReferencePoint();
getConnection().translateToRelative(ptRef2);
TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
SetConnectionBendpointsAndLabelCommmand sbbCommand = new SetConnectionBendpointsAndLabelCommmand(editingDomain);
sbbCommand.setEdgeAdapter(new EObjectAdapter(edge));
sbbCommand.setNewPointList(connection.getPoints(), ptRef1, ptRef2);
return new ICommandProxy(sbbCommand);
}
Aggregations