mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
XCode 4.5
This commit is contained in:
@@ -174,7 +174,9 @@ public final class IconLoader {
|
||||
|
||||
@Nullable
|
||||
public static Icon findIcon(URL url) {
|
||||
if (url == null) return null;
|
||||
if (url == null) {
|
||||
return null;
|
||||
}
|
||||
Icon icon = ourIconsCache.get(url);
|
||||
if (icon == null) {
|
||||
icon = new CachedImageIcon(url);
|
||||
|
||||
@@ -26,18 +26,16 @@ public class SizedIcon implements Icon {
|
||||
private final int myHeight;
|
||||
private final Image myImage;
|
||||
|
||||
public SizedIcon(int maxWidth, int maxHeight, ImageIcon icon) {
|
||||
myWidth = Math.min(maxWidth, icon.getIconWidth());
|
||||
myHeight = Math.min(maxHeight, icon.getIconHeight());
|
||||
myImage = icon.getImage();
|
||||
}
|
||||
|
||||
public SizedIcon(int maxWidth, int maxHeight, Image image) {
|
||||
myWidth = Math.min(maxWidth, image.getWidth(null));
|
||||
myHeight = Math.min(maxHeight, image.getHeight(null));
|
||||
myImage = image;
|
||||
}
|
||||
|
||||
public SizedIcon(int maxWidth, int maxHeight, ImageIcon icon) {
|
||||
this(maxWidth, maxHeight, icon.getImage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
g.drawImage(myImage, x, y, myWidth, myHeight, null);
|
||||
|
||||
Reference in New Issue
Block a user