Returns the class loader ImageJ uses to run plugins or the system class loader if Menus.getPlugInsPath() returns null.
()
| 2533 | /** Returns the class loader ImageJ uses to run plugins or the |
| 2534 | system class loader if Menus.getPlugInsPath() returns null. */ |
| 2535 | public static ClassLoader getClassLoader() { |
| 2536 | if (classLoader==null) { |
| 2537 | String pluginsDir = Menus.getPlugInsPath(); |
| 2538 | if (pluginsDir==null) { |
| 2539 | String home = System.getProperty("plugins.dir"); |
| 2540 | if (home!=null) { |
| 2541 | if (!home.endsWith(Prefs.separator)) home+=Prefs.separator; |
| 2542 | pluginsDir = home+"plugins"+Prefs.separator; |
| 2543 | if (!(new File(pluginsDir)).isDirectory()) |
| 2544 | pluginsDir = home; |
| 2545 | } |
| 2546 | } |
| 2547 | if (pluginsDir==null) |
| 2548 | return IJ.class.getClassLoader(); |
| 2549 | else { |
| 2550 | if (Menus.jnlp) |
| 2551 | classLoader = new PluginClassLoader(pluginsDir, true); |
| 2552 | else |
| 2553 | classLoader = new PluginClassLoader(pluginsDir); |
| 2554 | } |
| 2555 | } |
| 2556 | return classLoader; |
| 2557 | } |
| 2558 | |
| 2559 | /** Returns the size, in pixels, of the primary display. */ |
| 2560 | public static Dimension getScreenSize() { |