Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF Editor Migration Problems
GMF Editor Migration Problems [message #373051] Wed, 29 July 2009 12:30 Go to next message
Eclipse UserFriend
Originally posted by: matrium.web.de

Hi,

I'm trying to migrate a visual editor from gmf1 to gmf2. After migrating
the gmfgen file to version 2.1 and generatin the diagram code some figures
aren't shown(for example the rhombus figure).

/**
* @generated
*/
public class RhombusFigure extends Layer {

/**
* @generated
*/
public RhombusFigure() {

this.setPreferredSize(getMapMode().DPtoLP(150), getMapMode()
.DPtoLP(100));
this.setMaximumSize(new Dimension(getMapMode().DPtoLP(200),
getMapMode().DPtoLP(175)));
this.setMinimumSize(new Dimension(getMapMode().DPtoLP(50),
getMapMode().DPtoLP(45)));

createContents();
}

/**
* @generated
*/
private void createContents() {
RectangleFigure fig_0 = new RectangleFigure();
fig_0.setFill(false);
fig_0.setOutline(false);

setFigureRohmbusContainer(fig_0);

Object layData0 = null;

this.add(fig_0, layData0);
Polygon fig_1 = new Polygon();

fig_1.addPoint(new Point(75, 0));
fig_1.addPoint(new Point(0, 50));
fig_1.addPoint(new Point(75, 100));
fig_1.addPoint(new Point(150, 50));

Object layData1 = null;

fig_0.add(fig_1, layData1);
}

/**
* @generated
*/
private RectangleFigure fRohmbusContainer;

/**
* @generated
*/
public RectangleFigure getFigureRohmbusContainer() {
return fRohmbusContainer;
}

/**
* @generated
*/
private void setFigureRohmbusContainer(RectangleFigure fig) {
fRohmbusContainer = fig;
}

/**
* @generated
*/
private boolean myUseLocalCoordinates = false;

/**
* @generated
*/
protected boolean useLocalCoordinates() {
return myUseLocalCoordinates;
}

/**
* @generated
*/
protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
myUseLocalCoordinates = useLocalCoordinates;
}

}

A new rhombus figure is created in the
DataPropertyEditPart.createNodeFigure() method and is set as the content
pane of the edit part but the rhombus figure is never painted in my
editor. It works fine for gmf1.

Greetings

Fabian
Re: GMF Editor Migration Problems [message #422543 is a reply to message #373051] Thu, 30 July 2009 12:25 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Fabian,

Can you compare old and new figure code - is there any differences?
BTW, I do not understand why figure was moved to the different EditPart.
Was something changed in .gmfmap model?..

-----------------
Alex Shatalin
Previous Topic:Customize label parser
Next Topic:Child setLocation
Goto Forum:
  


Current Time: Fri Mar 05 20:50:39 GMT 2021

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

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

Back to the top