Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Forcing some mappings to anchor on the diagrams' edge
Forcing some mappings to anchor on the diagrams' edge [message #1841289] Tue, 11 May 2021 08:17 Go to next message
Francesco Bedini is currently offline Francesco BediniFriend
Messages: 32
Registered: March 2018
Member
Hi, is there a way to update the position of some mappings so that they always stick to the edge of the diagram (at least at the top and on the left).

Stuff like: my diagram shows an activity (without the activity container), and the activity parameter nodes should be shown on the edge of the diagram.

[Updated on: Tue, 11 May 2021 08:18]

Report message to a moderator

Re: Forcing some mappings to anchor on the diagrams' edge [message #1841533 is a reply to message #1841289] Thu, 20 May 2021 08:27 Go to previous message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 182
Registered: October 2014
Senior Member
Hello
You have the ability to define the position of the nodes at the node's creation. You just have to call a java service (from a ChangeContext operation for example) to do the job (aql:self.myservice())
Here are some tips to help you write the java code https://wiki.eclipse.org/Sirius/Cookbook#Set_Coordinates.2FPosition_at_node_creation_using_a_Node_Creation_Tool

Note that it does not prevent the user to move the node afterward.

If you want to prevent the move of the node after it has been created you will have to do much more complicated work.
You will need to provide your own IGraphicalEditPart and your own EditPolicy for this node. To do that, provide a org.eclipse.gmf.runtime.diagram.ui.services.editpart.AbstractEditPartProvider
As an example, you may install interaction [1] meta-model to have a sequence diagram in Sirius.
The lifeline can not be dragged downward. To see what has been done take a look to org.eclipse.sirius.diagram.sequence.ui.tool.internal.edit.part.InstanceRoleEditPart
org.eclipse.sirius.diagram.sequence.ui.tool.internal.provider.SequenceDiagramEditPartProvider is the provider of this EditPart.

[1] https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/tree/plugins/org.eclipse.sirius.sample.interactions

Best Regards
Laurent


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:How to access operations defined in a class of my metamodel when in a sirius instance
Next Topic:Fixing the Tree View window
Goto Forum:
  


Current Time: Fri Apr 26 15:43:05 GMT 2024

Powered by FUDForum. Page generated in 0.04031 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top