| Notation Elements on Diagram Initalization [message #901052] |
Thu, 09 August 2012 10:27  |
Sarath Rachakonda Messages: 15 Registered: May 2012 |
Junior Member |
|
|
Hi,
Iam trying to add some elements when diagram is created. But those elements are not added/shown in the diagram. Actually elements are getting added to model but not to the notation.
In XXXDiagramUtil class, in createDiagram method iam creating new nodes to the diagram using ViewService.createNode(diagram, element,...
Elements are added to model but not to the notation. How to add notation elements whendiagram is created
Thanks,
Sarath
|
|
|
|
| Re: Notation Elements on Diagram Initalization [message #902339 is a reply to message #901168] |
Fri, 17 August 2012 03:40  |
Sarath Rachakonda Messages: 15 Registered: May 2012 |
Junior Member |
|
|
Hi,
There was problem in my model,graph that is why ViewService.createNode is not generating notation element. After fixing errors in my model,graph,map and regenerating code....it started working....ViewService.createNode is creating node/view and diagram is shown with default elements....
model = createInitialModel();
attachModelToResource(model, diagramResource);
CustomElement element ......
model.getElements().add(element);
Diagram diagram = ViewService.createDiagram(model,
XXXX.MODEL_ID,
XXXXX.DIAGRAM_PREFERENCES_HINT);
Node elementNode = ViewService.createNode(diagram, element,
XXXXX.getType(XXXXX.VISUAL_ID),
XXXX.DIAGRAM_PREFERENCES_HINT);
Bounds bounds = NotationFactory.eINSTANCE.createBounds();
bounds.setX(10);
bounds.setY(20);
elementNode.setLayoutConstraint(bounds);
Thanks,
Sarath
|
|
|
Powered by
FUDForum. Page generated in 0.06290 seconds