Search in sources :

Example 1 with CanvasDNDEditPolicy

use of com.archimatetool.canvas.policies.CanvasDNDEditPolicy in project archi by archimatetool.

the class CanvasBlockEditPart method createEditPolicies.

@Override
protected void createEditPolicies() {
    // Allow parts to be joined together
    installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CanvasConnectionPolicy());
    // Add a policy to handle deletion and orphaning
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new PartComponentEditPolicy());
    // Install a policy for DND support
    // $NON-NLS-1$
    installEditPolicy("DND", new CanvasDNDEditPolicy());
    // Add these
    updateEditPolicies();
    // 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 : CanvasConnectionPolicy(com.archimatetool.canvas.policies.CanvasConnectionPolicy) ContainerHighlightEditPolicy(com.archimatetool.editor.diagram.policies.ContainerHighlightEditPolicy) PartComponentEditPolicy(com.archimatetool.editor.diagram.policies.PartComponentEditPolicy) CanvasDNDEditPolicy(com.archimatetool.canvas.policies.CanvasDNDEditPolicy) BasicContainerEditPolicy(com.archimatetool.editor.diagram.policies.BasicContainerEditPolicy) SnapFeedbackPolicy(org.eclipse.gef.editpolicies.SnapFeedbackPolicy)

Example 2 with CanvasDNDEditPolicy

use of com.archimatetool.canvas.policies.CanvasDNDEditPolicy in project archi by archimatetool.

the class CanvasDiagramPart method createEditPolicies.

@Override
protected void createEditPolicies() {
    updateEditPolicies();
    // Install a policy for DND support
    // $NON-NLS-1$
    installEditPolicy("DND", new CanvasDNDEditPolicy());
    // 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 : CanvasDNDEditPolicy(com.archimatetool.canvas.policies.CanvasDNDEditPolicy) BasicContainerEditPolicy(com.archimatetool.editor.diagram.policies.BasicContainerEditPolicy) SnapFeedbackPolicy(org.eclipse.gef.editpolicies.SnapFeedbackPolicy)

Aggregations

CanvasDNDEditPolicy (com.archimatetool.canvas.policies.CanvasDNDEditPolicy)2 BasicContainerEditPolicy (com.archimatetool.editor.diagram.policies.BasicContainerEditPolicy)2 SnapFeedbackPolicy (org.eclipse.gef.editpolicies.SnapFeedbackPolicy)2 CanvasConnectionPolicy (com.archimatetool.canvas.policies.CanvasConnectionPolicy)1 ContainerHighlightEditPolicy (com.archimatetool.editor.diagram.policies.ContainerHighlightEditPolicy)1 PartComponentEditPolicy (com.archimatetool.editor.diagram.policies.PartComponentEditPolicy)1