Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » draw2d label setPreferredSize() method does not set prefSize
draw2d label setPreferredSize() method does not set prefSize [message #188545] Thu, 21 July 2005 07:53 Go to next message
Eclipse UserFriend
Originally posted by: nathanoj.gmail.com

hi all,

I am trying to set the preferred size of my Label inside a flowlayout
because i want it to have a fixed sized. i tried using setPreferredSize()
method and found out while debugging that label prefSize is being set to
null always because the Figure class calls the invalidate method of the
Label class(which sets prefSize to null again) after setting the prefSize.

I am using GEF 3.1 now.

Thanks and hope someone can enlighten me on this...
Re: draw2d label setPreferredSize() method does not set prefSize [message #188566 is a reply to message #188545] Thu, 21 July 2005 14:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Label uses that field to cache its own prefered size calculation.

"nathanoj" <nathanoj@gmail.com> wrote in message
news:dbnk85$o7p$1@news.eclipse.org...
> hi all,
>
> I am trying to set the preferred size of my Label inside a flowlayout
> because i want it to have a fixed sized. i tried using setPreferredSize()
> method and found out while debugging that label prefSize is being set to
> null always because the Figure class calls the invalidate method of the
> Label class(which sets prefSize to null again) after setting the prefSize.
>
> I am using GEF 3.1 now.
>
> Thanks and hope someone can enlighten me on this...
>
Re: draw2d label setPreferredSize() method does not set prefSize [message #188653 is a reply to message #188566] Fri, 22 July 2005 02:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nathanoj.gmail.com

Thanks for the reply sir.

So is there some other way i can fixed the size of the Label figure in a
flowlayout?

"Randy Hudson" <none@us.ibm.com> wrote in message
news:dboc04$na9$1@news.eclipse.org...
> Label uses that field to cache its own prefered size calculation.
>
> "nathanoj" <nathanoj@gmail.com> wrote in message
> news:dbnk85$o7p$1@news.eclipse.org...
>> hi all,
>>
>> I am trying to set the preferred size of my Label inside a flowlayout
>> because i want it to have a fixed sized. i tried using setPreferredSize()
>> method and found out while debugging that label prefSize is being set to
>> null always because the Figure class calls the invalidate method of the
>> Label class(which sets prefSize to null again) after setting the
>> prefSize.
>>
>> I am using GEF 3.1 now.
>>
>> Thanks and hope someone can enlighten me on this...
>>
>
>
Re: draw2d label setPreferredSize() method does not set prefSize [message #188669 is a reply to message #188653] Fri, 22 July 2005 03:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You'd have to override the way it calculates preferred size to just always
return the protected field.

"nathanoj" <nathanoj@gmail.com> wrote in message
news:dbpk1b$6en$1@news.eclipse.org...
> Thanks for the reply sir.
>
> So is there some other way i can fixed the size of the Label figure in a
> flowlayout?
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:dboc04$na9$1@news.eclipse.org...
>> Label uses that field to cache its own prefered size calculation.
>>
>> "nathanoj" <nathanoj@gmail.com> wrote in message
>> news:dbnk85$o7p$1@news.eclipse.org...
>>> hi all,
>>>
>>> I am trying to set the preferred size of my Label inside a flowlayout
>>> because i want it to have a fixed sized. i tried using
>>> setPreferredSize() method and found out while debugging that label
>>> prefSize is being set to null always because the Figure class calls the
>>> invalidate method of the Label class(which sets prefSize to null again)
>>> after setting the prefSize.
>>>
>>> I am using GEF 3.1 now.
>>>
>>> Thanks and hope someone can enlighten me on this...
>>>
>>
>>
>
>
Re: draw2d label setPreferredSize() method does not set prefSize [message #188677 is a reply to message #188669] Fri, 22 July 2005 05:51 Go to previous message
Eclipse UserFriend
Originally posted by: nathanoj.gmail.com

thanks again sir.

i just overriden the getPreferredSize method to return always the size that
I want for the label...

"Randy Hudson" <none@us.ibm.com> wrote in message
news:dbpo2d$9vl$1@news.eclipse.org...
> You'd have to override the way it calculates preferred size to just always
> return the protected field.
>
> "nathanoj" <nathanoj@gmail.com> wrote in message
> news:dbpk1b$6en$1@news.eclipse.org...
>> Thanks for the reply sir.
>>
>> So is there some other way i can fixed the size of the Label figure in a
>> flowlayout?
>>
>> "Randy Hudson" <none@us.ibm.com> wrote in message
>> news:dboc04$na9$1@news.eclipse.org...
>>> Label uses that field to cache its own prefered size calculation.
>>>
>>> "nathanoj" <nathanoj@gmail.com> wrote in message
>>> news:dbnk85$o7p$1@news.eclipse.org...
>>>> hi all,
>>>>
>>>> I am trying to set the preferred size of my Label inside a flowlayout
>>>> because i want it to have a fixed sized. i tried using
>>>> setPreferredSize() method and found out while debugging that label
>>>> prefSize is being set to null always because the Figure class calls the
>>>> invalidate method of the Label class(which sets prefSize to null again)
>>>> after setting the prefSize.
>>>>
>>>> I am using GEF 3.1 now.
>>>>
>>>> Thanks and hope someone can enlighten me on this...
>>>>
>>>
>>>
>>
>>
>
>
Previous Topic:scripting an editor in a JUnit test
Next Topic:Dragging figures does not resize editor
Goto Forum:
  


Current Time: Tue Dec 03 08:48:46 GMT 2024

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

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

Back to the top