Moving Index locations of Connections in a diagram [message #127094] |
Thu, 17 May 2007 07:34 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.06817 seconds