- Posts: 16
- Thank you received: 0
×
Modelio 4.0.0 released (07 Nov 2019)
Modelio 4.0.0 has been released ( www.modelio.org/forum/4-announcements/45...-4-0-0-released.html )
[Solved] Unmask in a Sequence Diagram
4 years 7 months ago - 4 years 7 months ago #4865 by Iorek
Hi everybody,
When in my Jython script I try to unmask two or more lifelines in a sequence diagram, like this:
The lifelines are represented superimposed in the high left corner of the diagram, as if the x,y parameters were not taken into account.
The diagram is OK, however, and it is possible to drag them manually at the right place.
The Sequence Diagram is stereotyped as a SysMLSequenceDiagram. The same code as above works well with e.g. classes in a Class diagram.
Am I missing something?
Thanks,
Francesco
When in my Jython script I try to unmask two or more lifelines in a sequence diagram, like this:
...
seqDiagHandle = diagService.getDiagramHandle(seqDiag)
...
...
seqDiagHandle.unmask(lifeLine1, 0,0)
seqDiagHandle.unmask(lifeLine2, 500,100)
...
The lifelines are represented superimposed in the high left corner of the diagram, as if the x,y parameters were not taken into account.
The diagram is OK, however, and it is possible to drag them manually at the right place.
The Sequence Diagram is stereotyped as a SysMLSequenceDiagram. The same code as above works well with e.g. classes in a Class diagram.
Am I missing something?
Thanks,
Francesco
Last Edit: 4 years 7 months ago by ebr.
Please Log in or Create an account to join the conversation.
4 years 7 months ago #4867 by ebr
Dear Franscesco,
The mecanisms are not the same between Sequence Diagram and the other mainly because you can not unmask sequence diagram anywhere...
Please check the following code for your lifeLine unmasking
Hoping it helps.
EBR
The mecanisms are not the same between Sequence Diagram and the other mainly because you can not unmask sequence diagram anywhere...
Please check the following code for your lifeLine unmasking
from org.eclipse.draw2d.geometry import Rectangle
interaction = session.getModel().createInteraction()
interaction.setOwner(elt)
diagram = session.getModel().createSequenceDiagram()
diagram.setOrigin(interaction)
lifeLine1 = session.getModel().createLifeline()
lifeLine1.setOwner(interaction)
lifeLine2 = session.getModel().createLifeline()
lifeLine2.setOwner(interaction)
diagService = Modelio.getInstance().getDiagramService()
try :
seqDiagHandle = diagService.getDiagramHandle(diagram)
dgs = seqDiagHandle.getDiagramGraphics(lifeLine2)
for dg2 in dgs:
if isinstance(dg2,IDiagramNode):
rect = Rectangle(300, 0, 300, 250);
dg2.setBounds(rect);
seqDiagHandle.save()
finally :
if seqDiagHandle :
seqDiagHandle.close()
seqDiagHandle = None
Modelio.getInstance().getEditionService().openEditor(diagram)
Hoping it helps.
EBR
Please Log in or Create an account to join the conversation.
4 years 7 months ago #4868 by Iorek
Thank you so much, ebr.
I included in my script the relevant lines from your example and now it works perfectly!
Thanks again,
Francesco
I included in my script the relevant lines from your example and now it works perfectly!
Thanks again,
Francesco
Please Log in or Create an account to join the conversation.
Time to create page: 0.037 seconds