XYLayoutEditPolicy - I don't get it to work [message #165248] |
Sun, 23 January 2005 03:29  |
Eclipse User |
|
|
|
Originally posted by: me.here.com
Hi.
Im trying to build my first GEF Editor (GEF 3.0.1), which sould contain
some parts to move around.
The editor and the contents gets displayed correctly, but if i try to
move the part around, i get NullPointerExceptions.
This happens in
XYLayoutEditPolicy.getConstraintFor(ChangeBoundsRequest request,
GraphicalEditPart child)
at
if (request.getSizeDelta().width == 0 && request.getSizeDelta().height
== 0) { // move
Rectangle cons = getCurrentConstraintFor(child);
rect.setSize(cons.width, cons.height);
} else { // resize
The rectangle returned by getCurrentConstraintFor is 'null'
So i stepped in and did override a method to return an empty rectangle.
After that i get an error message "Figure is not a child"
I searched this newsgroup, looked at some examples (e.g. the logic
example) and i don't find my mistake.
Thanks in advance for your help.
|
|
|
Re: XYLayoutEditPolicy - I don't get it to work [message #165277 is a reply to message #165248] |
Sun, 23 January 2005 09:38  |
Eclipse User |
|
|
|
Originally posted by: me.here.com
Howdy.
Solved the Problem.
A combination of missing setLayoutConstraints in refreshVisuals and the
try to move the wrong figure - silly mistake.
bye
Thomas Piekarski wrote:
>
> Hi.
>
> Im trying to build my first GEF Editor (GEF 3.0.1), which sould contain
> some parts to move around.
> The editor and the contents gets displayed correctly, but if i try to
> move the part around, i get NullPointerExceptions.
> This happens in
>
> XYLayoutEditPolicy.getConstraintFor(ChangeBoundsRequest request,
> GraphicalEditPart child)
>
> at
>
> if (request.getSizeDelta().width == 0 && request.getSizeDelta().height
> == 0) { // move
> Rectangle cons = getCurrentConstraintFor(child);
> rect.setSize(cons.width, cons.height);
> } else { // resize
>
>
> The rectangle returned by getCurrentConstraintFor is 'null'
>
> So i stepped in and did override a method to return an empty rectangle.
> After that i get an error message "Figure is not a child"
>
> I searched this newsgroup, looked at some examples (e.g. the logic
> example) and i don't find my mistake.
>
> Thanks in advance for your help.
|
|
|
Powered by
FUDForum. Page generated in 0.02688 seconds