use of org.eclipse.swt.graphics.ImageData in project dbeaver by serge-rider.
the class OverlayImageDescriptor method drawBottomLeft.
protected void drawBottomLeft(ImageDescriptor[] overlays) {
if (overlays == null)
return;
int length = overlays.length;
int x = 0;
for (int i = 0; i < 3; i++) {
if (i < length && overlays[i] != null) {
ImageData id = overlays[i].getImageData();
drawImage(id, x, getSize().y - id.height);
x += id.width;
}
}
}
use of org.eclipse.swt.graphics.ImageData in project dbeaver by serge-rider.
the class OverlayImageDescriptor method drawTopRight.
protected void drawTopRight(ImageDescriptor[] overlays) {
if (overlays == null)
return;
int length = overlays.length;
int x = getSize().x;
for (int i = 2; i >= 0; i--) {
if (i < length && overlays[i] != null) {
ImageData id = overlays[i].getImageData();
x -= id.width;
drawImage(id, x, 0);
}
}
}
use of org.eclipse.swt.graphics.ImageData in project dbeaver by serge-rider.
the class OverlayImageDescriptor method drawCompositeImage.
@Override
protected void drawCompositeImage(int width, int height) {
ImageData base = baseImageData;
drawImage(base, 0, 0);
if (topRight != null)
drawTopRight(topRight);
if (bottomRight != null)
drawBottomRight(bottomRight);
if (bottomLeft != null)
drawBottomLeft(bottomLeft);
if (topLeft != null)
drawTopLeft(topLeft);
}
use of org.eclipse.swt.graphics.ImageData in project otertool by wuntee.
the class SWTResourceManager method getImage.
/**
* Returns an {@link Image} encoded by the specified {@link InputStream}.
*
* @param stream
* the {@link InputStream} encoding the image data
* @return the {@link Image} encoded by the specified input stream
*/
protected static Image getImage(InputStream stream) throws IOException {
try {
Display display = Display.getCurrent();
ImageData data = new ImageData(stream);
if (data.transparentPixel > 0) {
return new Image(display, data, data.getTransparencyMask());
}
return new Image(display, data);
} finally {
stream.close();
}
}
use of org.eclipse.swt.graphics.ImageData in project cubrid-manager by CUBRID.
the class DecoratedImage method drawCompositeImage.
protected void drawCompositeImage(int width, int height) {
// Draw the base image
drawImage(baseImage.getImageData(), 0, 0);
// Draw on the top left corner
if (topLeft != null && topLeftKey != null) {
ImageData imageData = topLeft.getImageData();
drawImage(imageData, 0, 0);
}
// Draw on top right corner
if (topRight != null && topRightKey != null) {
ImageData imageData = topRight.getImageData();
drawImage(imageData, sizeOfImage.x - imageData.width, 0);
}
// Draw on bottom left
if (bottomLeft != null && bottomLeftKey != null) {
ImageData imageData = bottomLeft.getImageData();
drawImage(imageData, sizeOfImage.x - imageData.width, 0);
}
// Draw on bottom right corner
if (bottomRight != null && bottomRightKey != null) {
ImageData imageData = bottomRight.getImageData();
drawImage(imageData, sizeOfImage.x - imageData.width, sizeOfImage.y - imageData.height);
}
}
Aggregations