[Draw2d] Max dimension, layout & BlocFlow [message #136592] |
Mon, 07 June 2004 06:10  |
Eclipse User |
|
|
|
Originally posted by: christophe.labouisse.mycom-int.com
I have to make a tooltip including a description. Since this description
can be of arbitrary length, though of using the flow capability of draw2d.
I did the following:
- Create a MyTooltip class extending Figure (I also try Panel),
- Add a Layout manager,
- Add a FlowPage to MyTooltip,
- Add some BlockFlow to this page.
So far everything works fine except that I cannot find a
contraints/layout/set(Min|Max|Prefered)Size combination allowing to
tooltip not to exceed a max width by "flowing" the description on several
lines if needed (It'll also be nice to "..." the text if the tooltip reach
a max height but I'll live without it).
Currently I only manage to have either a tooltip with a "right" size for
the description text but displaying the text on one loooong line instead
of breaking it, having a obscenely big size even when holding only a
couple of words and having a tooltip "clipped" to a maximum width but
keeping only a one line height.
Any hint?
PS: Using Eclipse 3.0RC1 Draw2d 20040603 (?)
|
|
|
Re: [Draw2d] Max dimension, layout & BlocFlow [message #136655 is a reply to message #136592] |
Mon, 07 June 2004 10:02   |
Eclipse User |
|
|
|
Originally posted by: rlemaigr.ulb.ac.be
Hello christoffe,
I never used the text package nor tooltips (or almost never) so this is =
=
not really an "answer" you will have to wait for the specialists...
Looking at the method which shows the tooltip, it seems (I'm not 100% =
sure) that the method is giving the tooltip its preferred size.
Are you sure the preferred size which is returned by the getPreferredSiz=
e =
method of the tooltip is the one you specified ?
Maybe you could try to override the method getPreferredSize(int hinta, i=
nt =
hintb) in your tooltip class like,
public Dimension getPreferredSize(int a, int b)
{
return new Dimension(100,100);//for example...
}
just to be absolutly sure that the returned preferred size is what you =
want, just to see what happens then...That costs nothing to try...
There is also the fact that the text layout manager when he computes the=
=
preferred size of the text should know about the how many lines or how =
many rows (or how many pixels...don't know...) are available, I think. S=
o =
the problem may come from the "hints" given to the getPreferredSize meth=
od =
of the Figure where the text is written...
These are just ideas...nothing sure...
r=E9gis
On Mon, 07 Jun 2004 12:10:14 +0200, Christophe Labouisse =
<christophe.labouisse@mycom-int.com> wrote:
> I have to make a tooltip including a description. Since this descripti=
on
> can be of arbitrary length, though of using the flow capability of =
> draw2d.
> I did the following:
>
> - Create a MyTooltip class extending Figure (I also try Panel),
> - Add a Layout manager,
> - Add a FlowPage to MyTooltip,
> - Add some BlockFlow to this page.
>
> So far everything works fine except that I cannot find a
> contraints/layout/set(Min|Max|Prefered)Size combination allowing to
> tooltip not to exceed a max width by "flowing" the description on seve=
ral
> lines if needed (It'll also be nice to "..." the text if the tooltip =
> reach
> a max height but I'll live without it).
>
> Currently I only manage to have either a tooltip with a "right" size f=
or
> the description text but displaying the text on one loooong line inste=
ad
> of breaking it, having a obscenely big size even when holding only a
> couple of words and having a tooltip "clipped" to a maximum width but
> keeping only a one line height.
>
> Any hint?
>
> PS: Using Eclipse 3.0RC1 Draw2d 20040603 (?)
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05574 seconds