()
| 473 | |
| 474 | |
| 475 | protected void initIcons() { |
| 476 | IOUtil.ClassResources res = null; |
| 477 | if (PJOGL.icons == null || PJOGL.icons.length == 0) { |
| 478 | // Default Processing icons |
| 479 | final int[] sizes = { 16, 32, 48, 64, 128, 256, 512 }; |
| 480 | String[] iconImages = new String[sizes.length]; |
| 481 | for (int i = 0; i < sizes.length; i++) { |
| 482 | iconImages[i] = "/icon/icon-" + sizes[i] + ".png"; |
| 483 | } |
| 484 | res = new ClassResources(iconImages, |
| 485 | PApplet.class.getClassLoader(), |
| 486 | PApplet.class); |
| 487 | } else { |
| 488 | // Loading custom icons from user-provided files. |
| 489 | String[] iconImages = new String[PJOGL.icons.length]; |
| 490 | for (int i = 0; i < PJOGL.icons.length; i++) { |
| 491 | iconImages[i] = resourceFilename(PJOGL.icons[i]); |
| 492 | } |
| 493 | |
| 494 | res = new ClassResources(iconImages, |
| 495 | sketch.getClass().getClassLoader(), |
| 496 | sketch.getClass()); |
| 497 | } |
| 498 | NewtFactory.setWindowIcons(res); |
| 499 | } |
| 500 | |
| 501 | |
| 502 | @SuppressWarnings("resource") |
no test coverage detected