Search in sources :

Example 1 with ChangeBusinessItemAlignmentCommand

use of org.talend.designer.business.diagram.custom.commands.ChangeBusinessItemAlignmentCommand in project tdi-studio-se by Talend.

the class DiagramModelService method setBusinessItemAlignment.

public void setBusinessItemAlignment(BusinessAlignment alignment, BusinessAlignment alignmentGroup, Object part) {
    if (part instanceof BusinessItemShapeEditPart) {
        BusinessItem item = (BusinessItem) ((Node) ((BusinessItemShapeEditPart) part).getModel()).getElement();
        ChangeBusinessItemAlignmentCommand command = new ChangeBusinessItemAlignmentCommand(item, alignment, alignmentGroup);
        try {
            command.execute(null, null);
        } catch (ExecutionException e) {
        }
        ((BusinessItemShapeEditPart) part).refreshVisuals();
    }
}
Also used : ChangeBusinessItemAlignmentCommand(org.talend.designer.business.diagram.custom.commands.ChangeBusinessItemAlignmentCommand) BusinessItemShapeEditPart(org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart) ExecutionException(org.eclipse.core.commands.ExecutionException) BusinessItem(org.talend.designer.business.model.business.BusinessItem)

Aggregations

ExecutionException (org.eclipse.core.commands.ExecutionException)1 ChangeBusinessItemAlignmentCommand (org.talend.designer.business.diagram.custom.commands.ChangeBusinessItemAlignmentCommand)1 BusinessItemShapeEditPart (org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart)1 BusinessItem (org.talend.designer.business.model.business.BusinessItem)1