Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325204 - RAP: Use PNG renderer
Summary: RAP: Use PNG renderer
Status: VERIFIED FIXED
Alias: None
Product: MAT
Classification: Tools
Component: GUI (show other bugs)
Version: 1.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.14.0   Edit
Assignee: Andrew Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 262603
  Show dependency tree
 
Reported: 2010-09-14 04:34 EDT by Andrew Johnson CLA
Modified: 2023-03-20 05:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Johnson CLA 2010-09-14 04:34:16 EDT
From bug 262603:
* Charts: Rewrote to use PNG renderer instead of SWT. This was necessary as RAP
does not support a full-fledged GC to support all BIRT needs. Instead of
drawing the chart onto a canvas, we now just create the image file and use a
Label to display it.
Comment 1 Andrew Johnson CLA 2023-02-19 03:00:31 EST
Using the changes in https://bugs.eclipse.org/bugs/attachment.cgi?id=187550&action=diff#src/org/eclipse/mat/ui/internal/chart/ChartCanvas.java_sec1 as a guide this can be done.

Modifications - RAP now has paint events, so that doesn't need to be changed.
renderer.setProperty(IDeviceRenderer.FILE_IDENTIFIER can now take an OutputStream as well as a File, so we can use a ByteArrayOutputStream and avoid the temporary file.

To aid single sourcing, we can try the dv.SWT renderer first, then if that fails go to dv.PNG and do the RAP processing. The org.eclipse.birt.chart.device.swt bundle can be optional - so the code can work as before with RCP.

As with the example patch, setting the background image on the canvas works - no need for a label.

Limitation - with the PNG renderer there is no hover selection of a item in the pie chart as inspector view item.
Comment 2 Eclipse Genie CLA 2023-02-19 03:04:40 EST
New Gerrit change created: https://git.eclipse.org/r/c/mat/org.eclipse.mat/+/199996