Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to get editor bounds?
How to get editor bounds? [message #231738] Fri, 16 March 2007 12:10 Go to next message
Eclipse UserFriend
Originally posted by: michele.l.evinco.it

is possible to get the editor bounds to write a figure with the same
bounds of the editor?

I've tryed with
Rectangle rectangle =(GraphicalEditPart)getRoot()).getFigure().getBounds();

inside the method createFigure of my EditPart

but the rectangle have x,y,width,height set to 0!

any suggestions?

Thanks
Michele
Re: How to get editor bounds? [message #231755 is a reply to message #231738] Fri, 16 March 2007 13:40 Go to previous messageGo to next message
Anthony Hunter is currently offline Anthony HunterFriend
Messages: 446
Registered: July 2009
Senior Member
Hi Michele

I can get the bounds correctly when casting to ScalableRootEditPart.

You can set the layout constraint in refreshVisuals() in your node EditPart.

Cheers...
Anthony

"michele" <michele.l@evinco.it> wrote in message
news:ete1ep$9p1$1@utils.eclipse.org...
> is possible to get the editor bounds to write a figure with the same
> bounds of the editor?
>
> I've tryed with
> Rectangle rectangle
> =(GraphicalEditPart)getRoot()).getFigure().getBounds();
>
> inside the method createFigure of my EditPart
>
> but the rectangle have x,y,width,height set to 0!
>
> any suggestions?
>
> Thanks
> Michele
Re: How to get editor bounds? [message #231771 is a reply to message #231755] Fri, 16 March 2007 13:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: michele.l.evinco.it

Hi Anthony,

I must do this in createFigures because i create an image from a raster
and i must generate the image by passing width and height i've try
casting to ScalableRootEditPart but the result is the same! always 0!

Anthony Hunter wrote:
> Hi Michele
>
> I can get the bounds correctly when casting to ScalableRootEditPart.
>
> You can set the layout constraint in refreshVisuals() in your node EditPart.
>
> Cheers...
> Anthony
>
> "michele" <michele.l@evinco.it> wrote in message
> news:ete1ep$9p1$1@utils.eclipse.org...
>
>>is possible to get the editor bounds to write a figure with the same
>>bounds of the editor?
>>
>>I've tryed with
>>Rectangle rectangle
>>=(GraphicalEditPart)getRoot()).getFigure().getBounds();
>>
>>inside the method createFigure of my EditPart
>>
>>but the rectangle have x,y,width,height set to 0!
>>
>>any suggestions?
>>
>>Thanks
>>Michele
>
>
>
Re: How to get editor bounds? [message #231873 is a reply to message #231771] Mon, 19 March 2007 19:39 Go to previous message
Anthony Hunter is currently offline Anthony HunterFriend
Messages: 446
Registered: July 2009
Senior Member
Hi Michele,

This should work:

Set the layout constraint in refreshVisuals() in your EditPart.
Then in paintFigure() in your Figure you can draw the image since you have
the correct bounds.

Cheers...
Anthony

"michele" <michele.l@evinco.it> wrote in message
news:ete7sv$ong$1@utils.eclipse.org...
> Hi Anthony,
>
> I must do this in createFigures because i create an image from a raster
> and i must generate the image by passing width and height i've try casting
> to ScalableRootEditPart but the result is the same! always 0!
>
> Anthony Hunter wrote:
>> Hi Michele
>>
>> I can get the bounds correctly when casting to ScalableRootEditPart.
>>
>> You can set the layout constraint in refreshVisuals() in your node
>> EditPart.
>>
>> Cheers...
>> Anthony
>>
>> "michele" <michele.l@evinco.it> wrote in message
>> news:ete1ep$9p1$1@utils.eclipse.org...
>>
>>>is possible to get the editor bounds to write a figure with the same
>>>bounds of the editor?
>>>
>>>I've tryed with
>>>Rectangle rectangle
>>>=(GraphicalEditPart)getRoot()).getFigure().getBounds();
>>>
>>>inside the method createFigure of my EditPart
>>>
>>>but the rectangle have x,y,width,height set to 0!
>>>
>>>any suggestions?
>>>
>>>Thanks
>>>Michele
>>
>>
Previous Topic:Re: Process For Finding Out About a Project
Next Topic:3D opengl diagrams contribution to GEF offer
Goto Forum:
  


Current Time: Thu Mar 28 19:39:22 GMT 2024

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

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

Back to the top