Search in sources :

Example 1 with SketchDNDEditPolicy

use of com.archimatetool.editor.diagram.sketch.policies.SketchDNDEditPolicy in project archi by archimatetool.

the class StickyEditPart method createEditPolicies.

@Override
protected void createEditPolicies() {
    // Allow parts to be joined together
    installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new SketchConnectionPolicy());
    // Add a policy to handle directly editing the Part
    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new StickyDirectEditTitlePolicy());
    // Add a policy to handle deletion and orphaning
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new PartComponentEditPolicy());
    // Add a DND Policy
    // $NON-NLS-1$
    installEditPolicy("DND", new SketchDNDEditPolicy());
    // Install a custom layout policy that handles dragging things around and creating new objects
    installEditPolicy(EditPolicy.LAYOUT_ROLE, new DiagramLayoutPolicy());
    // Orphaning
    installEditPolicy(EditPolicy.CONTAINER_ROLE, new BasicContainerEditPolicy());
    // Snap to Geometry feedback
    // $NON-NLS-1$
    installEditPolicy("Snap Feedback", new SnapFeedbackPolicy());
    // Selection Feedback
    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ContainerHighlightEditPolicy());
}
Also used : ContainerHighlightEditPolicy(com.archimatetool.editor.diagram.policies.ContainerHighlightEditPolicy) SketchDNDEditPolicy(com.archimatetool.editor.diagram.sketch.policies.SketchDNDEditPolicy) SketchConnectionPolicy(com.archimatetool.editor.diagram.sketch.policies.SketchConnectionPolicy) PartComponentEditPolicy(com.archimatetool.editor.diagram.policies.PartComponentEditPolicy) DiagramLayoutPolicy(com.archimatetool.editor.diagram.policies.DiagramLayoutPolicy) BasicContainerEditPolicy(com.archimatetool.editor.diagram.policies.BasicContainerEditPolicy) SnapFeedbackPolicy(org.eclipse.gef.editpolicies.SnapFeedbackPolicy)

Example 2 with SketchDNDEditPolicy

use of com.archimatetool.editor.diagram.sketch.policies.SketchDNDEditPolicy in project archi by archimatetool.

the class SketchDiagramPart method createEditPolicies.

@Override
protected void createEditPolicies() {
    // Install a custom layout policy that handles dragging things around
    installEditPolicy(EditPolicy.LAYOUT_ROLE, new DiagramLayoutPolicy());
    // Install a policy for DND support
    // $NON-NLS-1$
    installEditPolicy("DND", new SketchDNDEditPolicy());
    // And we need to install this Group Container Policy here as well as in the GroupEditpart
    installEditPolicy(EditPolicy.CONTAINER_ROLE, new BasicContainerEditPolicy());
    // Snap to Geometry feedback
    // $NON-NLS-1$
    installEditPolicy("Snap Feedback", new SnapFeedbackPolicy());
}
Also used : SketchDNDEditPolicy(com.archimatetool.editor.diagram.sketch.policies.SketchDNDEditPolicy) DiagramLayoutPolicy(com.archimatetool.editor.diagram.policies.DiagramLayoutPolicy) BasicContainerEditPolicy(com.archimatetool.editor.diagram.policies.BasicContainerEditPolicy) SnapFeedbackPolicy(org.eclipse.gef.editpolicies.SnapFeedbackPolicy)

Example 3 with SketchDNDEditPolicy

use of com.archimatetool.editor.diagram.sketch.policies.SketchDNDEditPolicy in project archi by archimatetool.

the class SketchGroupEditPart method createEditPolicies.

@Override
protected void createEditPolicies() {
    super.createEditPolicies();
    // Install our own connection policy
    installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new SketchConnectionPolicy());
    // Install our own DND policy
    // $NON-NLS-1$
    installEditPolicy("DND", new SketchDNDEditPolicy());
}
Also used : SketchDNDEditPolicy(com.archimatetool.editor.diagram.sketch.policies.SketchDNDEditPolicy) SketchConnectionPolicy(com.archimatetool.editor.diagram.sketch.policies.SketchConnectionPolicy)

Aggregations

SketchDNDEditPolicy (com.archimatetool.editor.diagram.sketch.policies.SketchDNDEditPolicy)3 BasicContainerEditPolicy (com.archimatetool.editor.diagram.policies.BasicContainerEditPolicy)2 DiagramLayoutPolicy (com.archimatetool.editor.diagram.policies.DiagramLayoutPolicy)2 SketchConnectionPolicy (com.archimatetool.editor.diagram.sketch.policies.SketchConnectionPolicy)2 SnapFeedbackPolicy (org.eclipse.gef.editpolicies.SnapFeedbackPolicy)2 ContainerHighlightEditPolicy (com.archimatetool.editor.diagram.policies.ContainerHighlightEditPolicy)1 PartComponentEditPolicy (com.archimatetool.editor.diagram.policies.PartComponentEditPolicy)1