Skip to main content



      Home
Home » Eclipse Projects » GEF » Problems with Figure.add(figure:IFigure, constraint:Object, index:int):void method
Problems with Figure.add(figure:IFigure, constraint:Object, index:int):void method [message #49744] Mon, 16 December 2002 09:21 Go to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_0008_01C2A516.DB604C20
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

java.lang.IndexOutOfBoundsException: IWAG0001E Figure.add(...) invalid =
index
at org.eclipse.draw2d.Figure.add(Figure.java:97)
at org.eclipse.draw2d.FreeformLayer.add(FreeformLayer.java:21)
at =
com.togethersoft.selena2.emf.gef.figures.DiagramFigure.add(D iagramFigure.=
java:53)
at org.eclipse.draw2d.Figure.add(Figure.java:143)
at =
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addChild Visual(Abstra=
ctGraphicalEditPart.java:195)
at =
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java=
:197)
at =
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPa=
rt.java:765)
at =
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:=
717)
at =
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraph=
icalEditPart.java:534)
at =
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart.handleD=
iagramNotification(DiagramElementEditPart.java:108)
at =
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart$Diagram=
ModelListener.notifyChanged(DiagramElementEditPart.java:154)
at =
org.eclipse.emf.common.notify.impl.NotifierImpl.eNotify(Noti fierImpl.java=
:166)
at =
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:115)
at =
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:103)
at =
com.togethersoft.uml14.ui.metamodel.unified_diagrams.concret esyntaxfounda=
tion.diagramfoundation.diagramcore.impl.DiagramElementImpl.s etContainer(D=
iagramElementImpl.java:513)at =
com.togethersoft.selena2.emf.ui.commands.impl.CreateClassPre sentationComm=
and.execute(CreateClassPresentationCommand.java:85)

at =
com.togethersoft.selena2.emf.gef.commands.ImportModelElement Command.execu=
te(ImportModelElementCommand.java:97)

at =
org.eclipse.gef.commands.DefaultCommandStack.execute(Default CommandStack.=
java:67)

at =
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(Abs tractTool.jav=
a:303)

at =
org.eclipse.gef.tools.CreationTool.performCreation(CreationT ool.java:103)=


at =
org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTo ol.java:71)

at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java :739)

at org.eclipse.gef.DefaultEditDomain.mouseUp(DefaultEditDomain. java:235)

at =
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Released(Doma=
inEventDispatcher.java:245)

at =
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(Li ghtweightSyst=
em.java:427)

at =
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:130)=


at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:827)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1529)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1291)

at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1256)

at org.eclipse.ui.internal.Workbench.run(Workbench.java:1239)

at =
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.=
java:775)

at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432)

at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)

------=_NextPart_000_0008_01C2A516.DB604C20
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-2">
<META content=3D"MSHTML 6.00.2800.1126" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>
<P><FONT face=3DArial size=3D2>java.lang.IndexOutOfBoundsException: =
IWAG0001E=20
Figure.add(...) invalid index<BR>&nbsp;&nbsp;&nbsp; </FONT><FONT =
face=3DArial=20
size=3D2>at =
org.eclipse.draw2d.Figure.add(Figure.java:97)<BR>&nbsp;&nbsp;&nbsp;=20
</FONT><FONT face=3DArial size=3D2>at=20
org.eclipse.draw2d.FreeformLayer.add(FreeformLayer.java:21)<BR >&nbsp;&nbs=
p;&nbsp;=20
</FONT><FONT face=3DArial size=3D2>at=20
com.togethersoft.selena2.emf.gef.figures.DiagramFigure.add(D iagramFigure.=
java:53)<BR>&nbsp;&nbsp;&nbsp;=20
</FONT><FONT face=3DArial size=3D2>at=20
org.eclipse.draw2d.Figure.add(Figure.java:143)<BR>&nbsp;&nbsp;&nbsp;=20
</FONT><FONT face=3DArial size=3D2>at=20
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addChild Visual(Abstra=
ctGraphicalEditPart.java:195)<BR>&nbsp;&nbsp;&nbsp;=20
</FONT><FONT face=3DArial size=3D2>at=20
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java=
:197)<BR>&nbsp;&nbsp;&nbsp;=20
</FONT><FONT face=3DArial size=3D2>at=20
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPa=
rt.java:765)<BR>&nbsp;&nbsp;&nbsp;=20
</FONT><FONT face=3DArial size=3D2>at=20
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:=
717)<BR>&nbsp;&nbsp;&nbsp;=20
</FONT><FONT face=3DArial size=3D2>at=20
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraph=
icalEditPart.java:534)<BR></FONT><FONT=20
face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart.handleD=
iagramNotification(DiagramElementEditPart.java:108)<BR>&nbsp;&nbsp;&nbsp;=
=20
</FONT><FONT face=3DArial size=3D2>at=20
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart$Diagram=
ModelListener.notifyChanged(DiagramElementEditPart.java:154) <BR>&nbsp;&nb=
sp;&nbsp;=20
</FONT><FONT face=3DArial size=3D2>at=20
org.eclipse.emf.common.notify.impl.NotifierImpl.eNotify(Noti fierImpl.java=
:166)<BR>&nbsp;&nbsp;&nbsp;=20
</FONT><FONT face=3DArial size=3D2>at=20
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:115)<BR>&nbsp;&nbsp;&nbsp;=20
</FONT><FONT face=3DArial size=3D2>at=20
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:103)<BR></FONT><FONT=20
face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
com.togethersoft.uml14.ui.metamodel.unified_diagrams.concret esyntaxfounda=
tion.diagramfoundation.diagramcore.impl.DiagramElementImpl.s etContainer(D=
iagramElementImpl.java:513)</FONT><FONT=20
face=3DArial size=3D2>at=20
com.togethersoft.selena2.emf.ui.commands.impl.CreateClassPre sentationComm=
and.execute(CreateClassPresentationCommand.java:85)</FONT></P >
<P><FONT face=3DArial size=3D2>at=20
com.togethersoft.selena2.emf.gef.commands.ImportModelElement Command.execu=
te(ImportModelElementCommand.java:97)</FONT></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.gef.commands.DefaultCommandStack.execute(Default CommandStack.=
java:67)</FONT></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(Abs tractTool.jav=
a:303)</FONT></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.gef.tools.CreationTool.performCreation(CreationT ool.java:103)=
</FONT></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTo ol.java:71) </=
FONT></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java :739) </FONT><=
/P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.gef.DefaultEditDomain.mouseUp(DefaultEditDomain. java:235) </FO=
NT></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Released(Doma=
inEventDispatcher.java:245)</FONT></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(Li ghtweightSyst=
em.java:427)</FONT></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:130)=
</FONT></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77) </FONT></=
P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:827)</FONT ></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1529) </FON=
T></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1291) </FONT>=
</P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1256) </FONT=
></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.ui.internal.Workbench.run(Workbench.java:1239)</FONT ></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.=
java:775)</FONT></P>
<P><FONT face=3DArial size=3D2>at=20
org.eclipse.core.boot.BootLoader.run(BootLoader.java:432)</FONT ></P>
<P><FONT face=3DArial size=3D2>at=20
EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)</FONT ></P></D=
IV></BODY></HTML>

------=_NextPart_000_0008_01C2A516.DB604C20--
Re: Problems with Figure.add(figure:IFigure, constraint:Object, index:int):void method [message #49835 is a reply to message #49744] Mon, 16 December 2002 09:41 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_0018_01C2A519.982F0920
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

I am sorry it was bug (Ctrl+Enter instead of Shift+Enter)

So, I have problems with method add in Figure class.
If user adds nodes than everything works well. But when user adds =
connection between two nodes than another additions are impossible. It =
throws following exception.

I have build 20021212 in use. When I was using build 20020812 everything =
was OK.
Do you think it is right to throw IndexOutOfBoundsException in the add =
method. I think that it is better to make list of Figures larger and add =
figure into it's position.

I am sorry for my bugged contribution and thank you for your's oppinions =
and ideas.

java.lang.IndexOutOfBoundsException: IWAG0001E Figure.add(...) invalid =
index
at org.eclipse.draw2d.Figure.add(Figure.java:97)
at org.eclipse.draw2d.FreeformLayer.add(FreeformLayer.java:21)
at =
com.togethersoft.selena2.emf.gef.figures.DiagramFigure.add(D iagramFigure.=
java:53)
at org.eclipse.draw2d.Figure.add(Figure.java:143)
at =
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addChild Visual(Abstra=
ctGraphicalEditPart.java:195)
at =
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java=
:197)
at =
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPa=
rt.java:765)
at =
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:=
717)
at =
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraph=
icalEditPart.java:534)
at =
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart.handleD=
iagramNotification(DiagramElementEditPart.java:108)
at =
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart$Diagram=
ModelListener.notifyChanged(DiagramElementEditPart.java:154)
at =
org.eclipse.emf.common.notify.impl.NotifierImpl.eNotify(Noti fierImpl.java=
:166)
at =
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:115)
at =
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:103)
at =
com.togethersoft.uml14.ui.metamodel.unified_diagrams.concret esyntaxfounda=
tion.diagramfoundation.diagramcore.impl.DiagramElementImpl.s etContainer(D=
iagramElementImpl.java:513)
at =
com.togethersoft.selena2.emf.ui.commands.impl.CreateClassPre sentationComm=
and.execute(CreateClassPresentationCommand.java:85)
at =
com.togethersoft.selena2.emf.gef.commands.ImportModelElement Command.execu=
te(ImportModelElementCommand.java:97)
at =
org.eclipse.gef.commands.DefaultCommandStack.execute(Default CommandStack.=
java:67)
at =
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(Abs tractTool.jav=
a:303)
at =
org.eclipse.gef.tools.CreationTool.performCreation(CreationT ool.java:103)=

at =
org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTo ol.java:71)
at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java :739)
at =
org.eclipse.gef.DefaultEditDomain.mouseUp(DefaultEditDomain. java:235)
at =
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Released(Doma=
inEventDispatcher.java:245)
at =
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(Li ghtweightSyst=
em.java:427)
at =
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:130)=

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:827)
at =
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1529)
at =
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1291)
at =
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1256)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1239)
at =
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.=
java:775)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432)
at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)

------=_NextPart_000_0018_01C2A519.982F0920
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-2">
<META content=3D"MSHTML 6.00.2800.1126" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<P><FONT size=3D2>I am sorry it was bug (Ctrl+Enter instead of=20
Shift+Enter)</FONT></P><FONT size=3D2></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>So, I have problems with =
method=20
<STRONG>add</STRONG> in <STRONG>Figure</STRONG> =
class.</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>If&nbsp;user adds nodes than everything =
works well.=20
But when user adds connection between two nodes than another additions =
are=20
impossible. It throws following exception.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have build 20021212 in use. When I =
was using=20
build 20020812 everything was OK.</FONT></DIV>
<P><FONT face=3DArial size=3D2>Do you think it is right to throw=20
IndexOutOfBoundsException in the <STRONG>add</STRONG> method. I think =
that it is=20
better to make list of Figures larger and add figure into it's=20
position.</FONT></P>
<DIV><FONT face=3DArial size=3D2>I am sorry for my bugged contribution =
and thank you=20
for your's oppinions and ideas.</FONT></DIV>
<P><BR><FONT face=3DArial size=3D2>java.lang.IndexOutOfBoundsException: =
IWAG0001E=20
Figure.add(...) invalid index<BR>&nbsp;&nbsp;&nbsp; at=20
org.eclipse.draw2d.Figure.add(Figure.java:97)<BR>&nbsp;&nbsp;&nbsp; at=20
org.eclipse.draw2d.FreeformLayer.add(FreeformLayer.java:21)<BR >&nbsp;&nbs=
p;&nbsp;=20
at=20
com.togethersoft.selena2.emf.gef.figures.DiagramFigure.add(D iagramFigure.=
java:53)<BR>&nbsp;&nbsp;&nbsp;=20
at org.eclipse.draw2d.Figure.add(Figure.java:143)<BR>&nbsp;&nbsp;&nbsp; =
at=20
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addChild Visual(Abstra=
ctGraphicalEditPart.java:195)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java=
:197)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPa=
rt.java:765)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:=
717)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraph=
icalEditPart.java:534)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart.handleD=
iagramNotification(DiagramElementEditPart.java:108)<BR>&nbsp;&nbsp;&nbsp;=
=20
at=20
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart$Diagram=
ModelListener.notifyChanged(DiagramElementEditPart.java:154) <BR>&nbsp;&nb=
sp;&nbsp;=20
at=20
org.eclipse.emf.common.notify.impl.NotifierImpl.eNotify(Noti fierImpl.java=
:166)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:115)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:103)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
com.togethersoft.uml14.ui.metamodel.unified_diagrams.concret esyntaxfounda=
tion.diagramfoundation.diagramcore.impl.DiagramElementImpl.s etContainer(D=
iagramElementImpl.java:513)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
com.togethersoft.selena2.emf.ui.commands.impl.CreateClassPre sentationComm=
and.execute(CreateClassPresentationCommand.java:85)<BR>&nbsp;&nbsp;&nbsp;=
=20
at=20
com.togethersoft.selena2.emf.gef.commands.ImportModelElement Command.execu=
te(ImportModelElementCommand.java:97)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.gef.commands.DefaultCommandStack.execute(Default CommandStack.=
java:67)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(Abs tractTool.jav=
a:303)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.gef.tools.CreationTool.performCreation(CreationT ool.java:103)=
<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTo ol.java:71) <B=
R>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java :739) <BR>&nbs=
p;&nbsp;&nbsp;=20
at=20
org.eclipse.gef.DefaultEditDomain.mouseUp(DefaultEditDomain. java:235) <BR>=
&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Released(Doma=
inEventDispatcher.java:245)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(Li ghtweightSyst=
em.java:427)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:130)=
<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77) <BR>&nbsp=
;&nbsp;&nbsp;=20
at=20
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:827)<BR >&nbsp;&nbsp;=
&nbsp;=20
at=20
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1529) <BR>&=
nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1291) <BR>&nb=
sp;&nbsp;&nbsp;=20
at=20
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1256) <BR>&n=
bsp;&nbsp;&nbsp;=20
at=20
org.eclipse.ui.internal.Workbench.run(Workbench.java:1239)<BR >&nbsp;&nbsp=
;&nbsp;=20
at=20
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.=
java:775)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
org.eclipse.core.boot.BootLoader.run(BootLoader.java:432)<BR >&nbsp;&nbsp;=
&nbsp;=20
at=20
EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)</FONT ></P></B=
ODY></HTML>

------=_NextPart_000_0018_01C2A519.982F0920--
Re: Problems with Figure.add(figure:IFigure, constraint:Object, index:int):void method [message #49865 is a reply to message #49835] Mon, 16 December 2002 10:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

This is a multi-part message in MIME format.

------=_NextPart_000_0034_01C2A4E9.FDE0AB50
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

The list of Figures will be made larger if the index is exactly 1 more =
than the current size.
However, NULL is not a valid child, so the List won't grow more than 1.

You need to find out why the number of figures does not correspond to =
the number of child EditParts. This should be a 1-to-1 relationship. =
Step through refreshChildren()
"Roman Bos=E1k" <bosakr@dev.disnet.cz> wrote in message =
news:atkob2$ic1$1@rogue.oti.com...
I am sorry it was bug (Ctrl+Enter instead of Shift+Enter)

So, I have problems with method add in Figure class.
If user adds nodes than everything works well. But when user adds =
connection between two nodes than another additions are impossible. It =
throws following exception.

I have build 20021212 in use. When I was using build 20020812 =
everything was OK.
Do you think it is right to throw IndexOutOfBoundsException in the add =
method. I think that it is better to make list of Figures larger and add =
figure into it's position.

I am sorry for my bugged contribution and thank you for your's =
oppinions and ideas.

java.lang.IndexOutOfBoundsException: IWAG0001E Figure.add(...) invalid =
index
at org.eclipse.draw2d.Figure.add(Figure.java:97)
at org.eclipse.draw2d.FreeformLayer.add(FreeformLayer.java:21)
at =
com.togethersoft.selena2.emf.gef.figures.DiagramFigure.add(D iagramFigure.=
java:53)
at org.eclipse.draw2d.Figure.add(Figure.java:143)
at =
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addChild Visual(Abstra=
ctGraphicalEditPart.java:195)
at =
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java=
:197)
at =
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPa=
rt.java:765)
at =
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:=
717)
at =
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraph=
icalEditPart.java:534)
at =
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart.handleD=
iagramNotification(DiagramElementEditPart.java:108)
at =
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart$Diagram=
ModelListener.notifyChanged(DiagramElementEditPart.java:154)
at =
org.eclipse.emf.common.notify.impl.NotifierImpl.eNotify(Noti fierImpl.java=
:166)
at =
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:115)
at =
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:103)
at =
com.togethersoft.uml14.ui.metamodel.unified_diagrams.concret esyntaxfounda=
tion.diagramfoundation.diagramcore.impl.DiagramElementImpl.s etContainer(D=
iagramElementImpl.java:513)
at =
com.togethersoft.selena2.emf.ui.commands.impl.CreateClassPre sentationComm=
and.execute(CreateClassPresentationCommand.java:85)
at =
com.togethersoft.selena2.emf.gef.commands.ImportModelElement Command.execu=
te(ImportModelElementCommand.java:97)
at =
org.eclipse.gef.commands.DefaultCommandStack.execute(Default CommandStack.=
java:67)
at =
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(Abs tractTool.jav=
a:303)
at =
org.eclipse.gef.tools.CreationTool.performCreation(CreationT ool.java:103)=

at =
org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTo ol.java:71)
at =
org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java :739)
at =
org.eclipse.gef.DefaultEditDomain.mouseUp(DefaultEditDomain. java:235)
at =
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Released(Doma=
inEventDispatcher.java:245)
at =
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(Li ghtweightSyst=
em.java:427)
at =
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:130)=

at =
org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:827)
at =
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1529)
at =
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1291)
at =
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1256)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1239)
at =
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.=
java:775)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432)
at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)


------=_NextPart_000_0034_01C2A4E9.FDE0AB50
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-2">
<META content=3D"MSHTML 6.00.2722.900" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>The list of Figures will be made larger =
if the=20
index is exactly 1 more than the current size.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>However, NULL is not a valid child, so =
the List=20
won't grow more than 1.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>You need to find out why the number of =
figures does=20
not correspond to the number of child EditParts. This should be a 1-to-1 =

relationship. Step through refreshChildren()</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Roman Bos=E1k" &lt;<A=20
href=3D"mailto:bosakr@dev.disnet.cz">bosakr@dev.disnet.cz</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:atkob2$ic1$1@rogue.oti.com">news:atkob2$ic1$1@rogue.oti.com<=
/A>...</DIV>
<DIV><FONT face=3DArial size=3D2>
<P><FONT size=3D2>I am sorry it was bug (Ctrl+Enter instead of=20
Shift+Enter)</FONT></P><FONT size=3D2></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>So, I have problems =
with method=20
<STRONG>add</STRONG> in <STRONG>Figure</STRONG> =
class.</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>If&nbsp;user adds nodes than =
everything works=20
well. But when user adds connection between two nodes than another =
additions=20
are impossible. It throws following exception.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have build 20021212 in use. When I =
was using=20
build 20020812 everything was OK.</FONT></DIV>
<P><FONT face=3DArial size=3D2>Do you think it is right to throw=20
IndexOutOfBoundsException in the <STRONG>add</STRONG> method. I think =
that it=20
is better to make list of Figures larger and add figure into it's=20
position.</FONT></P>
<DIV><FONT face=3DArial size=3D2>I am sorry for my bugged contribution =
and thank=20
you for your's oppinions and ideas.</FONT></DIV>
<P><BR><FONT face=3DArial =
size=3D2>java.lang.IndexOutOfBoundsException: IWAG0001E=20
Figure.add(...) invalid index<BR>&nbsp;&nbsp;&nbsp; at=20
org.eclipse.draw2d.Figure.add(Figure.java:97)<BR>&nbsp;&nbsp;&nbsp; at =

=
org.eclipse.draw2d.FreeformLayer.add(FreeformLayer.java:21)<BR >&nbsp;&nbs=
p;&nbsp;=20
at=20
=
com.togethersoft.selena2.emf.gef.figures.DiagramFigure.add(D iagramFigure.=
java:53)<BR>&nbsp;&nbsp;&nbsp;=20
at =
org.eclipse.draw2d.Figure.add(Figure.java:143)<BR>&nbsp;&nbsp;&nbsp; at=20
=
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addChild Visual(Abstra=
ctGraphicalEditPart.java:195)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java=
:197)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPa=
rt.java:765)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:=
717)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraph=
icalEditPart.java:534)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart.handleD=
iagramNotification(DiagramElementEditPart.java:108)<BR>&nbsp;&nbsp;&nbsp;=
=20
at=20
=
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart$Diagram=
ModelListener.notifyChanged(DiagramElementEditPart.java:154) <BR>&nbsp;&nb=
sp;&nbsp;=20
at=20
=
org.eclipse.emf.common.notify.impl.NotifierImpl.eNotify(Noti fierImpl.java=
:166)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:115)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:103)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
com.togethersoft.uml14.ui.metamodel.unified_diagrams.concret esyntaxfounda=
tion.diagramfoundation.diagramcore.impl.DiagramElementImpl.s etContainer(D=
iagramElementImpl.java:513)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
com.togethersoft.selena2.emf.ui.commands.impl.CreateClassPre sentationComm=
and.execute(CreateClassPresentationCommand.java:85)<BR>&nbsp;&nbsp;&nbsp;=
=20
at=20
=
com.togethersoft.selena2.emf.gef.commands.ImportModelElement Command.execu=
te(ImportModelElementCommand.java:97)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.commands.DefaultCommandStack.execute(Default CommandStack.=
java:67)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(Abs tractTool.jav=
a:303)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.tools.CreationTool.performCreation(CreationT ool.java:103)=
<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTo ol.java:71) <B=
R>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java :739) <BR>&nbs=
p;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.DefaultEditDomain.mouseUp(DefaultEditDomain. java:235) <BR>=
&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Released(Doma=
inEventDispatcher.java:245)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(Li ghtweightSyst=
em.java:427)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:130)=
<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77) <BR>&nbsp=
;&nbsp;&nbsp;=20
at=20
=
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:827)<BR >&nbsp;&nbsp;=
&nbsp;=20
at=20
=
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1529) <BR>&=
nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1291) <BR>&nb=
sp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1256) <BR>&n=
bsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.ui.internal.Workbench.run(Workbench.java:1239)<BR >&nbsp;&nbsp=
;&nbsp;=20
at=20
=
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.=
java:775)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.core.boot.BootLoader.run(BootLoader.java:432)<BR >&nbsp;&nbsp;=
&nbsp;=20
at=20
EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)</FONT ></P></B=
LOCKQUOTE></BODY></HTML>

------=_NextPart_000_0034_01C2A4E9.FDE0AB50--
Re: Problems with Figure.add(figure:IFigure, constraint:Object, index:int):void method [message #49896 is a reply to message #49865] Mon, 16 December 2002 11:49 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_0031_01C2A52B.7234B9B0
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

I was stepped throught refreshChildren() (while creating connection =
between two nodes) and everything looks fine till child.addNotify() =
call.
In this method (deeper in ConnectionLayer - as shown in following stack =
trace) the connection is added into ConnectionLayer and removed from =
DiagramFigure.
Now DiagramEditPart contains three children (Node1, Node2 and =
Connection1) and DiagramFigure contains only two children (NodeFigure1 =
and NodeFigure2).=20
The ConnectionFigure1 is contained in ConnectionLayer.

Is it right?
Is it neccessary to have two EditParts - first for "nodes layer" and =
second for ConnectionLayer?

Thank You.

Stack Trace:
com.togethersoft.selena2.emf.gef.figures.DiagramFigure(org.e clipse.draw2d=
..FreeformLayer).remove(org.eclipse.draw2d.IFigure) line: 49
org.eclipse.draw2d.ConnectionLayer(org.eclipse.draw2d.Figure ).add(org.ecl=
ipse.draw2d.IFigure, java.lang.Object, int) line: 107
org.eclipse.draw2d.ConnectionLayer(org.eclipse.draw2d.Freefo rmLayer).add(=
org.eclipse.draw2d.IFigure, java.lang.Object, int) line: 21
org.eclipse.draw2d.ConnectionLayer.add(org.eclipse.draw2d.IF igure, =
java.lang.Object, int) line: 32
org.eclipse.draw2d.ConnectionLayer(org.eclipse.draw2d.Figure ).add(org.ecl=
ipse.draw2d.IFigure) line: 135
com.togethersoft.selena2.emf.gef.editparts.AssociationEditPa rt(org.eclips=
e.gef.editparts.AbstractConnectionEditPart).activateFigure() line: 80
com.togethersoft.selena2.emf.gef.editparts.AssociationEditPa rt(org.eclips=
e.gef.editparts.AbstractConnectionEditPart).addNotify() line: 87
com.togethersoft.selena2.emf.gef.editparts.DiagramEditPart(o rg.eclipse.ge=
f.editparts.AbstractEditPart).addChild(org.eclipse.gef.EditP art, int) =
line: 198
....
"Randy Hudson" <hudsonr@us.eye-bee-em.com> p=ED=B9e v diskusn=EDm =
p=F8=EDsp=ECvku news:atkpid$j7h$1@rogue.oti.com...
The list of Figures will be made larger if the index is exactly 1 more =
than the current size.
However, NULL is not a valid child, so the List won't grow more than =
1.

You need to find out why the number of figures does not correspond to =
the number of child EditParts. This should be a 1-to-1 relationship. =
Step through refreshChildren()
"Roman Bos=E1k" <bosakr@dev.disnet.cz> wrote in message =
news:atkob2$ic1$1@rogue.oti.com...
I am sorry it was bug (Ctrl+Enter instead of Shift+Enter)

So, I have problems with method add in Figure class.
If user adds nodes than everything works well. But when user adds =
connection between two nodes than another additions are impossible. It =
throws following exception.

I have build 20021212 in use. When I was using build 20020812 =
everything was OK.
Do you think it is right to throw IndexOutOfBoundsException in the =
add method. I think that it is better to make list of Figures larger and =
add figure into it's position.

I am sorry for my bugged contribution and thank you for your's =
oppinions and ideas.

java.lang.IndexOutOfBoundsException: IWAG0001E Figure.add(...) =
invalid index
at org.eclipse.draw2d.Figure.add(Figure.java:97)
at org.eclipse.draw2d.FreeformLayer.add(FreeformLayer.java:21)
at =
com.togethersoft.selena2.emf.gef.figures.DiagramFigure.add(D iagramFigure.=
java:53)
at org.eclipse.draw2d.Figure.add(Figure.java:143)
at =
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addChild Visual(Abstra=
ctGraphicalEditPart.java:195)
at =
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java=
:197)
at =
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPa=
rt.java:765)
at =
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:=
717)
at =
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraph=
icalEditPart.java:534)
at =
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart.handleD=
iagramNotification(DiagramElementEditPart.java:108)
at =
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart$Diagram=
ModelListener.notifyChanged(DiagramElementEditPart.java:154)
at =
org.eclipse.emf.common.notify.impl.NotifierImpl.eNotify(Noti fierImpl.java=
:166)
at =
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:115)
at =
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:103)
at =
com.togethersoft.uml14.ui.metamodel.unified_diagrams.concret esyntaxfounda=
tion.diagramfoundation.diagramcore.impl.DiagramElementImpl.s etContainer(D=
iagramElementImpl.java:513)
at =
com.togethersoft.selena2.emf.ui.commands.impl.CreateClassPre sentationComm=
and.execute(CreateClassPresentationCommand.java:85)
at =
com.togethersoft.selena2.emf.gef.commands.ImportModelElement Command.execu=
te(ImportModelElementCommand.java:97)
at =
org.eclipse.gef.commands.DefaultCommandStack.execute(Default CommandStack.=
java:67)
at =
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(Abs tractTool.jav=
a:303)
at =
org.eclipse.gef.tools.CreationTool.performCreation(CreationT ool.java:103)=

at =
org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTo ol.java:71)
at =
org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java :739)
at =
org.eclipse.gef.DefaultEditDomain.mouseUp(DefaultEditDomain. java:235)
at =
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Released(Doma=
inEventDispatcher.java:245)
at =
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(Li ghtweightSyst=
em.java:427)
at =
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:130)=

at =
org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:827)
at =
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1529)
at =
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1291)
at =
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1256)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1239)
at =
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.=
java:775)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432)
at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)

------=_NextPart_000_0031_01C2A52B.7234B9B0
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-2">
<META content=3D"MSHTML 6.00.2800.1126" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I was stepped throught=20
<STRONG>refreshChildren()</STRONG> (while creating connection between =
two nodes)=20
and everything looks fine till <FONT =
size=3D2><STRONG>child.addNotify()</STRONG>=20
call.</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>In this method (deeper =
in=20
<STRONG>ConnectionLayer</STRONG> - as shown in following stack trace) =
the=20
connection is added into <STRONG>ConnectionLayer</STRONG> and removed =
from=20
<STRONG>DiagramFigure</STRONG>.</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Now <STRONG>DiagramEditPart</STRONG> =
contains three=20
children (<EM><STRONG>Node1</STRONG></EM>, =
<EM><STRONG>Node2</STRONG></EM> and=20
<EM><STRONG>Connection1</STRONG></EM>) and =
<STRONG>DiagramFigure</STRONG>=20
contains only two children (<STRONG><EM>NodeFigure1</EM></STRONG> and=20
<STRONG><EM>NodeFigure2</EM></STRONG>). </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>The <STRONG>ConnectionFigure1</STRONG> =
is contained=20
in <STRONG>ConnectionLayer</STRONG>.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Is it right?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Is it neccessary to have two EditParts =
- first for=20
"nodes layer" and second for ConnectionLayer?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank You.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG><EM>Stack =
Trace:</EM></STRONG></FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2><EM> com.togethersoft.selena2.emf.gef.figures.DiagramFigure(org.e =
clipse.draw2d.FreeformLayer).remove(org.eclipse.draw2d.IFigu re)=20
line:=20
49<BR> org.eclipse.draw2d.ConnectionLayer(org.eclipse.draw2d.Figure ).add(o=
rg.eclipse.draw2d.IFigure,=20
java.lang.Object, int) line:=20
107<BR> org.eclipse.draw2d.ConnectionLayer(org.eclipse.draw2d.Freefo rmLaye=
r).add(org.eclipse.draw2d.IFigure,=20
java.lang.Object, int) line:=20
21<BR> org.eclipse.draw2d.ConnectionLayer.add(org.eclipse.draw2d.IF igure, =

java.lang.Object, int) line:=20
32<BR> org.eclipse.draw2d.ConnectionLayer(org.eclipse.draw2d.Figure ).add(o=
rg.eclipse.draw2d.IFigure)=20
line:=20
135<BR> com.togethersoft.selena2.emf.gef.editparts.AssociationEditPa rt(org=
..eclipse.gef.editparts.AbstractConnectionEditPart).activate Figure()=20
line:=20
80<BR> com.togethersoft.selena2.emf.gef.editparts.AssociationEditPa rt(org.=
eclipse.gef.editparts.AbstractConnectionEditPart).addNotify( )=20
line:=20
87<BR> com.togethersoft.selena2.emf.gef.editparts.DiagramEditPart(o rg.ecli=
pse.gef.editparts.AbstractEditPart).addChild(org.eclipse.gef .EditPart,=20
int) line: 198</EM><BR>...</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Randy Hudson" &lt;<A=20
=
href=3D"mailto:hudsonr@us.eye-bee-em.com">hudsonr@us.eye-bee-em.com</A>&g=
t; p=ED=B9e=20
v diskusn=EDm p=F8=EDsp=ECvku <A=20
=
href=3D"news:atkpid$j7h$1@rogue.oti.com">news:atkpid$j7h$1@rogue.oti.com<=
/A>...</DIV>
<DIV><FONT face=3DArial size=3D2>The list of Figures will be made =
larger if the=20
index is exactly 1 more than the current size.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>However, NULL is not a valid child, =
so the List=20
won't grow more than 1.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>You need to find out why the number =
of figures=20
does not correspond to the number of child EditParts. This should be a =
1-to-1=20
relationship. Step through refreshChildren()</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Roman Bos=E1k" &lt;<A=20
href=3D"mailto:bosakr@dev.disnet.cz">bosakr@dev.disnet.cz</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:atkob2$ic1$1@rogue.oti.com">news:atkob2$ic1$1@rogue.oti.com<=
/A>...</DIV>
<DIV><FONT face=3DArial size=3D2>
<P><FONT size=3D2>I am sorry it was bug (Ctrl+Enter instead of=20
Shift+Enter)</FONT></P><FONT size=3D2></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>So, I have problems =
with method=20
<STRONG>add</STRONG> in <STRONG>Figure</STRONG> =
class.</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>If&nbsp;user adds nodes than =
everything works=20
well. But when user adds connection between two nodes than another =
additions=20
are impossible. It throws following exception.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have build 20021212 in use. When =
I was using=20
build 20020812 everything was OK.</FONT></DIV>
<P><FONT face=3DArial size=3D2>Do you think it is right to throw=20
IndexOutOfBoundsException in the <STRONG>add</STRONG> method. I =
think that=20
it is better to make list of Figures larger and add figure into it's =

position.</FONT></P>
<DIV><FONT face=3DArial size=3D2>I am sorry for my bugged =
contribution and thank=20
you for your's oppinions and ideas.</FONT></DIV>
<P><BR><FONT face=3DArial =
size=3D2>java.lang.IndexOutOfBoundsException:=20
IWAG0001E Figure.add(...) invalid index<BR>&nbsp;&nbsp;&nbsp; at=20
org.eclipse.draw2d.Figure.add(Figure.java:97)<BR>&nbsp;&nbsp;&nbsp; =
at=20
=
org.eclipse.draw2d.FreeformLayer.add(FreeformLayer.java:21)<BR >&nbsp;&nbs=
p;&nbsp;=20
at=20
=
com.togethersoft.selena2.emf.gef.figures.DiagramFigure.add(D iagramFigure.=
java:53)<BR>&nbsp;&nbsp;&nbsp;=20
at =
org.eclipse.draw2d.Figure.add(Figure.java:143)<BR>&nbsp;&nbsp;&nbsp; at=20
=
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addChild Visual(Abstra=
ctGraphicalEditPart.java:195)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java=
:197)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPa=
rt.java:765)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:=
717)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraph=
icalEditPart.java:534)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart.handleD=
iagramNotification(DiagramElementEditPart.java:108)<BR>&nbsp;&nbsp;&nbsp;=
=20
at=20
=
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart$Diagram=
ModelListener.notifyChanged(DiagramElementEditPart.java:154) <BR>&nbsp;&nb=
sp;&nbsp;=20
at=20
=
org.eclipse.emf.common.notify.impl.NotifierImpl.eNotify(Noti fierImpl.java=
:166)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:115)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:103)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
com.togethersoft.uml14.ui.metamodel.unified_diagrams.concret esyntaxfounda=
tion.diagramfoundation.diagramcore.impl.DiagramElementImpl.s etContainer(D=
iagramElementImpl.java:513)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
com.togethersoft.selena2.emf.ui.commands.impl.CreateClassPre sentationComm=
and.execute(CreateClassPresentationCommand.java:85)<BR>&nbsp;&nbsp;&nbsp;=
=20
at=20
=
com.togethersoft.selena2.emf.gef.commands.ImportModelElement Command.execu=
te(ImportModelElementCommand.java:97)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.commands.DefaultCommandStack.execute(Default CommandStack.=
java:67)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(Abs tractTool.jav=
a:303)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.tools.CreationTool.performCreation(CreationT ool.java:103)=
<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTo ol.java:71) <B=
R>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java :739) <BR>&nbs=
p;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.DefaultEditDomain.mouseUp(DefaultEditDomain. java:235) <BR>=
&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Released(Doma=
inEventDispatcher.java:245)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(Li ghtweightSyst=
em.java:427)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:130)=
<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77) <BR>&nbsp=
;&nbsp;&nbsp;=20
at=20
=
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:827)<BR >&nbsp;&nbsp;=
&nbsp;=20
at=20
=
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1529) <BR>&=
nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1291) <BR>&nb=
sp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1256) <BR>&n=
bsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.ui.internal.Workbench.run(Workbench.java:1239)<BR >&nbsp;&nbsp=
;&nbsp;=20
at=20
=
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.=
java:775)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.core.boot.BootLoader.run(BootLoader.java:432)<BR >&nbsp;&nbsp;=
&nbsp;=20
at=20
=
EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)</FONT ></P></B=
LOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0031_01C2A52B.7234B9B0--
Re: Problems with Figure.add(figure:IFigure, constraint:Object, index:int):void method [message #50248 is a reply to message #49896] Mon, 16 December 2002 21:47 Go to previous message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

This is a multi-part message in MIME format.

------=_NextPart_000_0013_01C2A54C.CADC54D0
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

In the EditPart structure, Connections are not children of the diagram. =
They are structural features (shared aggregation) of Node 1 and Node 2.

This does not impose a requirement on your model, but it does make =
certain models easier to map to EditParts than others. If your =
application model has connections as the children of the diagram, you =
must filter them out in getModelChildren(). Also, you must implement =
getModelSourceConnections, and getModelTargetConnections at each node =
editpart.


"Roman Bos=E1k" <bosakr@dev.disnet.cz> wrote in message =
news:atkvqj$nvj$1@rogue.oti.com...
I was stepped throught refreshChildren() (while creating connection =
between two nodes) and everything looks fine till child.addNotify() =
call.
In this method (deeper in ConnectionLayer - as shown in following =
stack trace) the connection is added into ConnectionLayer and removed =
from DiagramFigure.
Now DiagramEditPart contains three children (Node1, Node2 and =
Connection1) and DiagramFigure contains only two children (NodeFigure1 =
and NodeFigure2).=20
The ConnectionFigure1 is contained in ConnectionLayer.

Is it right?
Is it neccessary to have two EditParts - first for "nodes layer" and =
second for ConnectionLayer?

Thank You.

Stack Trace:
=
com.togethersoft.selena2.emf.gef.figures.DiagramFigure(org.e clipse.draw2d=
..FreeformLayer).remove(org.eclipse.draw2d.IFigure) line: 49
=
org.eclipse.draw2d.ConnectionLayer(org.eclipse.draw2d.Figure ).add(org.ecl=
ipse.draw2d.IFigure, java.lang.Object, int) line: 107
=
org.eclipse.draw2d.ConnectionLayer(org.eclipse.draw2d.Freefo rmLayer).add(=
org.eclipse.draw2d.IFigure, java.lang.Object, int) line: 21
org.eclipse.draw2d.ConnectionLayer.add(org.eclipse.draw2d.IF igure, =
java.lang.Object, int) line: 32
=
org.eclipse.draw2d.ConnectionLayer(org.eclipse.draw2d.Figure ).add(org.ecl=
ipse.draw2d.IFigure) line: 135
=
com.togethersoft.selena2.emf.gef.editparts.AssociationEditPa rt(org.eclips=
e.gef.editparts.AbstractConnectionEditPart).activateFigure() line: 80
=
com.togethersoft.selena2.emf.gef.editparts.AssociationEditPa rt(org.eclips=
e.gef.editparts.AbstractConnectionEditPart).addNotify() line: 87
=
com.togethersoft.selena2.emf.gef.editparts.DiagramEditPart(o rg.eclipse.ge=
f.editparts.AbstractEditPart).addChild(org.eclipse.gef.EditP art, int) =
line: 198
...
"Randy Hudson" <hudsonr@us.eye-bee-em.com> p=ED=B9e v diskusn=EDm =
p=F8=EDsp=ECvku news:atkpid$j7h$1@rogue.oti.com...
The list of Figures will be made larger if the index is exactly 1 =
more than the current size.
However, NULL is not a valid child, so the List won't grow more than =
1.

You need to find out why the number of figures does not correspond =
to the number of child EditParts. This should be a 1-to-1 relationship. =
Step through refreshChildren()
"Roman Bos=E1k" <bosakr@dev.disnet.cz> wrote in message =
news:atkob2$ic1$1@rogue.oti.com...
I am sorry it was bug (Ctrl+Enter instead of Shift+Enter)

So, I have problems with method add in Figure class.
If user adds nodes than everything works well. But when user adds =
connection between two nodes than another additions are impossible. It =
throws following exception.

I have build 20021212 in use. When I was using build 20020812 =
everything was OK.
Do you think it is right to throw IndexOutOfBoundsException in the =
add method. I think that it is better to make list of Figures larger and =
add figure into it's position.

I am sorry for my bugged contribution and thank you for your's =
oppinions and ideas.

java.lang.IndexOutOfBoundsException: IWAG0001E Figure.add(...) =
invalid index
at org.eclipse.draw2d.Figure.add(Figure.java:97)
at org.eclipse.draw2d.FreeformLayer.add(FreeformLayer.java:21)
at =
com.togethersoft.selena2.emf.gef.figures.DiagramFigure.add(D iagramFigure.=
java:53)
at org.eclipse.draw2d.Figure.add(Figure.java:143)
at =
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addChild Visual(Abstra=
ctGraphicalEditPart.java:195)
at =
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java=
:197)
at =
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPa=
rt.java:765)
at =
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:=
717)
at =
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraph=
icalEditPart.java:534)
at =
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart.handleD=
iagramNotification(DiagramElementEditPart.java:108)
at =
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart$Diagram=
ModelListener.notifyChanged(DiagramElementEditPart.java:154)
at =
org.eclipse.emf.common.notify.impl.NotifierImpl.eNotify(Noti fierImpl.java=
:166)
at =
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:115)
at =
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:103)
at =
com.togethersoft.uml14.ui.metamodel.unified_diagrams.concret esyntaxfounda=
tion.diagramfoundation.diagramcore.impl.DiagramElementImpl.s etContainer(D=
iagramElementImpl.java:513)
at =
com.togethersoft.selena2.emf.ui.commands.impl.CreateClassPre sentationComm=
and.execute(CreateClassPresentationCommand.java:85)
at =
com.togethersoft.selena2.emf.gef.commands.ImportModelElement Command.execu=
te(ImportModelElementCommand.java:97)
at =
org.eclipse.gef.commands.DefaultCommandStack.execute(Default CommandStack.=
java:67)
at =
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(Abs tractTool.jav=
a:303)
at =
org.eclipse.gef.tools.CreationTool.performCreation(CreationT ool.java:103)=

at =
org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTo ol.java:71)
at =
org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java :739)
at =
org.eclipse.gef.DefaultEditDomain.mouseUp(DefaultEditDomain. java:235)
at =
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Released(Doma=
inEventDispatcher.java:245)
at =
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(Li ghtweightSyst=
em.java:427)
at =
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:130)=

at =
org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:827)
at =
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1529)
at =
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1291)
at =
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1256)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1239)
at =
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.=
java:775)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432)
at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)


------=_NextPart_000_0013_01C2A54C.CADC54D0
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-2">
<META content=3D"MSHTML 6.00.2722.900" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>In the EditPart structure, Connections =
are not=20
children of the diagram.&nbsp; They are structural features (shared =
aggregation)=20
of Node 1 and Node 2.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This does not impose a requirement on =
your model,=20
but it does make certain models easier to map to EditParts than =
others.&nbsp; If=20
your application model has connections as the children of the diagram, =
you must=20
filter them out in getModelChildren().&nbsp; Also, you must implement=20
getModelSourceConnections, and getModelTargetConnections at each node=20
editpart.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>"Roman Bos=E1k" &lt;<A=20
href=3D"mailto:bosakr@dev.disnet.cz">bosakr@dev.disnet.cz</A>&gt; wrote =
in message=20
<A=20
href=3D"news:atkvqj$nvj$1@rogue.oti.com">news:atkvqj$nvj$1@rogue.oti.com<=
/A>...</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial size=3D2>I was stepped throught=20
<STRONG>refreshChildren()</STRONG> (while creating connection between =
two=20
nodes) and everything looks fine till <FONT=20
size=3D2><STRONG>child.addNotify()</STRONG> call.</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>In this method (deeper =
in=20
<STRONG>ConnectionLayer</STRONG> - as shown in following stack trace) =
the=20
connection is added into <STRONG>ConnectionLayer</STRONG> and removed =
from=20
<STRONG>DiagramFigure</STRONG>.</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Now <STRONG>DiagramEditPart</STRONG> =
contains=20
three children (<EM><STRONG>Node1</STRONG></EM>,=20
<EM><STRONG>Node2</STRONG></EM> and =
<EM><STRONG>Connection1</STRONG></EM>) and=20
<STRONG>DiagramFigure</STRONG> contains only two children=20
(<STRONG><EM>NodeFigure1</EM></STRONG> and=20
<STRONG><EM>NodeFigure2</EM></STRONG>). </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>The =
<STRONG>ConnectionFigure1</STRONG> is=20
contained in <STRONG>ConnectionLayer</STRONG>.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Is it right?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Is it neccessary to have two =
EditParts - first=20
for "nodes layer" and second for ConnectionLayer?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank You.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><STRONG><EM>Stack=20
Trace:</EM></STRONG></FONT></DIV>
<DIV><FONT face=3DArial=20
=
size=3D2><EM> com.togethersoft.selena2.emf.gef.figures.DiagramFigure(org.e =
clipse.draw2d.FreeformLayer).remove(org.eclipse.draw2d.IFigu re)=20
line:=20
=
49<BR> org.eclipse.draw2d.ConnectionLayer(org.eclipse.draw2d.Figure ).add(o=
rg.eclipse.draw2d.IFigure,=20
java.lang.Object, int) line:=20
=
107<BR> org.eclipse.draw2d.ConnectionLayer(org.eclipse.draw2d.Freefo rmLaye=
r).add(org.eclipse.draw2d.IFigure,=20
java.lang.Object, int) line:=20
=
21<BR> org.eclipse.draw2d.ConnectionLayer.add(org.eclipse.draw2d.IF igure, =

java.lang.Object, int) line:=20
=
32<BR> org.eclipse.draw2d.ConnectionLayer(org.eclipse.draw2d.Figure ).add(o=
rg.eclipse.draw2d.IFigure)=20
line:=20
=
135<BR> com.togethersoft.selena2.emf.gef.editparts.AssociationEditPa rt(org=
..eclipse.gef.editparts.AbstractConnectionEditPart).activate Figure()=20
line:=20
=
80<BR> com.togethersoft.selena2.emf.gef.editparts.AssociationEditPa rt(org.=
eclipse.gef.editparts.AbstractConnectionEditPart).addNotify( )=20
line:=20
=
87<BR> com.togethersoft.selena2.emf.gef.editparts.DiagramEditPart(o rg.ecli=
pse.gef.editparts.AbstractEditPart).addChild(org.eclipse.gef .EditPart,=20
int) line: 198</EM><BR>...</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Randy Hudson" &lt;<A=20
=
href=3D"mailto:hudsonr@us.eye-bee-em.com">hudsonr@us.eye-bee-em.com</A>&g=
t;=20
p=ED=B9e v diskusn=EDm p=F8=EDsp=ECvku <A=20
=
href=3D"news:atkpid$j7h$1@rogue.oti.com">news:atkpid$j7h$1@rogue.oti.com<=
/A>...</DIV>
<DIV><FONT face=3DArial size=3D2>The list of Figures will be made =
larger if the=20
index is exactly 1 more than the current size.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>However, NULL is not a valid child, =
so the List=20
won't grow more than 1.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>You need to find out why the number =
of figures=20
does not correspond to the number of child EditParts. This should be =
a=20
1-to-1 relationship. Step through refreshChildren()</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Roman Bos=E1k" &lt;<A=20
href=3D"mailto:bosakr@dev.disnet.cz">bosakr@dev.disnet.cz</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:atkob2$ic1$1@rogue.oti.com">news:atkob2$ic1$1@rogue.oti.com<=
/A>...</DIV>
<DIV><FONT face=3DArial size=3D2>
<P><FONT size=3D2>I am sorry it was bug (Ctrl+Enter instead of=20
Shift+Enter)</FONT></P><FONT size=3D2></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>So, I have =
problems with method=20
<STRONG>add</STRONG> in <STRONG>Figure</STRONG> =
class.</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>If&nbsp;user adds nodes than =
everything works=20
well. But when user adds connection between two nodes than another =

additions are impossible. It throws following =
exception.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have build 20021212 in use. =
When I was=20
using build 20020812 everything was OK.</FONT></DIV>
<P><FONT face=3DArial size=3D2>Do you think it is right to throw=20
IndexOutOfBoundsException in the <STRONG>add</STRONG> method. I =
think that=20
it is better to make list of Figures larger and add figure into =
it's=20
position.</FONT></P>
<DIV><FONT face=3DArial size=3D2>I am sorry for my bugged =
contribution and=20
thank you for your's oppinions and ideas.</FONT></DIV>
<P><BR><FONT face=3DArial =
size=3D2>java.lang.IndexOutOfBoundsException:=20
IWAG0001E Figure.add(...) invalid index<BR>&nbsp;&nbsp;&nbsp; at=20
=
org.eclipse.draw2d.Figure.add(Figure.java:97)<BR>&nbsp;&nbsp;&nbsp; at=20
=
org.eclipse.draw2d.FreeformLayer.add(FreeformLayer.java:21)<BR >&nbsp;&nbs=
p;&nbsp;=20
at=20
=
com.togethersoft.selena2.emf.gef.figures.DiagramFigure.add(D iagramFigure.=
java:53)<BR>&nbsp;&nbsp;&nbsp;=20
at =
org.eclipse.draw2d.Figure.add(Figure.java:143)<BR>&nbsp;&nbsp;&nbsp; at=20
=
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addChild Visual(Abstra=
ctGraphicalEditPart.java:195)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java=
:197)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPa=
rt.java:765)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:=
717)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraph=
icalEditPart.java:534)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart.handleD=
iagramNotification(DiagramElementEditPart.java:108)<BR>&nbsp;&nbsp;&nbsp;=
=20
at=20
=
com.togethersoft.selena2.emf.gef.editparts.DiagramElementEdi tPart$Diagram=
ModelListener.notifyChanged(DiagramElementEditPart.java:154) <BR>&nbsp;&nb=
sp;&nbsp;=20
at=20
=
org.eclipse.emf.common.notify.impl.NotifierImpl.eNotify(Noti fierImpl.java=
:166)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:115)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.emf.common.notify.impl.NotificationChainImpl.dis patch(Notific=
ationChainImpl.java:103)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
com.togethersoft.uml14.ui.metamodel.unified_diagrams.concret esyntaxfounda=
tion.diagramfoundation.diagramcore.impl.DiagramElementImpl.s etContainer(D=
iagramElementImpl.java:513)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
com.togethersoft.selena2.emf.ui.commands.impl.CreateClassPre sentationComm=
and.execute(CreateClassPresentationCommand.java:85)<BR>&nbsp;&nbsp;&nbsp;=
=20
at=20
=
com.togethersoft.selena2.emf.gef.commands.ImportModelElement Command.execu=
te(ImportModelElementCommand.java:97)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.commands.DefaultCommandStack.execute(Default CommandStack.=
java:67)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(Abs tractTool.jav=
a:303)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.tools.CreationTool.performCreation(CreationT ool.java:103)=
<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTo ol.java:71) <B=
R>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java :739) <BR>&nbs=
p;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.DefaultEditDomain.mouseUp(DefaultEditDomain. java:235) <BR>=
&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Released(Doma=
inEventDispatcher.java:245)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(Li ghtweightSyst=
em.java:427)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:130)=
<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :77) <BR>&nbsp=
;&nbsp;&nbsp;=20
at=20
=
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:827)<BR >&nbsp;&nbsp;=
&nbsp;=20
at=20
=
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:1529) <BR>&=
nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1291) <BR>&nb=
sp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1256) <BR>&n=
bsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.ui.internal.Workbench.run(Workbench.java:1239)<BR >&nbsp;&nbsp=
;&nbsp;=20
at=20
=
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.=
java:775)<BR>&nbsp;&nbsp;&nbsp;=20
at=20
=
org.eclipse.core.boot.BootLoader.run(BootLoader.java:432)<BR >&nbsp;&nbsp;=
&nbsp;=20
at=20
=
EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)</FONT ></P></B=
LOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0013_01C2A54C.CADC54D0--
Previous Topic:GUI designer for eclipse VFE
Next Topic:layout fot root figure
Goto Forum:
  


Current Time: Wed May 28 22:36:50 EDT 2025

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

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

Back to the top