Text displayed in a thumbnail [message #169467] |
Wed, 23 February 2005 11:20  |
Eclipse User |
|
|
|
Originally posted by: alain.origlia.impika.com
Hi all,
I run into this problem:
I want to display a thumbnail of a figure which contains some text. I use
the StickyNoteFigure of the logic example as the figure to display in the
thumbnail.
Here is the code:
LightweightSystem lws = new LightweightSystem(overview); // overview is some
canvas
Thumbnail thumbnail = new Thumbnail();
StickyNoteFigure fig = new StickyNoteFigure();
fig.setText("The text to display");
fig.setBounds(new Rectangle(0, 0 , 300, 200));
thumbnail.setSource(fig);
lws.setContents(thumbnail);
If I run the code, I can see the yellow figure but it is empty. No text is
displayed. I don't know why. Any idea?
Thanks,
Alain
|
|
|
|
|
Re: Text displayed in a thumbnail [message #170952 is a reply to message #169530] |
Tue, 08 March 2005 01:16  |
Eclipse User |
|
|
|
That's because the StickyNoteFigure doesn't exist anywhere, except in
memory. It's not in a lightweight system, doesn't have a parent or an
update manager or a font, and is never laid out or painted.
"Alain Origlia" <alain.origlia@impika.com> wrote in message
news:cvk4h7$fn3$1@www.eclipse.org...
> Thanks for your suggestion Randy.
> The StickyNoteFigure uses a TextFlow. When I debug, I see that the
TextFlow
> does not paint correctly. The text fragments list is empty and the
> paintFigure method of the TextFlow class returns immediately without
> displaying any piece of text.
> When I use this figure in my editor, it works properly. I don't understand
> why within the thumbnail the fragments list is empty.
>
>
> "Randy Hudson" <none@us.ibm.com> a
|
|
|
Powered by
FUDForum. Page generated in 0.28169 seconds