private void updateSystemIcon() { Window window = getWindow(); if (window == null) { mySystemIcon = null; return; } List<Image> icons = window.getIconImages(); assert icons != null; if (icons.size() == 0) { mySystemIcon = null; } else if (icons.size() == 1) { mySystemIcon = icons.get(0); } else { final JBDimension size = JBUI.size(32); final Image image = icons.get(0); mySystemIcon = Scalr.resize( ImageUtil.toBufferedImage(image), Scalr.Method.ULTRA_QUALITY, size.width, size.height); } }
/** * Find image to install into Title or into Application icon. First try icons installed for * toplevel. Null is returned, if there is no icon and default Duke image should be used. */ private CImage getImageForTarget() { CImage icon = null; try { icon = CImage.getCreator().createFromImages(target.getIconImages()); } catch (Exception ignored) { // Perhaps the icon passed into Java is broken. Skipping this icon. } return icon; }
/* */ private void updateSystemIcon() /* */ { /* 1006 */ Window localWindow = getWindow(); /* 1007 */ if (localWindow == null) { /* 1008 */ this.systemIcon = null; /* 1009 */ return; /* */ } /* 1011 */ List localList = localWindow.getIconImages(); /* 1012 */ assert (localList != null); /* */ /* 1014 */ if (localList.size() == 0) { /* 1015 */ this.systemIcon = null; /* */ } /* 1017 */ else if (localList.size() == 1) { /* 1018 */ this.systemIcon = ((Image) localList.get(0)); /* */ } /* */ else /* 1021 */ this.systemIcon = SunToolkit.getScaledIconImage(localList, 16, 16); /* */ }