How to get editor bounds? [message #231738] |
Fri, 16 March 2007 08:10  |
Eclipse User |
|
|
|
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 #231873 is a reply to message #231771] |
Mon, 19 March 2007 15:39  |
Eclipse User |
|
|
|
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
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.39357 seconds