GMF Editor Migration Problems [message #373051] |
Wed, 29 July 2009 08:30  |
Eclipse User |
|
|
|
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 08:25  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02934 seconds