Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » connection problem
connection problem [message #91806] Fri, 12 January 2007 04:00
Eclipse UserFriend
Originally posted by: wangdi1016.sohu.com

Hello everyone:

Now I'm in a modeling project group. My task is : first, read a xml file
which contains information about the a model, second, draw the model's view
with GMF. Now I can draw any node elements by using
CreateViewAndElementRequest method but I can't draw a connection between two
node elements. I tried to use CreateConnectionViewAndElementRequest method
but it didn't work. I note that there are 8 anchors in every node element so
I think whether I should create the connection between anchors of each node
actually? My code is list below:

.......
EObject sourceEObject =
((View)(sourceElementEditPart.getModel())).getElement();//ge t the source
node
EObject targetEObject =
((View)(targetElementEditPart.getModel())).getElement();//ge t the target
node
CreateConnectionViewAndElementRequest testReq = new
CreateConnectionViewAndElementRequest(type, ((IHintedType)
type).getSemanticHint(),
newPmbe.process.diagram.part.NewpmbeDiagramEditorPlugin.DIAG RAM_PREFERENCES_HINT);
Command testCommand =
targetDiagramEditor.getDiagramEditPart().getCommand(testReq) ;
DiagramCommandStack testCommandStack =
targetDiagramEditor.getDiagramEditDomain().getDiagramCommand Stack();
testCommandStack.execute(testCommand);
.......

Could anyone give me some advice? Thanks in advance.

Regards,
wangdi
Previous Topic:How to trac the mouse events in the digram editor.
Next Topic:Defining metamodelTypes icons with the tooling?
Goto Forum:
  


Current Time: Sun May 11 06:36:59 EDT 2025

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

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

Back to the top