Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » how get connection from editparts?
how get connection from editparts? [message #210069] Fri, 31 October 2008 07:15 Go to next message
Eclipse UserFriend
Originally posted by: andrew.iaes.ru

Hi!
I get EditParts from
IStructuredSelection structuredSelection =
(IStructuredSelection) selection;
if (structuredSelection.getFirstElement() instanceof
GraphicalEditPart) {
GraphicalEditPart mySelectedElement = (GraphicalEditPart)
structuredSelection.getFirstElement();
this.view = mySelectedElement.getNotationView();
}

I get Diagram, Nodes & Edges from View
Diagram myDiagram = view.getDiagram();
List<Edge> edgeList = myDiagram.getEdges();
List<Node> nodeList = myDiagram.getChildren();

How I get Connection ?

Thanks!
Andrei.
Re: how get connection from editparts? [message #210085 is a reply to message #210069] Fri, 31 October 2008 08:31 Go to previous message
Jacques LESCOT is currently offline Jacques LESCOTFriend
Messages: 247
Registered: July 2009
Senior Member
On GraphicalEditPart, you can use getSourceConnections() and
getTargetConnections() to retrieve incoming or outgoing connections.

Andrei a écrit :
> Hi!
> I get EditParts from
> IStructuredSelection structuredSelection = (IStructuredSelection)
> selection;
> if (structuredSelection.getFirstElement() instanceof
> GraphicalEditPart) {
> GraphicalEditPart mySelectedElement =
> (GraphicalEditPart) structuredSelection.getFirstElement();
> this.view = mySelectedElement.getNotationView();
> }
>
> I get Diagram, Nodes & Edges from View
> Diagram myDiagram = view.getDiagram();
> List<Edge> edgeList = myDiagram.getEdges();
> List<Node> nodeList = myDiagram.getChildren();
>
> How I get Connection ?
>
> Thanks!
> Andrei.
Previous Topic:How to validate my diagrams without opening the diagram editor and saving...
Next Topic:Why a popmenu appear?
Goto Forum:
  


Current Time: Thu May 13 23:14:42 GMT 2021

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

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

Back to the top