connection problem [message #91806] |
Fri, 12 January 2007 04:00 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03489 seconds