Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » EdgeEditParts and NodeEditParts
EdgeEditParts and NodeEditParts [message #144592] Sat, 28 July 2007 09:31 Go to next message
Eclipse UserFriend
Hello,

i have a graphical viewer with my gmf model in it. Now i want to get all
Editparts. I have this code:

Vector edit = new Vector();
for (int i=0;i<viewer.getFocusEditPart().getChildren().size();i++) {
edit.add(viewer.getFocusEditPart().getChildren().get(i));
}

But with this code i get only the editparts for the nodes. How can i get
the editparts from the edges?

Thanks
Re: EdgeEditParts and NodeEditParts [message #144635 is a reply to message #144592] Sun, 29 July 2007 01:34 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Your editor class with GMF is most likely DiagramEditor or a class that
implements IDiagramWorkbenchPart. From IDiagramWorkbenchPart you can get
DiagramEditPart with method IDiagramWorkbenchPart#getDiagramEditPart().
From the DiagramEditPart you just call DiagramEditPart#getConnections()
and it will return you all connection editparts on the diagram.
In any case, you can just take a look at the implementation of
DiagramEditPart#getConnections() and using the map of model elements to
editparts assemble the list of connection editparts for yourself.
Hope this helps.

Cheers,
Alex
Re: EdgeEditParts and NodeEditParts [message #144866 is a reply to message #144635] Mon, 30 July 2007 17:05 Go to previous message
Eclipse UserFriend
Thanks, it helped me a lot.

Alex Boyko schrieb:
> Hi,
>
> Your editor class with GMF is most likely DiagramEditor or a class that
> implements IDiagramWorkbenchPart. From IDiagramWorkbenchPart you can get
> DiagramEditPart with method IDiagramWorkbenchPart#getDiagramEditPart().
> From the DiagramEditPart you just call DiagramEditPart#getConnections()
> and it will return you all connection editparts on the diagram.
> In any case, you can just take a look at the implementation of
> DiagramEditPart#getConnections() and using the map of model elements to
> editparts assemble the list of connection editparts for yourself.
> Hope this helps.
>
> Cheers,
> Alex
>
Previous Topic:Problems with generating diagram code with GMF 2.0
Next Topic:Load and open a diagram editor from the xml file
Goto Forum:
  


Current Time: Wed Jun 18 19:11:26 EDT 2025

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

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

Back to the top