Community
Participate
Working Groups
*
* Contributors:
* Actuate Corporation - initial API and implementation
* IBM Corporation - Bidi direction of text
*******************************************************************************/
package org.eclipse.birt.sample.reportitem.rotatedtext.util;
* Note: Only one of the style UP or DOWN may be specified.
* </p>
*/
public Image createRotatedText(String text, Integer angle )
public Image createRotatedText( String text, Integer angle, boolean rtl )
{
stringImage = new Image(display, pt.x, pt.y);
// Create a gc for the image
gc = new GC(stringImage);
if ( rtl )
gc = new GC( stringImage, SWT.RIGHT_TO_LEFT );
else
gc = new GC( stringImage, SWT.LEFT_TO_RIGHT );
// Draw the text onto the image
gc.drawText(text, 0, 0);
package org.eclipse.birt.sample.reportitem.rotatedtext;
graphicsUtil = new GraphicsUtil();
org.eclipse.swt.graphics.Image rotatedImage = graphicsUtil.createRotatedText(text, angle);
org.eclipse.swt.graphics.Image rotatedImage = graphicsUtil
.createRotatedText( text, angle, modelHandle.isDirectionRTL( ) );
// Test
ImageLoader imageLoader = new ImageLoader();