sdedic commented on a change in pull request #3414:
URL: https://github.com/apache/netbeans/pull/3414#discussion_r779907621
##########
File path: platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
##########
@@ -825,22 +850,62 @@ private static final ToolTipImage doMergeImages(Image
image1, Image image2, int
str.append(toolTip);
}
Object firstUrl = image1.getProperty("url", null);
+ Object firstUri = image1.getProperty("uri", null);
ColorModel model = colorModel(bitmask? Transparency.BITMASK:
Transparency.TRANSLUCENT);
// Provide a delegate Icon for scalable rendering.
Icon delegateIcon = new MergedIcon(image2Icon(image1),
image2Icon(image2), x, y);
ToolTipImage buffImage = new ToolTipImage(str.toString(), delegateIcon,
- model, model.createCompatibleWritableRaster(w, h),
model.isAlphaPremultiplied(), null, firstUrl instanceof URL ? (URL)firstUrl :
null
+ model, model.createCompatibleWritableRaster(w, h),
model.isAlphaPremultiplied(), null,
+ firstUrl instanceof URL ? (URL)firstUrl : null,
+ firstUri instanceof URI ? (URI)firstUri : null
);
// Also provide an Image-based rendering for backwards-compatibility.
java.awt.Graphics g = buffImage.createGraphics();
- g.drawImage(image1, 0, 0, null);
- g.drawImage(image2, x, y, null);
+ drawImage(g, image1, 0, 0, null);
+ drawImage(g, image2, x, y, null);
g.dispose();
return buffImage;
}
+
+ /**
+ * Retrieves the original icon from a possible wrapper.
+ * @param image image
+ * @return the icon, if reachable.
+ */
+ private static Icon originalIcon(Image image) {
+ if (image instanceof ToolTipImage) {
+ return ((ToolTipImage) image).getDelegateIcon();
+ }
+ Object o = image.getProperty("originalIcon", null); // NOI18N
Review comment:
Yes. This one I am not proud of, but I've didn't find a sensible way how
to work with a delegating Image :( Will be documented with the other magic
property strings.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists