Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 268036

Summary: revoke deprecated chart events
Product: z_Archived Reporter: Erdal Karaca <erdal.karaca.de>
Component: BIRTAssignee: Yulin Wang <Lionel.wyl>
Status: VERIFIED FIXED QA Contact: Maggie Shen <lshen>
Severity: normal    
Priority: P3 CC: bluesoldier
Version: 2.5.0Keywords: plan
Target Milestone: 2.5.0 M7   
Hardware: All   
OS: All   
URL: https://bugs.eclipse.org/bugs/show_bug.cgi?id=210913
Whiteboard: Autoed,G
Attachments:
Description Flags
Call before/afterComputations directly none

Description Erdal Karaca CLA 2009-03-11 03:11:36 EDT
As of bug 210913, there is a possibility to modify the axis' scale by providing a "scaling factor".
Unfortunately, this scaling factor can only be calculated once, thus it is static.
It is very hard to provide a dynamic value, e.g. one that takes the actual plot area's dimension into account.
Currently, this can be achieved by adding a proper chart event handler, i.e. "beforeComputations".
Yet, this event is marked depracated and is not propagated to the java handler, i.e. it would only work when a javascript event handler has been defined...

It will be very easy to provide such functionality when the proper chart events are propagated to java handler, too.

A patch is provided in bug 210913. See comments 19/20.
Comment 1 Yulin Wang CLA 2009-03-17 00:26:38 EDT
BeforeComputation/AfterComputation were deprecated in scripting enhancement. See the spec in http://wiki.eclipse.org/BPS18.
However, BeforeComputation/AfterComputation can't be replaced by BeforeGeneration/AfterGeneration, so it's needed in some cases.
Comment 2 Yulin Wang CLA 2009-03-19 02:54:07 EDT
Revoked the deprecated script method: beforeComputations and afterComputations, since they can't be replaced by beforeGenerations and afterGenerations respectively.
Also added new PlotComputation as super class of PlotWithAxes and PlotWithoutAxes, so user can use code assistance in js editor more effectively and chart engine can remove much duplicate code.
Comment 3 Erdal Karaca CLA 2009-03-19 03:09:44 EDT
Created attachment 129321 [details]
Call before/afterComputations directly

Yulin,
before/afterComupations are called reflectively.
They should be called directly as is done for the other events.

See patch...

Thanks!
Comment 4 Yulin Wang CLA 2009-03-19 03:18:03 EDT
(In reply to comment #3)
> Created an attachment (id=129321) [details]
> Call before/afterComputations directly
> 
> Yulin,
> before/afterComupations are called reflectively.
> They should be called directly as is done for the other events.
> 
> See patch...
> 
> Thanks!
> 

OK, it's done. 
I didn't realize it. Thanks for your reminding.
Comment 5 Maggie Shen CLA 2009-04-08 21:57:05 EDT
Verified on build 2.5.0 v20090409-0630.