MCPcopy Index your code
hub / github.com/processing/processing / initIcons

Method initIcons

core/src/processing/opengl/PSurfaceJOGL.java:475–499  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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")

Callers 1

initFrameMethod · 0.95

Calls 2

resourceFilenameMethod · 0.95
getClassLoaderMethod · 0.80

Tested by

no test coverage detected