use of org.apache.hop.core.SwtUniversalImageBitmap in project hop by apache.
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);
// RAP only allows painting on the Canvas widget
if (!EnvironmentUtils.getInstance().isWeb()) {
GC gc = new GC(img);
gc.setForeground(new Color(display, PropsUi.getInstance().contrastColor(0, 0, 0)));
gc.drawRectangle(4, 4, ConstUi.ICON_SIZE - 8, ConstUi.ICON_SIZE - 8);
gc.setForeground(new Color(display, PropsUi.getInstance().contrastColor(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, zoomFactor);
}
Aggregations