Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » java.lang.IllegalArgumentException: Figure must be a child
java.lang.IllegalArgumentException: Figure must be a child [message #81353] Tue, 28 November 2006 13:31 Go to next message
Eclipse UserFriend
Originally posted by: zzhangh.cn.ibm.com

Hi,
I got "java.lang.IllegalArgumentException: Figure must be a child" when
drag a figure from palette to canvas, as a workaround I commented codes in
XXXCompartmentEditPart#setRatio() which supposed to call super.Ratio().

As to this exception, where could be the problem? Also I'm interested in
what ShapeCompartmentEditPart#setRatio() would impact.

Caused by: java.lang.IllegalArgumentException: Figure must be a child
at org.eclipse.draw2d.Figure.setConstraint(Figure.java:1455)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBordere dShapeEditPart.setLayoutConstraint(AbstractBorderedShapeEdit Part.java:67)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompar tmentEditPart.setRatio(ResizableCompartmentEditPart.java:201 )
at
com.example.bma.diagram.edit.parts.ActorActivitiesEditPart.s etRatio(ActorActivitiesEditPart.java:79)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompar tmentEditPart.refreshRatio(ResizableCompartmentEditPart.java :152)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompar tmentEditPart.refreshVisuals(ResizableCompartmentEditPart.ja va:72)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:676)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$3(GraphicalEditPart.java:1)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt$3.run(GraphicalEditPart.java:824)
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.runExclusive(TransactionalEditingDomainImpl.java:256)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.refresh(GraphicalEditPart.java:814)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:235)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmen tEditPart.addNotify(ShapeCompartmentEditPart.java:786)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:198)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:727)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:677)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:554)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$3(GraphicalEditPart.java:1)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt$3.run(GraphicalEditPart.java:824)
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.runExclusive(TransactionalEditingDomainImpl.java:256)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.refresh(GraphicalEditPart.java:814)

Regards,
Hao Zhang
Re: java.lang.IllegalArgumentException: Figure must be a child [message #154405 is a reply to message #81353] Tue, 09 October 2007 14:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: r.c.ladan.tue.nl

This is a multi-part message in MIME format.
--------------000701010003070301010107
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

Hao Zhang wrote:
> Hi,
> I got "java.lang.IllegalArgumentException: Figure must be a child" when
> drag a figure from palette to canvas, as a workaround I commented codes
> in XXXCompartmentEditPart#setRatio() which supposed to call super.Ratio().
>
> As to this exception, where could be the problem? Also I'm interested in
> what ShapeCompartmentEditPart#setRatio() would impact.
>
I'm also plagued by this exception (see the attachment), but it happens
when the diagram draws itself upon launch. The diagram still shows up,
but adding elements (except for the standard GMF ones like Triangle,
Octagon, etc) yields a stack overflow exception.

This is with an unmodified gmfgen file and java code. The gmfmap file validates
ok. I don't get any exceptions with the (self-created) mindmap example.

Versions are from the latest Integration:
Eclipse 3.4.0 I20070921-0919
EMF 2.3.0 I20070925-2135
GEF 3.4.0 20070919
GMF 1.0.0 20070809-0000

Any ideas?

Regards,
Rene

--------------000701010003070301010107
Content-Type: text/plain;
name="IRJS0007E Semantic refresh failed.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="IRJS0007E Semantic refresh failed.txt"

java.lang.IllegalArgumentException: Figure must be a child
at org.eclipse.draw2d.Figure.setConstraint(Figure.java:1458)
at org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderI temEditPart.setLayoutConstraint(BorderedBorderItemEditPart.j ava:133)
at meta.diagram.edit.parts.ProvidesPortNameEditPart.refreshBoun ds(ProvidesPortNameEditPart.java:138)
at meta.diagram.edit.parts.ProvidesPortNameEditPart.refreshVisu als(ProvidesPortNameEditPart.java:428)
at meta.diagram.edit.parts.ProvidesPortNameEditPart.setLabel(Pr ovidesPortNameEditPart.java:194)
at meta.diagram.edit.parts.ProvidesPortEditPart.addFixedChild(P rovidesPortEditPart.java:126)
at meta.diagram.edit.parts.ProvidesPortEditPart.addChildVisual( ProvidesPortEditPart.java:157)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:197)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.addChild(GraphicalEditPart.java:1292)
at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:727)
at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:677)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:564)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$3(GraphicalEditPart.java:1)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt$3.run(GraphicalEditPart.java:836)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.runExclusive(TransactionalEditingDomainImpl.java:262)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.refresh(GraphicalEditPart.java:826)
at org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:235)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:212)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:198)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.addChild(GraphicalEditPart.java:1292)
at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:727)
at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:677)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:564)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$3(GraphicalEditPart.java:1)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt$3.run(GraphicalEditPart.java:836)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.runExclusive(TransactionalEditingDomainImpl.java:262)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.refresh(GraphicalEditPart.java:826)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.postProcessRefreshSemantic(CanonicalEditPolicy.java: 1190)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.refreshSemanticChildren(CanonicalEditPolicy.java:112 5)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.refreshSemantic(CanonicalEditPolicy.java:980)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.refresh(CanonicalEditPolicy.java:962)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.refreshOnActivate(CanonicalEditPolicy.java:662)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.activate(CanonicalEditPolicy.java:652)
at org.eclipse.gef.editparts.AbstractEditPart.activateEditPolic ies(AbstractEditPart.java:165)
at org.eclipse.gef.editparts.AbstractEditPart.activate(Abstract EditPart.java:148)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate (AbstractGraphicalEditPart.java:186)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$0(GraphicalEditPart.java:1)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.activate(GraphicalEditPart.java:186)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:201)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.addChild(GraphicalEditPart.java:1292)
at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:727)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.handleNotificationEvent(GraphicalEditPart.java:1437)
at org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart.h andleNotificationEvent(ShapeEditPart.java:111)
at org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPa rt.handleNotificationEvent(ShapeNodeEditPart.java:225)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.notifyChanged(GraphicalEditPart.java:1411)
at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBr oker.fireNotification(DiagramEventBroker.java:500)
at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBr oker.resourceSetChanged(DiagramEventBroker.java:395)
at org.eclipse.gmf.runtime.diagram.ui.internal.DiagramEventBrok erThreadSafe.resourceSetChanged(DiagramEventBrokerThreadSafe .java:72)
at org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFac tory$DiagramEditingDomain.postcommit(DiagramEditingDomainFac tory.java:213)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.deactivate(TransactionalEditingDomainImpl.java:475)
at org.eclipse.emf.transaction.impl.TransactionImpl.close(Trans actionImpl.java:517)
at org.eclipse.emf.transaction.impl.TransactionImpl.commit(Tran sactionImpl.java:358)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.java:140)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.executeCommand(CanonicalEditPolicy.java:513)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.createViews(CanonicalEditPolicy.java:469)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.refreshSemanticChildren(CanonicalEditPolicy.java:110 2)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.refreshSemantic(CanonicalEditPolicy.java:980)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.refresh(CanonicalEditPolicy.java:962)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.refreshOnActivate(CanonicalEditPolicy.java:662)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.activate(CanonicalEditPolicy.java:652)
at org.eclipse.gef.editparts.AbstractEditPart.activateEditPolic ies(AbstractEditPart.java:165)
at org.eclipse.gef.editparts.AbstractEditPart.activate(Abstract EditPart.java:148)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate (AbstractGraphicalEditPart.java:186)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$0(GraphicalEditPart.java:1)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.activate(GraphicalEditPart.java:186)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalCon nectionEditPolicy.refreshOnActivate(CanonicalConnectionEditP olicy.java:104)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEdi tPolicy.activate(CanonicalEditPolicy.java:652)
at org.eclipse.gef.editparts.AbstractEditPart.activateEditPolic ies(AbstractEditPart.java:165)
at org.eclipse.gef.editparts.AbstractEditPart.activate(Abstract EditPart.java:148)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate (AbstractGraphicalEditPart.java:186)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$0(GraphicalEditPart.java:1)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.activate(GraphicalEditPart.java:186)
at org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart .activate(DiagramEditPart.java:349)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:201)
at org.eclipse.gef.editparts.SimpleRootEditPart.setContents(Sim pleRootEditPart.java:101)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents( AbstractEditPartViewer.java:601)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalVie wer.setContents(DiagramGraphicalViewer.java:378)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents( AbstractEditPartViewer.java:610)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.initi alizeGraphicalViewerContents(DiagramEditor.java:857)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.initi alizeGraphicalViewer(DiagramEditor.java:850)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFl yOutPalette.initializeGraphicalViewer(DiagramEditorWithFlyOu tPalette.java:112)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.creat eGraphicalViewer(DiagramEditor.java:794)
at org.eclipse.gef.ui.parts.GraphicalEditor.createPartControl(G raphicalEditor.java:163)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.creat ePartControl(DiagramEditor.java:1548)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFl yOutPalette.createPartControl(DiagramEditorWithFlyOutPalette .java:310)
at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.createPartControl(DiagramDocumentEditor. java:1459)
at org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(Ed itorAreaHelper.java:263)
at org.eclipse.ui.internal.EditorManager.setVisibleEditor(Edito rManager.java:1405)
at org.eclipse.ui.internal.EditorManager$5.runWithException(Edi torManager.java:939)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:124)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3719)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3356)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:801)
at org.eclipse.ui.internal.Workbench$25.runWithException(Workbe nch.java:1342)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:124)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3719)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3356)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2309)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 515)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:455)
at org.eclipse.equinox.launcher.Main.run(Main.java:1193)
at org.eclipse.equinox.launcher.Main.main(Main.java:1169)

--------------000701010003070301010107--
Re: java.lang.IllegalArgumentException: Figure must be a child [message #154560 is a reply to message #154405] Wed, 10 October 2007 08:27 Go to previous message
Eclipse UserFriend
Originally posted by: r.c.ladan.tue.nl

Rene Ladan wrote:
> Hao Zhang wrote:
>> Hi,
>> I got "java.lang.IllegalArgumentException: Figure must be a child" when
>> drag a figure from palette to canvas, as a workaround I commented codes
>> in XXXCompartmentEditPart#setRatio() which supposed to call super.Ratio().
>>
>> As to this exception, where could be the problem? Also I'm interested in
>> what ShapeCompartmentEditPart#setRatio() would impact.
>>
> I'm also plagued by this exception (see the attachment), but it happens
> when the diagram draws itself upon launch. The diagram still shows up,
> but adding elements (except for the standard GMF ones like Triangle,
> Octagon, etc) yields a stack overflow exception.
>
> This is with an unmodified gmfgen file and java code. The gmfmap file validates
> ok. I don't get any exceptions with the (self-created) mindmap example.
>
Even regenerating the gmfgen file and Java code from scratch (i.e. moving the existing
files out of the way) doesn't help. The genmodel file is unmodified, only the following
Java methods are modified:

* MODEL/src/MODEL/MODELPackage.java : change String eNS_URI from
"MODEL" to "LEGACY_MODEL_URI" to be compatible with legacy models.

> Versions are from the latest Integration:
> Eclipse 3.4.0 I20070921-0919
> EMF 2.3.0 I20070925-2135
> GEF 3.4.0 20070919
> GMF 1.0.0 20070809-0000
>
> Any ideas?
>
> Regards,
> Rene
>
Previous Topic:How to create a new Node for a preexisting model element with no representation in the diagram
Next Topic:Programmatically creating a link
Goto Forum:
  


Current Time: Fri Jan 03 07:47:32 GMT 2025

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

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

Back to the top