Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsError when adding figure to container
https://www.eclipse.org/forums/index.php/mv/msg/482931/1049392/#msg_1049392
I am new to GEF. I try to create a custom figure that will contain other figures. My resource is the topic "Display a UML Diagram using Draw2D" (http://www.eclipse.org/articles/Article-GEF-Draw2d/GEF-Draw2d.html).
I have taken the tutorial one step ahead and i have created an mvc model (I added edit parts, policies and commands). The problem is that when i add to the containing figure more than 3 elements i get the error below.
Any help is appreciated.
java.lang.IndexOutOfBoundsException: Index does not exist
at org.eclipse.draw2d.Figure.add(Figure.java:139)
at org.eclipse.draw2d.Figure.add(Figure.java:184)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addChildVisual(AbstractGraphicalEditPart.java:209)]]>Dimitris Kost2013-04-25T19:52:31-00:00Re: Error when adding figure to container
https://www.eclipse.org/forums/index.php/mv/msg/482931/1052528/#msg_1052528
from the source code you can see
if (index < -1 || index > children.size())
throw new IndexOutOfBoundsException("Index does not exist");
so the child is added with bad index, you have do debug it man.]]>Jan Krakora2013-04-30T07:50:17-00:00