RotatedLabelPresentationImpl class
The RotatedLabelPresentationImpl class specifies how to process and render a report item at presentation time. RotatedLabelPresentationImpl extends the org.eclipse.birt.report.engine.extension.ReportItemPresentationBase class.
The method, onRowSets( ), renders the rotated label report item as an image, rotated by the angle specified in the report design, as shown in Listing 23‑3.
Listing 23‑3 The onRowSets( ) method
public Object onRowSets(IRowSet[ ] rowSets) throws BirtException
{
if ( modelHandle == null )
{
return null;
}
graphicsUtil = new GraphicsUtil( );
org.eclipse.swt.graphics.Image rotatedImage =
graphicsUtil.createRotatedText( modelHandle );
ImageLoader imageLoader = new ImageLoader( );
imageLoader.data = new ImageData[ ]
{ rotatedImage.getImageData( ) };
ByteArrayOutputStream baos = new ByteArrayOutputStream( );
imageLoader.save( baos, SWT.IMAGE_JPEG );
return baos.toByteArray( );
}