/** * Overlay badge image. * * @param badge Overlay * @param icon Icon * @return Cached icon */ private NSImage badge(final NSImage badge, final NSImage icon) { NSImage f = NSImage.imageWithSize(icon.size()); f.lockFocus(); icon.drawInRect( new NSRect(new NSPoint(0, 0), icon.size()), NSZeroRect, NSGraphics.NSCompositeSourceOver, 1.0f); badge.drawInRect( new NSRect(new NSPoint(0, 0), icon.size()), NSZeroRect, NSGraphics.NSCompositeSourceOver, 1.0f); f.unlockFocus(); return f; }