Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » how to add notes when creating diagram programmatically
how to add notes when creating diagram programmatically [message #1742575] Mon, 05 September 2016 11:39
Galan Marjolaine is currently offline Galan MarjolaineFriend
Messages: 1
Registered: September 2016
Junior Member
Hello

I currently develop a plugin to Capella in order to import programmatically scenarios and create related sequence diagrams exported from an other modeling tool.

I managed to create the sequence diagrams and the related semantic elements under Capella:

//creation of the sequence diagram
DDiagram diagram = (DDiagram) DialectManager.INSTANCE.createRepresentation(DiagramDescriptionConstants.INTERFACE_SCENARIO, scenario, des, InfrastructureUtil.getSession(), new NullProgressMonitor());

However I don't know how use the Sirius/GMF APIs to add programmatically notes on these created diagrams (notes are not related to any semantic elements). I tried the following code:

Shape note = NotationFactory.eINSTANCE.createShape();
note.setType("Note");
note.setDescription("note");
for (AnnotationEntry entry : diagram.getOwnedAnnotationEntries()){
if (entry.getSource().equals("GMF_DIAGRAMS")){
Diagram data = (Diagram) entry.getData();
data.getChildren().add(note);
}

But I have the following error on the last instruction:
java.lang.UnsupportedOperationException
at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl.add(EContentsEList.java:773)
at java.util.AbstractSequentialList.add(Unknown Source)
at java.util.AbstractList.add(Unknown Source)


Thank you in advance for your precious help

Marjolaine



Previous Topic:Border Nodes can be accidentally detached from Parent
Next Topic:Custom edit parts and 'appearance' and 'style' properties
Goto Forum:
  


Current Time: Thu Mar 28 17:41:55 GMT 2024

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

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

Back to the top