Skip to main content



      Home
Home » Eclipse Projects » GEF » XYLayoutEditPolicy - I don't get it to work
XYLayoutEditPolicy - I don't get it to work [message #165248] Sun, 23 January 2005 03:29 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:How can I add some text to a connection?
Next Topic:Two GEF views
Goto Forum:
  


Current Time: Sat May 10 19:10:12 EDT 2025

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

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

Back to the top