org.eclipse.draw2d
Class ImageUtilities

java.lang.Object
  extended byorg.eclipse.draw2d.ImageUtilities

public class ImageUtilities
extends java.lang.Object


Constructor Summary
ImageUtilities()
           
 
Method Summary
static org.eclipse.swt.graphics.Image createRotatedImage(org.eclipse.swt.graphics.Image srcImage)
          Returns a new Image that is the given Image rotated left by 90 degrees.
static org.eclipse.swt.graphics.Image createRotatedImageOfString(java.lang.String string, org.eclipse.swt.graphics.Font font, org.eclipse.swt.graphics.Color foreground, org.eclipse.swt.graphics.Color background)
          Returns a new Image with the given String rotated left (by 90 degrees).
static org.eclipse.swt.graphics.ImageData createShadedImage(org.eclipse.swt.graphics.Image fromImage, org.eclipse.swt.graphics.Color shade)
          Creates an ImageData representing the given Image shaded with the given Color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtilities

public ImageUtilities()
Method Detail

createRotatedImageOfString

public static org.eclipse.swt.graphics.Image createRotatedImageOfString(java.lang.String string,
                                                                        org.eclipse.swt.graphics.Font font,
                                                                        org.eclipse.swt.graphics.Color foreground,
                                                                        org.eclipse.swt.graphics.Color background)
Returns a new Image with the given String rotated left (by 90 degrees). The String will be rendered using the provided colors and fonts. The client is responsible for disposing the returned Image. Strings cannot contain newline or tab characters. This method MUST be invoked from the user-interface (Display) thread.

Parameters:
string - the String to be rendered
font - the font
foreground - the text's color
background - the background color
Returns:
an Image which must be disposed

createRotatedImage

public static org.eclipse.swt.graphics.Image createRotatedImage(org.eclipse.swt.graphics.Image srcImage)
Returns a new Image that is the given Image rotated left by 90 degrees. The client is responsible for disposing the returned Image. This method MUST be invoked from the user-interface (Display) thread.

Parameters:
srcImage - the Image that is to be rotated left
Returns:
the rotated Image (the client is responsible for disposing it)

createShadedImage

public static org.eclipse.swt.graphics.ImageData createShadedImage(org.eclipse.swt.graphics.Image fromImage,
                                                                   org.eclipse.swt.graphics.Color shade)
Creates an ImageData representing the given Image shaded with the given Color.

Parameters:
fromImage - Image that has to be shaded
shade - The Color to be used for shading
Returns:
A new ImageData that can be used to create an Image.