Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Notation Elements on Diagram Initalization
Notation Elements on Diagram Initalization [message #901052] Thu, 09 August 2012 14:27 Go to next message
Sarath Rachakonda is currently offline Sarath Rachakonda
Messages: 16
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 #901168 is a reply to message #901052] Fri, 10 August 2012 08:06 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

did you try out this request: http://publib.boulder.ibm.com/infocenter/rsmhelp/v7r0m0/index.jsp?topic=/org.eclipse.gmf.doc/reference/api/runtime/org/eclipse/gmf/runtime/diagram/ui/requests/CreateUnspecifiedTypeRequest.html ? It executes the same code that is executed when creating a model element via the palette.

Ralph


Re: Notation Elements on Diagram Initalization [message #902339 is a reply to message #901168] Fri, 17 August 2012 07:40 Go to previous message
Sarath Rachakonda is currently offline Sarath Rachakonda
Messages: 16
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
Previous Topic:problem in creating a new editor in Eclipse Application
Next Topic:Containment Feature owned by Domain Meta Element
Goto Forum:
  


Current Time: Thu Sep 18 18:07:04 GMT 2014

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

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