- Timestamp:
- 11/06/19 13:55:33 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/management/ResourceManager.java
r1436 r1438 35 35 * @return Returns the most relativised path if one exists, otherwise returns a copy of the ref parameter passed in. 36 36 */ 37 public static Path relativiseImagePath(Path path, Frame context) {37 /*public static Path relativiseImagePath(Path path, Frame context) { 38 38 String pathStr = path.toString(); 39 39 … … 50 50 51 51 return Paths.get(pathStr.replace(longestMatch, "")); 52 }*/ 53 54 public static Path relativiseImagePath(Path path, Frame context) { 55 Path expediteeHome = Paths.get(FrameIO.PARENT_FOLDER); 56 if (path.startsWith(expediteeHome)) { 57 return expediteeHome.relativize(path); 58 } else { 59 return path; 60 } 52 61 } 53 62 … … 130 139 // by this Expeditee Text Item. 131 140 List<String> canditateDirectoriesForResource = images.getDirectories(source); 141 canditateDirectoriesForResource.add(FrameIO.PARENT_FOLDER); 132 142 133 143 // First try finding the resource in the directories specified by the … … 150 160 // These are of the format "/packageA/packageB/filename". For 151 161 // example: "/org/expeditee/gui.management/ResourceManager.java" 152 //153 // Bryce: Do we want to allow for the option of154 // it being a path relative to expeditee.home?155 162 if (resourceFile == null || !resourceFile.exists() || resourceFile.isDirectory()) { 156 163 // Prepare for case a. … … 201 208 public static File getAudioResource(String localFileName, Frame parentFrame) { 202 209 List<String> directories = audio.getDirectories(parentFrame); 210 directories.add(FrameIO.PARENT_FOLDER); 203 211 for (String directory: directories) { 204 212 Path pathToFile = Paths.get(directory).resolve(localFileName); … … 220 228 public static List<File> gatherAudioResources(Predicate<File> includeFile, Frame parentFrame) { 221 229 List<String> directories = audio.getDirectories(parentFrame); 230 directories.add(FrameIO.PARENT_FOLDER); 222 231 List<File> results = new ArrayList<File>(); 223 232 for (String directory: directories) {
Note:
See TracChangeset
for help on using the changeset viewer.