Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Diagram code generation generates invalid code
Diagram code generation generates invalid code [message #119283] Fri, 13 April 2007 23:48 Go to next message
Eclipse UserFriend
Originally posted by: adolfo.correia.siliconstrategy.com.br

I am learning about GMF and I decided to take the GMF tutorial with the
mindmap example (http://wiki.eclipse.org/index.php/GMF_Tutorial).

When I try to generate code for the diagram, eclipse (successfully)
generates invalid code. The error is on the
org.eclipse.gmf.examples.mindmap.diagram.edit.parts.TopicEdi tPart
generated class.

The method in error is:

protected boolean addFixedChild(EditPart childEditPart) {
if (childEditPart instanceof TopicNameEditPart) {
((TopicNameEditPart) childEditPart).setLabel(
getPrimaryShape().getFigureTopicNameFigure());
return true;
}
return false;
}

The return type of getPrimaryShape() is
org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel, and there is no
method getFigureTopicNameFigure() in this class.

The strange thing is that the WrapLabel class is an API class and it would
never have a method based on my model (TopicNameFigure is defined on the
Graphical Definition). This seams like a bug to me, but maybe I'm wrong.

Another interesting thing is that the error disappers if I remove the
Feature Label Mapping on the Mapping Definition. So I guess this is the
place to investigate further, but I'm clueless since I'm a GMF newbie.

I'm using Eclipse 3.3M4 and GMF 2.0.0.v20070103 available on the Europa
update site.

Any suggestions on what to do now?

Regards,
Adolfo Correia
Re: Diagram code generation generates invalid code [message #119466 is a reply to message #119283] Mon, 16 April 2007 11:09 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Adolfo,

Looks like you've used standalone DiagramLabel for TopicName. AFAIU, this
label should be child figure of TopicFiogure..

-----------------
Alex Shatalin
Previous Topic:Displaying link between 2 models
Next Topic:Can GMF work with dynamic EMF?
Goto Forum:
  


Current Time: Sun Oct 06 06:57:18 GMT 2024

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

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

Back to the top