Draw2D does not work correct when I change the Label font size [message #202389] |
Wed, 09 November 2005 08:40  |
Eclipse User |
|
|
|
Originally posted by: cleversons.gmail.com
Hi,
I'm having some problems with draw2D. I'm drawing a graph structure made
of nodes. Each node is a box containing 5 labels in one column. The box is
a Figure object with its layout set to ToolbarLayout. As the node
structure is very simple, just boxes with labels inside, I've implemented
the zoom functionality by just changing the font size of the labels inside
the boxes. So, each time the zoom in or zoom out actions are pressed, I
first create a new Font object greather or smaller than the current on
depending on which zoom has been pressed and then I request the figures to
update throuhg a call to invalidateTree on the main layer.
The problem is that sometimes when the zoom in is requested, the labels
are drawn in a messy way, overlapping each other. Instead of being placed
in one separated row (as ToolbarLayout is supposed to work), just half of
each label is drawn leading to a cluttered figure.
Does any of you has ever experienced this problem before?
Thank you very much.
By the way, I'm using the 3.0.1 version
Best Regards
Cleverson Schmidt
|
|
|
Re: Draw2D does not work correct when I change the Label font size [message #202469 is a reply to message #202389] |
Wed, 09 November 2005 16:26   |
Eclipse User |
|
|
|
I just use the zoom functionality that comes with GEF (ZoomInRetargetAction
and ZoomOutRetargetAction). It's not perfect but it seems to work better
than what you describe...
"Cleverson Schmidt" <cleversons@gmail.com> wrote in message
news:6b663dfe3ed7f90cbbbe9a5450f41120$1@www.eclipse.org...
> Hi,
>
> I'm having some problems with draw2D. I'm drawing a graph structure made
> of nodes. Each node is a box containing 5 labels in one column. The box is
> a Figure object with its layout set to ToolbarLayout. As the node
> structure is very simple, just boxes with labels inside, I've implemented
> the zoom functionality by just changing the font size of the labels inside
> the boxes. So, each time the zoom in or zoom out actions are pressed, I
> first create a new Font object greather or smaller than the current on
> depending on which zoom has been pressed and then I request the figures to
> update throuhg a call to invalidateTree on the main layer.
>
> The problem is that sometimes when the zoom in is requested, the labels
> are drawn in a messy way, overlapping each other. Instead of being placed
> in one separated row (as ToolbarLayout is supposed to work), just half of
> each label is drawn leading to a cluttered figure.
>
> Does any of you has ever experienced this problem before?
>
> Thank you very much.
>
> By the way, I'm using the 3.0.1 version
>
> Best Regards
>
> Cleverson Schmidt
>
|
|
|
|
|
|
|
|
Re: Draw2D does not work correct when I change the Label font size [message #202734 is a reply to message #202603] |
Fri, 11 November 2005 14:04  |
Eclipse User |
|
|
|
Originally posted by: cleversons.gmail.com
I've fixe the problem changing the way I do the zoom implementation.
Instead of just changing the label's font size, my application now sets
the scale of the root layer so that all the inner layer are scalled. I had
to change the anchor of the connections because they were not being
scaled. But now everything works good.
Thank you guys.
|
|
|
Powered by
FUDForum. Page generated in 0.04241 seconds