How to resize the Chart [message #148795] |
Tue, 28 March 2006 01:59  |
Eclipse User |
|
|
|
Originally posted by: amitgolwala.gmail.com
Hello,
I am using Chart engine API to generate BIRT Chart at runtime and
displaying it in a View. I did read the previous thread with the subject
"Birt charts flicker on resize" dated 6th March (If want more details abt
the thread then the link is -
http://dev.eclipse.org/newslists/news.eclipse.birt/msg07017. html). As per
the solution suggested in the thread regarding Double-Buffering, I too
implemented IUpdateNotifier Interface. It works absoulutely fine for me
and the way it should work.
Now, whenever the view containing the chart is opened (showed) the chart
covers the full client area of the view (which is fine). But the issue is
that - whenever i try to resize the view, the view is resized, however
there is no effect on the size of chart i.e. chart still remains of the
same size as it was when the view was displayed for the first time. Hence,
making some of chart data invisible. Similarly the other way round, i.e.
if the view occupies quarter of the editor area on the plugin startup
then, the chart is displayed perfectly with in the view as intended but
when the view is maximized the size of the chart is not resized and is
still of the same size (quarter of editor area). I hope that my problem do
make sense.
Please have a look at the following link that shows the implementation of
IUpdateNotifier interface for chart generation.
https://bugs.eclipse.org/bugs/attachment.cgi?id=31183&ac tion=view
If possible then do suggest a solution keeping in mind the example in the
link above....
cheeers !!
thnx for readin !!
waiting for reply !!
Amit !!
|
|
|
Re: How to resize the Chart [message #148923 is a reply to message #148795] |
Tue, 28 March 2006 08:33   |
Eclipse User |
|
|
|
Does it call paintControl when you resize the view? If not, you might be
missing a resize listener somewhere.
Thanks,
David
"Amit Golwala" <amitgolwala@gmail.com> wrote in message
news:476ee24e0a5384ba75d96e64c6c1afb8$1@www.eclipse.org...
> Hello,
>
> I am using Chart engine API to generate BIRT Chart at runtime and
> displaying it in a View. I did read the previous thread with the subject
> "Birt charts flicker on resize" dated 6th March (If want more details abt
> the thread then the link is -
> http://dev.eclipse.org/newslists/news.eclipse.birt/msg07017. html). As per
> the solution suggested in the thread regarding Double-Buffering, I too
> implemented IUpdateNotifier Interface. It works absoulutely fine for me
> and the way it should work.
> Now, whenever the view containing the chart is opened (showed) the chart
> covers the full client area of the view (which is fine). But the issue is
> that - whenever i try to resize the view, the view is resized, however
> there is no effect on the size of chart i.e. chart still remains of the
> same size as it was when the view was displayed for the first time. Hence,
> making some of chart data invisible. Similarly the other way round, i.e.
> if the view occupies quarter of the editor area on the plugin startup
> then, the chart is displayed perfectly with in the view as intended but
> when the view is maximized the size of the chart is not resized and is
> still of the same size (quarter of editor area). I hope that my problem do
> make sense.
> Please have a look at the following link that shows the implementation of
> IUpdateNotifier interface for chart generation.
> https://bugs.eclipse.org/bugs/attachment.cgi?id=31183&ac tion=view
>
> If possible then do suggest a solution keeping in mind the example in the
> link above....
>
> cheeers !!
> thnx for readin !!
> waiting for reply !!
>
> Amit !!
>
|
|
|
Re: How to resize the Chart [message #149153 is a reply to message #148923] |
Tue, 28 March 2006 21:09  |
Eclipse User |
|
|
|
Originally posted by: amitgolwala.gmail.com
Thnks David,
I got it working and if someones interested then following is the solution.
First of all, I didnt at all implement Listener for resize event, but then
I finally did it in the manner:
parent.addListener (SWT.Resize, new ResizeListener())
(parent is an object of Composite class for containing my chart)
and in my ResizeListener() class's handleEvent() method I have just set
the boolean flag called "needsGeneration" to true suggesting that
Regeneration of chart is indeed needed. And, finally a call to redraw i.e.
parent.redraw() i.e.
private class ResizeListener implements Listener {
public void handleEvent(Event event) {
needsGeneration = true;
parent.redraw();
}
}
thanx all for reading the thread !!
Amit !!
|
|
|
Powered by
FUDForum. Page generated in 0.03545 seconds