Skip to main content



      Home
Home » Eclipse Projects » GEF » ToolbarLayout with fixed size figure
ToolbarLayout with fixed size figure [message #182917] Mon, 30 May 2005 12:23 Go to next message
Eclipse UserFriend
Originally posted by: samiwazni.msn.com

Hi,

I tried after reading newsgroup without success.
I've a container figure say ContainerFigure having an horizontal
toolbarlayout.
This ContainerFigure add FigA having an horizontal toolbarlayout.

Now FigA add N labels.

I tried label.setPreferredSize(cellWidth,-1) and the result is that the
toolbarlayout arrange labels depending on their text size (default
behavior).

I want each label have a fixed width even if their text size is larger or
less than the fixed width. How shoul I proceed ?

Many thanks.
Re: ToolbarLayout with fixed size figure [message #182965 is a reply to message #182917] Mon, 30 May 2005 20:35 Go to previous messageGo to next message
Eclipse UserFriend
You can't set the preferred height to be -1. Override your labels'
getPreferredSize(wHint, hHint) method to change the wHint to 150 and then
call super. Don't set the preferred size.

"Sami" <samiwazni@msn.com> wrote in message
news:e97bdb213ad3ad5318c4cde392229aa7$1@www.eclipse.org...
> Hi,
>
> I tried after reading newsgroup without success.
> I've a container figure say ContainerFigure having an horizontal
> toolbarlayout.
> This ContainerFigure add FigA having an horizontal toolbarlayout.
>
> Now FigA add N labels.
>
> I tried label.setPreferredSize(cellWidth,-1) and the result is that the
> toolbarlayout arrange labels depending on their text size (default
> behavior).
>
> I want each label have a fixed width even if their text size is larger or
> less than the fixed width. How shoul I proceed ?
>
> Many thanks.
>
Re: ToolbarLayout with fixed size figure [message #183118 is a reply to message #182965] Tue, 31 May 2005 10:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: samiwazni.msn.com

Thanks for your answer.
Overriding getPreferedSize using a fixed wHint value (150) don't seem to
answer all my needs.

My requirement is the following:

I want actually to change dynamically the label width. That is, after the
changes, all labels in FigA must have the same new fixed width.

ContainerFigure (horizontal) include many sequencial figures (FigA, FigB,
...)
For example
FigA include 10 sequential labels whose width are 20 (even if text width
is >20 or < 20)
FigB include 20 sequential labels whose width are 30, etc ...

FigA width must be equal to 10 * 20
FigB width must be equal to 20 * 30
ContainerFigure width must be equal to FigA width plus FigB width

Should I continu using ToolBarLayout. If yes, could you please tell me
more on how to proceed.
Many thanks.
Re: ToolbarLayout with fixed size figure [message #183119 is a reply to message #183118] Tue, 31 May 2005 11:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: samiwazni.msn.com

I forgot to say that the label has a LineBorder that must have the given
width.
Re: ToolbarLayout with fixed size figure [message #183142 is a reply to message #183119] Tue, 31 May 2005 11:58 Go to previous message
Eclipse UserFriend
Originally posted by: samiwazni.msn.com

In fact, I'm using the ToolBarLayout just for adding figures in sequence
without worrying about the sequence problem. At the same time, I would
like to keep control on the figures size (schown via their border).
I already can do that using XYLayout which would require to manage x and y.
As I have a lot of different composed sequential figures, I would prefer
use the toolbaylayout if possible.

Many thanks.
Previous Topic:is there any example that demonstrate how to split the model
Next Topic:How to activate property sheets to gef edit parts
Goto Forum:
  


Current Time: Sun Aug 31 10:21:52 EDT 2025

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

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

Back to the top