|
|
|
|
Re: Non-deterministic behaviour in CustomFeature [message #1228920 is a reply to message #1219318] |
Wed, 08 January 2014 10:50 |
Soeren M Messages: 77 Registered: September 2011 |
Member |
|
|
Sorry that I didnt answered you. Had a lot of stuff to do here.
Ive just created an example project and made a small example and I cant reproduce this behaviour.
Thats a little bit annoying for me, but good for you
EDIT: I got it now. And I now where the error comes from... In the example its a little bit hacked, but the flow is the same.
I think those lines messed it up:
IGaService gaService = Graphiti.getGaService();
GraphicsAlgorithm ga = context.getPictogramElements()[0].getGraphicsAlgorithm();
int x = ga.getX();
int y = ga.getY();
Rectangle roundedRectangle = gaService.createRectangle(cs);
roundedRectangle.setForeground(manageColor(E_CLASS_FOREGROUND));
roundedRectangle.setBackground(manageColor(E_CLASS_BACKGROUND));
roundedRectangle.setLineWidth(2);
gaService.setLocationAndSize(roundedRectangle, x, y, 100, 50);
In the end, I dont know why I did this, what I remember is that the state moves his position. Thats the only idea why I did it this way...
I changed it to the normal way:
ga.setWidth(100 * (cs.getChildren().size() - 1));
ga.setHeight(50 * cs.getChildren().size());
ga.setBackground(manageColor(E_CLASS_BACKGROUND));
ga.setForeground(manageColor(new ColorConstant(98, 131, 167)));
Thanks for the hint with a small example, I think without it I would have never figured it out. TY
[Updated on: Wed, 08 January 2014 11:14] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03943 seconds