Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Moving Index locations of Connections in a diagram
Moving Index locations of Connections in a diagram [message #127094] Thu, 17 May 2007 07:34
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Hi,

Has anyone moved index locations of connection up and down by 1 say.

It mater to my end generation what order connections are in so I was going
to give the user the oportunity to move an item up and down in a collection.

I have tried the follow at model level but it corrupts the diagram (so I
assume the diagram using index location and not a element reference at some
oint).

Code snips of attempted move:-
int currentIndex =
aDecisionConnectionImpl.getFromNode().getWhereNextConnection s().indexOf(aDecisionConnectionImpl);
if (currentIndex>0) {
aDecisionConnectionImpl.getFromNode().getWhereNextConnection s().remove(currentIndex); aDecisionConnectionImpl.getFromNode().getWhereNextConnection s().add(currentIndex-1, aDecisionConnectionImpl);}I also tried using the move method (but Im not sure it shifts right currentelement in that positon).int currentIndex =aDecisionConnectionImpl.getFromNode().getWhereNextConnectio ns().indexOf(aDecisionConnectionImpl);if (currentIndex>0) { aDecisionConnectionImpl.getFromNode().getWhereNextConnection s().move(currentIndex-1, aDecisionConnectionImpl);}Thanks for any help in advance,Stu
Previous Topic:Opening a diagram through context menu
Next Topic:Connections graphical behavior
Goto Forum:
  


Current Time: Thu Jul 17 21:38:29 EDT 2025

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

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

Back to the top