Search in sources :

Example 1 with DragDropEditPolicy

use of org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy in project statecharts by Yakindu.

the class StateFigureCompartmentEditPart method createDefaultEditPolicies.

@Override
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    installEditPolicy(EditPolicyRoles.CREATION_ROLE, new StateCompartmentCreationEditPolicy());
    installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new StateCompartmentCanonicalEditPolicy());
    installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
    installEditPolicy(EditPolicy.LAYOUT_ROLE, new CompartmentLayoutEditPolicy(SGraphPackage.Literals.COMPOSITE_ELEMENT__REGIONS));
    removeEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
}
Also used : CompartmentLayoutEditPolicy(org.yakindu.base.gmf.runtime.editpolicies.CompartmentLayoutEditPolicy) StateCompartmentCreationEditPolicy(org.yakindu.sct.ui.editor.policies.StateCompartmentCreationEditPolicy) StateCompartmentCanonicalEditPolicy(org.yakindu.sct.ui.editor.policies.StateCompartmentCanonicalEditPolicy) DragDropEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy)

Example 2 with DragDropEditPolicy

use of org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy in project statecharts by Yakindu.

the class StatechartDiagramEditPart method createDefaultEditPolicies.

@Override
protected void createDefaultEditPolicies() {
    installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new CompositeElementCanonicalEditPolicy());
    super.createDefaultEditPolicies();
    installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
    installEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy());
    removeEditPolicy(EditPolicyRoles.POPUPBAR_ROLE);
    installEditPolicy(EditPolicyRoles.SNAP_FEEDBACK_ROLE, new SimpleSnapFeedbackPolicy());
}
Also used : CompositeElementCanonicalEditPolicy(org.yakindu.sct.ui.editor.policies.CompositeElementCanonicalEditPolicy) XYLayoutEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy) DragDropEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy)

Example 3 with DragDropEditPolicy

use of org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy in project statecharts by Yakindu.

the class RegionCompartmentEditPart method createDefaultEditPolicies.

@Override
protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CompartmentCreationEditPolicy());
    installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new RegionCompartmentCanonicalEditPolicy());
    installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
    installEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy() {

        @Override
        protected Command getResizeChildrenCommand(ChangeBoundsRequest request) {
            // Remove dithering connection anchors
            CompoundCommand result = new CompoundCommand();
            result.add(super.getResizeChildrenCommand(request));
            AdjustIdentityAnchorCommand command = new AdjustIdentityAnchorCommand(TransactionUtil.getEditingDomain(resolveSemanticElement()), request);
            result.add(new ICommandProxy(command));
            return result;
        }
    });
    // Removes the collapse expand handler
    installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableEditPolicyEx());
    installEditPolicy(EditPolicyRoles.SNAP_FEEDBACK_ROLE, new SimpleSnapFeedbackPolicy());
}
Also used : ChangeBoundsRequest(org.eclipse.gef.requests.ChangeBoundsRequest) ICommandProxy(org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy) ResizableEditPolicyEx(org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableEditPolicyEx) XYLayoutEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy) AdjustIdentityAnchorCommand(org.yakindu.base.xtext.utils.gmf.commands.AdjustIdentityAnchorCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand) Command(org.eclipse.gef.commands.Command) AdjustIdentityAnchorCommand(org.yakindu.base.xtext.utils.gmf.commands.AdjustIdentityAnchorCommand) CompartmentCreationEditPolicy(org.yakindu.sct.ui.editor.policies.CompartmentCreationEditPolicy) RegionCompartmentCanonicalEditPolicy(org.yakindu.sct.ui.editor.policies.RegionCompartmentCanonicalEditPolicy) DragDropEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Aggregations

DragDropEditPolicy (org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy)3 XYLayoutEditPolicy (org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy)2 Command (org.eclipse.gef.commands.Command)1 CompoundCommand (org.eclipse.gef.commands.CompoundCommand)1 ChangeBoundsRequest (org.eclipse.gef.requests.ChangeBoundsRequest)1 ICommandProxy (org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy)1 ResizableEditPolicyEx (org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableEditPolicyEx)1 CompartmentLayoutEditPolicy (org.yakindu.base.gmf.runtime.editpolicies.CompartmentLayoutEditPolicy)1 AdjustIdentityAnchorCommand (org.yakindu.base.xtext.utils.gmf.commands.AdjustIdentityAnchorCommand)1 CompartmentCreationEditPolicy (org.yakindu.sct.ui.editor.policies.CompartmentCreationEditPolicy)1 CompositeElementCanonicalEditPolicy (org.yakindu.sct.ui.editor.policies.CompositeElementCanonicalEditPolicy)1 RegionCompartmentCanonicalEditPolicy (org.yakindu.sct.ui.editor.policies.RegionCompartmentCanonicalEditPolicy)1 StateCompartmentCanonicalEditPolicy (org.yakindu.sct.ui.editor.policies.StateCompartmentCanonicalEditPolicy)1 StateCompartmentCreationEditPolicy (org.yakindu.sct.ui.editor.policies.StateCompartmentCreationEditPolicy)1