Search in sources :

Example 1 with CanvasConnectionPolicy

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

the class CanvasDiagramModelReferenceEditPart method createEditPolicies.

@Override
protected void createEditPolicies() {
    // Allow parts to be connected
    installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CanvasConnectionPolicy());
    // Add a policy to handle directly editing the name
    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new PartDirectEditTitlePolicy());
    // Add a policy to handle editing the Parts (for example, deleting a part)
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new PartComponentEditPolicy());
}
Also used : CanvasConnectionPolicy(com.archimatetool.canvas.policies.CanvasConnectionPolicy) PartDirectEditTitlePolicy(com.archimatetool.editor.diagram.policies.PartDirectEditTitlePolicy) PartComponentEditPolicy(com.archimatetool.editor.diagram.policies.PartComponentEditPolicy)

Example 2 with CanvasConnectionPolicy

use of com.archimatetool.canvas.policies.CanvasConnectionPolicy 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 3 with CanvasConnectionPolicy

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

the class CanvasStickyEditPart method createEditPolicies.

@Override
protected void createEditPolicies() {
    // Allow parts to be joined together
    installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CanvasConnectionPolicy());
    // Add a policy to handle editing the Parts (for example, deleting a part)
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new PartComponentEditPolicy());
    updateEditPolicies();
}
Also used : CanvasConnectionPolicy(com.archimatetool.canvas.policies.CanvasConnectionPolicy) PartComponentEditPolicy(com.archimatetool.editor.diagram.policies.PartComponentEditPolicy)

Aggregations

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