GT-2698 - code-review fixes, javadocs

This commit is contained in:
dev747368 2019-04-16 15:15:10 -04:00
parent fa7173f9ab
commit 40daea1a56
17 changed files with 175 additions and 57 deletions

View file

@ -539,7 +539,9 @@ public class ResourceManager {
}
/**
* Load the image specified by filename; returns null if problems occur trying to load the file
* Load the image specified by filename; returns the default bomb icon
* if problems occur trying to load the file.
* <p>
*
* @param filename name of file to load, e.g., "images/home.gif"
* @return the image icon stored in the bytes
@ -574,6 +576,22 @@ public class ResourceManager {
return getDefaultIcon();
}
/**
* Load the images specified by filenames; substitutes the default bomb icon
* if problems occur trying to load an individual file.
* <p>
* @param filenames vararg list of string filenames (ie. "images/home.gif")
* @return list of ImageIcons with each image, problem / missing images replaced with
* the default icon.
*/
public static List<ImageIcon> loadImages(String... filenames) {
List<ImageIcon> results = new ArrayList<>(filenames.length);
for (String filename : filenames) {
results.add(loadImage(filename));
}
return results;
}
/**
* A convenience method to force the image denoted by <code>filename</code> to be read
* from disk and to not use the cached version
@ -690,12 +708,4 @@ public class ResourceManager {
testSearchPaths = results;
return testSearchPaths;
}
public static List<ImageIcon> loadImages(String... filenames) {
List<ImageIcon> results = new ArrayList<>(filenames.length);
for (String filename : filenames) {
results.add(loadImage(filename));
}
return results;
}
}