Changeset 5055 in josm for trunk/src/org
- Timestamp:
- 2012-03-08T12:31:59+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r5054 r5055 98 98 protected int maxHeight = -1; 99 99 protected boolean optional; 100 protected boolean suppressWarnings; 101 protected Collection<ClassLoader> additionalClassLoaders; 100 102 101 103 private static SVGUniverse svgUniverse; … … 220 222 221 223 /** 224 * Suppresses warning on the command line in case the image cannot be found. 225 * 226 * In combination with setOptional(true); 227 */ 228 public ImageProvider setSuppressWarning(boolean suppressWarnings) { 229 this.suppressWarnings = suppressWarnings; 230 return this; 231 } 232 233 /** 234 * Add a collection of additional class loaders to search image for. 235 */ 236 public ImageProvider setAdditionalClassLoaders(Collection<ClassLoader> additionalClassLoaders) { 237 this.additionalClassLoaders = additionalClassLoaders; 238 return this; 239 } 240 241 /** 222 242 * Execute the image request. 223 243 */ 224 244 public ImageIcon get() { 225 return get(true);226 }227 228 /**229 * Execute the image request.230 * @param warn If the requested image has been set as optional and is not found, prints an error message on System.err.231 */232 public ImageIcon get(boolean warn) {233 return get(warn, null);234 }235 236 /**237 * Execute the image request.238 * @param additionalClassLoaders A collection of additional class loaders to search image for.239 */240 public ImageIcon get(Collection<ClassLoader> additionalClassLoaders) {241 return get(true, additionalClassLoaders);242 }243 244 /**245 * Execute the image request.246 * @param warn If the requested image has been set as optional and is not found, prints an error message on System.err.247 * @param additionalClassLoaders A collection of additional class loaders to search image for.248 */249 public ImageIcon get(boolean warn, Collection<ClassLoader> additionalClassLoaders) {250 245 ImageResource ir = getIfAvailableImpl(additionalClassLoaders); 251 246 if (ir == null) { … … 254 249 throw new RuntimeException(tr("Fatal: failed to locate image ''{0}''. This is a serious configuration problem. JOSM will stop working.", name + ext)); 255 250 } else { 256 if ( warn) {251 if (!suppressWarnings) { 257 252 System.err.println(tr("Failed to locate image ''{0}''", name)); 258 253 }
Note:
See TracChangeset
for help on using the changeset viewer.