* @param awtImage The AWT image to be rendered as an SWT image.
* @return The corresponding SWT image, or null.
*/
- public synchronized Image setImage(BufferedImage awtImage) {
+ public synchronized Image setImage(BufferedImage awtImage, boolean isFloatingWindow) {
if (awtImage != mAwtImage || awtImage == null) {
mAwtImage = null;
if (awtImage == null) {
mImage = null;
} else {
- mImage = SwtUtils.convertToSwt(mCanvas.getDisplay(), awtImage, false, -1);
+ mImage = SwtUtils.convertToSwt(mCanvas.getDisplay(), awtImage, true, -1);
}
} else {
assert awtImage instanceof SwtReadyBufferedImage;
- mImage = ((SwtReadyBufferedImage)awtImage).getSwtImage();
+
+ if (isFloatingWindow) {
+ mImage = SwtUtils.convertToSwt(mCanvas.getDisplay(), awtImage, true, -1);
+ } else {
+ mImage = ((SwtReadyBufferedImage)awtImage).getSwtImage();
+ }
}
return mImage;
return mAwtImage;
}
-
}
mViewHierarchy.setSession(session, explodedNodes);
if (mViewHierarchy.isValid() && session != null) {
- Image image = mImageOverlay.setImage(session.getImage());
+ Image image = mImageOverlay.setImage(session.getImage(), session.isFloatingWindow());
mOutlinePage.setModel(mViewHierarchy.getRoot());
return null;
}
+ /**
+ * Returns true if the current session is rendered as a floating window.
+ * <p/>
+ * If true this means the alpha channel of {@link #getImage()} should be respected. If false,
+ * if can be dropped if it's more convenient/faster.
+ * @return whether the current session is rendered as a floating window.
+ */
+ public boolean isFloatingWindow() {
+ return true;
+ }
/**
* Returns a map of (XML attribute name, attribute value) containing only default attribute