Skip to main content



      Home
Home » Archived » BIRT » Implementing IReportItemFigureProvider to allow drag-resizing of custom report objects in report des
Implementing IReportItemFigureProvider to allow drag-resizing of custom report objects in report des [message #259682] Fri, 26 October 2007 12:29 Go to next message
Eclipse UserFriend
Originally posted by: vince.darley.eurobios.com

I've managed to learn enough from the sample 'rotatedtext' plugin to
build our own plugin to contribute a Map (from the open source 'udig'
project) as a custom report element. I can happily drag the map to my
report, edit some custom attributes (and edit the standard width,
height) in my 'AttributePage'. I can then create the report (pdf, html,
etc) and the map is rendered as an image in the report very nicely.

What I'd like the Map report element to do is behave like an Image,
where you can grab a corner or edge to resize it dynamically in the
report designer, and when you let go of the corner/edge the image
remembers the new size and displays in the new size (in the designer as
well as in the final report, of course).

But, the Map report element doesn't behave well when I grab a corner of
it and try to resize it. If I use a 'IReportItemLabelProvider' the
moment I let go of the corner, it springs back to a small size (the
dimensions in the AttributePage do update and are remembered, but
visually nothing changes in the designer). If instead I use a
'IReportItemFigureProvider' things are slightly better, in that I can
keep track of certain information through the
updateFigure(ExtendedItemHandle handle, IFigure figure) method, but
still things don't behave like an Image.

Are there any instructions on how to implement
createFigure/updateFiguree correctly to allow this capability? How can
I access the size at which the user let go of the corner, and how do I
set/store that so that the designer knows the new size of the element?

thanks for any advice (or pointers to existing code that does this),

Vince.
Re: Implementing IReportItemFigureProvider to allow drag-resizing of custom report objects in report [message #259698 is a reply to message #259682] Fri, 26 October 2007 15:05 Go to previous messageGo to next message
Eclipse UserFriend
Hi Vince,

You could look into the chart implementation, it is also built as an
extension item and can be resized correctly in the BIRT designer.

Thanks,

David

"Vince Darley" <vince.darley@eurobios.com> wrote in message
news:fft4mb$vto$1@build.eclipse.org...
> I've managed to learn enough from the sample 'rotatedtext' plugin to build
> our own plugin to contribute a Map (from the open source 'udig' project)
> as a custom report element. I can happily drag the map to my report, edit
> some custom attributes (and edit the standard width, height) in my
> 'AttributePage'. I can then create the report (pdf, html, etc) and the
> map is rendered as an image in the report very nicely.
>
> What I'd like the Map report element to do is behave like an Image, where
> you can grab a corner or edge to resize it dynamically in the report
> designer, and when you let go of the corner/edge the image remembers the
> new size and displays in the new size (in the designer as well as in the
> final report, of course).
>
> But, the Map report element doesn't behave well when I grab a corner of it
> and try to resize it. If I use a 'IReportItemLabelProvider' the moment I
> let go of the corner, it springs back to a small size (the dimensions in
> the AttributePage do update and are remembered, but visually nothing
> changes in the designer). If instead I use a 'IReportItemFigureProvider'
> things are slightly better, in that I can keep track of certain
> information through the updateFigure(ExtendedItemHandle handle, IFigure
> figure) method, but still things don't behave like an Image.
>
> Are there any instructions on how to implement createFigure/updateFiguree
> correctly to allow this capability? How can I access the size at which
> the user let go of the corner, and how do I set/store that so that the
> designer knows the new size of the element?
>
> thanks for any advice (or pointers to existing code that does this),
>
> Vince.
Re: Implementing IReportItemFigureProvider to allow drag-resizing of custom report objects in report [message #259702 is a reply to message #259698] Fri, 26 October 2007 18:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vince.darley.eurobios.com

David Michonneau wrote:
> You could look into the chart implementation, it is also built as an
> extension item and can be resized correctly in the BIRT designer.

Thanks - 'ChartReportItemUIImpl' looks ideal. It also looks
astonishingly complex -- 'updateFigure' is 120 lines of code! Seems
I'll have to copy/paste the whole lot, which suggests the BIRT design
and/or helper classes need a bit of work...

thanks for the pointer!

Vince.
Re: Implementing IReportItemFigureProvider to allow drag-resizing of custom report objects in report [message #259750 is a reply to message #259702] Mon, 29 October 2007 09:45 Go to previous messageGo to next message
Eclipse UserFriend
I just reviewed the code and it indeeds needs some refactoring. Thanks for
pointing it out.

David

"Vince Darley" <vince.darley@eurobios.com> wrote in message
news:ffto4p$ra0$1@build.eclipse.org...
> David Michonneau wrote:
>> You could look into the chart implementation, it is also built as an
>> extension item and can be resized correctly in the BIRT designer.
>
> Thanks - 'ChartReportItemUIImpl' looks ideal. It also looks astonishingly
> complex -- 'updateFigure' is 120 lines of code! Seems I'll have to
> copy/paste the whole lot, which suggests the BIRT design and/or helper
> classes need a bit of work...
>
> thanks for the pointer!
>
> Vince.
Re: Implementing IReportItemFigureProvider to allow drag-resizing of custom report objects in report [message #260037 is a reply to message #259750] Wed, 31 October 2007 06:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vince.darley.eurobios.com

David Michonneau wrote:
> I just reviewed the code and it indeeds needs some refactoring. Thanks for
> pointing it out.

I have my code almost working now (at least the updateFigure stuff is
all ok and I can drag resize the new report element). There's still a
glitch regarding when I first open the report, with the element being
shown the wrong size and various null pointer exceptions in the log (due
to the equivalent of get("chart.instance") returning null). But it's
pretty close.

What would be very helpful would be some default implementations which
provide a new "empty" report element which can be resized, moved, etc
(perhaps subject to certain constraints), can save/load some properties,
etc. I've had to copy and modify nearly 20 classes from the Chart
package. Even though some of them are fairly trivial, and others are
fairly boilerplate, that seems too many. Some should probably be moved
from 'chart' to BIRT's core extension packages as helpers.

If you are interested I can provide the work-in-progress code.

regards,

Vince.
Re: Implementing IReportItemFigureProvider to allow drag-resizing of custom report objects in report [message #260066 is a reply to message #260037] Wed, 31 October 2007 09:57 Go to previous messageGo to next message
Eclipse UserFriend
Sounds like a good idea indeed. If you have anything close to that, feel
free to contribute it in a bugzilla entry.

Thanks!

David

"Vince Darley" <vince.darley@eurobios.com> wrote in message
news:472852DD.1010007@eurobios.com...
> David Michonneau wrote:
>> I just reviewed the code and it indeeds needs some refactoring. Thanks
>> for pointing it out.
>
> I have my code almost working now (at least the updateFigure stuff is all
> ok and I can drag resize the new report element). There's still a glitch
> regarding when I first open the report, with the element being shown the
> wrong size and various null pointer exceptions in the log (due to the
> equivalent of get("chart.instance") returning null). But it's pretty
> close.
>
> What would be very helpful would be some default implementations which
> provide a new "empty" report element which can be resized, moved, etc
> (perhaps subject to certain constraints), can save/load some properties,
> etc. I've had to copy and modify nearly 20 classes from the Chart
> package. Even though some of them are fairly trivial, and others are
> fairly boilerplate, that seems too many. Some should probably be moved
> from 'chart' to BIRT's core extension packages as helpers.
>
> If you are interested I can provide the work-in-progress code.
>
> regards,
>
> Vince.
Re: Implementing IReportItemFigureProvider to allow drag-resizing of custom report objects in report [message #260731 is a reply to message #260066] Mon, 05 November 2007 18:26 Go to previous message
Eclipse UserFriend
Originally posted by: vince.darley.eurobios.com

David Michonneau wrote:
> Sounds like a good idea indeed. If you have anything close to that, feel
> free to contribute it in a bugzilla entry.

Just to be clear (since I realise my message can be interpreted as
saying I have something like that) -- there's no chance I'll have
anything close to that! What I can provide is some code that pretty
much "works" to produce a different report extension. This could be
used by someone experienced to help them realise quite how much is required.

But the lack of documentation and the vast amount of code/classes I seem
to need to copy from the chart for very basic functionality suggests
that someone actually involved in the development of BIRT will need to
sort this out.

Vince.

> "Vince Darley" <vince.darley@eurobios.com> wrote in message
> news:472852DD.1010007@eurobios.com...
>>
>> What would be very helpful would be some default implementations which
>> provide a new "empty" report element which can be resized, moved, etc
>> (perhaps subject to certain constraints), can save/load some properties,
>> etc. I've had to copy and modify nearly 20 classes from the Chart
>> package. Even though some of them are fairly trivial, and others are
>> fairly boilerplate, that seems too many. Some should probably be moved
>> from 'chart' to BIRT's core extension packages as helpers.
>>
>> If you are interested I can provide the work-in-progress code.
>>
>> regards,
>>
>> Vince.
>
>
Previous Topic:Charting: Making gaps in line chart from groups (instead of nulls)
Next Topic:Allow blank value
Goto Forum:
  


Current Time: Wed May 14 07:42:09 EDT 2025

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

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

Back to the top