Search in sources :

Example 1 with SwtUniversalImageBitmap

use of org.pentaho.di.core.SwtUniversalImageBitmap in project pentaho-kettle by pentaho.

the class SwtSvgImageUtil method getMissingImage.

/**
 * Get the image for when all other fallbacks have failed.  This is an image
 * drawn on the canvas, a square with a red X.
 *
 * @param display the device to render the image to
 * @return the missing image
 */
public static SwtUniversalImage getMissingImage(Display display) {
    Image img = new Image(display, ConstUI.ICON_SIZE, ConstUI.ICON_SIZE);
    GC gc = new GC(img);
    gc.setForeground(new Color(display, 0, 0, 0));
    gc.drawRectangle(4, 4, ConstUI.ICON_SIZE - 8, ConstUI.ICON_SIZE - 8);
    gc.setForeground(new Color(display, 255, 0, 0));
    gc.drawLine(4, 4, ConstUI.ICON_SIZE - 4, ConstUI.ICON_SIZE - 4);
    gc.drawLine(ConstUI.ICON_SIZE - 4, 4, 4, ConstUI.ICON_SIZE - 4);
    gc.dispose();
    return new SwtUniversalImageBitmap(img);
}
Also used : Color(org.eclipse.swt.graphics.Color) Image(org.eclipse.swt.graphics.Image) SwtUniversalImage(org.pentaho.di.core.SwtUniversalImage) GC(org.eclipse.swt.graphics.GC) SwtUniversalImageBitmap(org.pentaho.di.core.SwtUniversalImageBitmap)

Aggregations

Color (org.eclipse.swt.graphics.Color)1 GC (org.eclipse.swt.graphics.GC)1 Image (org.eclipse.swt.graphics.Image)1 SwtUniversalImage (org.pentaho.di.core.SwtUniversalImage)1 SwtUniversalImageBitmap (org.pentaho.di.core.SwtUniversalImageBitmap)1