Search in sources :

Example 6 with PartComponentEditPolicy

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

the class SketchActorEditPart method createEditPolicies.

@Override
protected void createEditPolicies() {
    // Allow parts to be connected together
    installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new SketchConnectionPolicy());
    // Add a policy to handle directly editing the Part
    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 : PartDirectEditTitlePolicy(com.archimatetool.editor.diagram.policies.PartDirectEditTitlePolicy) SketchConnectionPolicy(com.archimatetool.editor.diagram.sketch.policies.SketchConnectionPolicy) PartComponentEditPolicy(com.archimatetool.editor.diagram.policies.PartComponentEditPolicy)

Example 7 with PartComponentEditPolicy

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

the class SketchDiagramModelReferenceEditPart method createEditPolicies.

@Override
protected void createEditPolicies() {
    // Allow parts to be connected
    installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new SketchConnectionPolicy());
    // 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 : PartDirectEditTitlePolicy(com.archimatetool.editor.diagram.policies.PartDirectEditTitlePolicy) SketchConnectionPolicy(com.archimatetool.editor.diagram.sketch.policies.SketchConnectionPolicy) PartComponentEditPolicy(com.archimatetool.editor.diagram.policies.PartComponentEditPolicy)

Example 8 with PartComponentEditPolicy

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

the class ArchimateElementEditPart method createEditPolicies.

@Override
protected void createEditPolicies() {
    super.createEditPolicies();
    // Add a policy to handle directly editing the Parts (for example, directly renaming a part)
    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new PartDirectEditTitlePolicy());
    // Add a policy to handle deletion and orphaning
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new PartComponentEditPolicy());
    // Add a policy for Native DND
    // $NON-NLS-1$
    installEditPolicy("DND", new ArchimateDNDEditPolicy());
    // Install a custom layout policy that handles dragging things around and creating new objects
    installEditPolicy(EditPolicy.LAYOUT_ROLE, new ArchimateContainerLayoutPolicy());
    // Orphaning
    installEditPolicy(EditPolicy.CONTAINER_ROLE, new ArchimateContainerEditPolicy());
    // Snap to Geometry feedback
    // $NON-NLS-1$
    installEditPolicy("Snap Feedback", new SnapFeedbackPolicy());
    // Selection Feedback
    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ContainerHighlightEditPolicy());
}
Also used : ArchimateDNDEditPolicy(com.archimatetool.editor.diagram.policies.ArchimateDNDEditPolicy) ArchimateContainerLayoutPolicy(com.archimatetool.editor.diagram.policies.ArchimateContainerLayoutPolicy) ContainerHighlightEditPolicy(com.archimatetool.editor.diagram.policies.ContainerHighlightEditPolicy) PartDirectEditTitlePolicy(com.archimatetool.editor.diagram.policies.PartDirectEditTitlePolicy) PartComponentEditPolicy(com.archimatetool.editor.diagram.policies.PartComponentEditPolicy) SnapFeedbackPolicy(org.eclipse.gef.editpolicies.SnapFeedbackPolicy) ArchimateContainerEditPolicy(com.archimatetool.editor.diagram.policies.ArchimateContainerEditPolicy)

Example 9 with PartComponentEditPolicy

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

the class DiagramModelReferenceEditPart method createEditPolicies.

@Override
protected void createEditPolicies() {
    // Allow parts to be connected
    installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ArchimateDiagramConnectionPolicy());
    // 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 : ArchimateDiagramConnectionPolicy(com.archimatetool.editor.diagram.policies.ArchimateDiagramConnectionPolicy) PartDirectEditTitlePolicy(com.archimatetool.editor.diagram.policies.PartDirectEditTitlePolicy) PartComponentEditPolicy(com.archimatetool.editor.diagram.policies.PartComponentEditPolicy)

Example 10 with PartComponentEditPolicy

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

the class NoteEditPart method createEditPolicies.

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

Aggregations

PartComponentEditPolicy (com.archimatetool.editor.diagram.policies.PartComponentEditPolicy)12 PartDirectEditTitlePolicy (com.archimatetool.editor.diagram.policies.PartDirectEditTitlePolicy)6 ContainerHighlightEditPolicy (com.archimatetool.editor.diagram.policies.ContainerHighlightEditPolicy)4 SnapFeedbackPolicy (org.eclipse.gef.editpolicies.SnapFeedbackPolicy)4 CanvasConnectionPolicy (com.archimatetool.canvas.policies.CanvasConnectionPolicy)3 ArchimateDiagramConnectionPolicy (com.archimatetool.editor.diagram.policies.ArchimateDiagramConnectionPolicy)3 BasicContainerEditPolicy (com.archimatetool.editor.diagram.policies.BasicContainerEditPolicy)3 SketchConnectionPolicy (com.archimatetool.editor.diagram.sketch.policies.SketchConnectionPolicy)3 ArchimateDNDEditPolicy (com.archimatetool.editor.diagram.policies.ArchimateDNDEditPolicy)2 CanvasDNDEditPolicy (com.archimatetool.canvas.policies.CanvasDNDEditPolicy)1 ArchimateContainerEditPolicy (com.archimatetool.editor.diagram.policies.ArchimateContainerEditPolicy)1 ArchimateContainerLayoutPolicy (com.archimatetool.editor.diagram.policies.ArchimateContainerLayoutPolicy)1 ArchimateDiagramLayoutPolicy (com.archimatetool.editor.diagram.policies.ArchimateDiagramLayoutPolicy)1 BasicConnectionPolicy (com.archimatetool.editor.diagram.policies.BasicConnectionPolicy)1 DiagramLayoutPolicy (com.archimatetool.editor.diagram.policies.DiagramLayoutPolicy)1 SketchDNDEditPolicy (com.archimatetool.editor.diagram.sketch.policies.SketchDNDEditPolicy)1