Changeset 1415 for trunk/src/org/expeditee/gui/FrameIO.java
- Timestamp:
- 07/24/19 11:23:45 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameIO.java
r1406 r1415 88 88 */ 89 89 90 91 90 public class FrameIO { 92 91 … … 214 213 } 215 214 216 // public static void changeParentAndSubFolders(String newFolder) {217 // // Partial Paths.218 // PARENT_FOLDER = newFolder;219 // String resourcesPublicPath = PARENT_FOLDER + "resources-public" + File.separator;220 // String resourcesPrivateIndividualPath = PARENT_FOLDER + "resources-" + UserSettings.UserName.get() + File.separator;221 //222 // // Standard paths.223 // PUBLIC_PATH = PARENT_FOLDER + "public" + File.separator;224 // TRASH_PATH = PARENT_FOLDER + "trash" + File.separator;225 // HELP_PATH = PARENT_FOLDER + "documentation" + File.separator;226 // PROFILE_PATH = PARENT_FOLDER + "profiles" + File.separator;227 // EXPORTS_PATH = PARENT_FOLDER + "exports" + File.separator;228 // STATISTICS_PATH = PARENT_FOLDER + "statistics" + File.separator;229 // LOGS_PATH = PARENT_FOLDER + "logs" + File.separator;230 //231 //232 // // Conditional paths233 // if (UserSettings.PublicAndPrivateResources) {234 // // Work with a system of public and private folders235 //236 // FONT_PATH = resourcesPublicPath + "fonts" + File.separator;237 // DICT_PATH = resourcesPublicPath + "dict" + File.separator;238 // IMAGES_PATH = resourcesPublicPath + "images" + File.separator;239 // AUDIO_PATH = resourcesPublicPath + "audio" + File.separator;240 // FRAME_PATH = resourcesPublicPath + "framesets" + File.separator;241 // } else {242 // FONT_PATH = PARENT_FOLDER + "fonts" + File.separator;243 // DICT_PATH = PARENT_FOLDER + "dict" + File.separator;244 // IMAGES_PATH = PARENT_FOLDER + "images" + File.separator;245 // AUDIO_PATH = PARENT_FOLDER + "audio" + File.separator;246 // FRAME_PATH = PARENT_FOLDER + "framesets" + File.separator;247 // DEAD_DROPS_PATH = PARENT_FOLDER + "deaddrops" + File.separator;248 // }249 //250 // if (!UserSettings.PublicAndPrivateResources || (AuthenticatorBrowser.isAuthenticationRequired() && !AuthenticatorBrowser.isAuthenticated())) {251 //252 // if (UserSettings.UserName.get().equals(AuthenticatorBrowser.USER_NOBODY)) {253 // System.err.println("**** FrameIO::changeParentAndSubFolders(): Not setting subfolders for user '"+AuthenticatorBrowser.USER_NOBODY+"'");254 // }255 //256 // // If we are using the old regime, or user.name set to Browser.USER_NOBODY257 // // => then these paths should not be used.258 // RESOURCES_PATH = null;259 // SHARED_FRAMESETS_PATH = null;260 // RESOURCES_PRIVATE_PATH = null;261 // FRAME_PRIVATE_PATH = null;262 // IMAGES_PRIVATE_PATH = null;263 // AUDIO_PRIVATE_PATH = null;264 // CONTACTS_PATH = null;265 // HELP_PRIVATE_PATH = null;266 //267 // if (!UserSettings.PublicAndPrivateResources) {268 // MESSAGES_PATH = PARENT_FOLDER + "messages" + File.separator;269 // } else {270 // MESSAGES_PATH = resourcesPrivateIndividualPath + "messages" + File.separator;271 // }272 //273 // } else {274 // RESOURCES_PATH = resourcesPublicPath + "documentation" + File.separator;275 // SHARED_FRAMESETS_PATH = resourcesPrivateIndividualPath + "framesets-shared" + File.separator;276 //277 // RESOURCES_PRIVATE_PATH = PARENT_FOLDER + "resources-private" + File.separator;278 // FRAME_PRIVATE_PATH = resourcesPrivateIndividualPath + "framesets" + File.separator;279 // IMAGES_PRIVATE_PATH = resourcesPrivateIndividualPath + "images" + File.separator;280 // AUDIO_PRIVATE_PATH = resourcesPrivateIndividualPath + "audio" + File.separator;281 // CONTACTS_PATH = resourcesPrivateIndividualPath + "contacts" + File.separator;282 // HELP_PRIVATE_PATH = resourcesPrivateIndividualPath + "documentation" + File.separator;283 // MESSAGES_PATH = resourcesPrivateIndividualPath + "messages" + File.separator;284 // MAIL_PATH = resourcesPrivateIndividualPath + "mail" + File.separator;285 // DEAD_DROPS_PATH = resourcesPrivateIndividualPath + "deaddrops" + File.separator;286 // }287 //288 //289 // System.err.println("**** FrameIO::changeParentAndSubFolder(): Calling AudioPathManger.changeParentAndSubFolder()");290 // AudioPathManager.changeParentAndSubFolders(newFolder);291 // }292 293 215 // All methods are static, this should not be instantiated 294 216 private FrameIO() { … … 1001 923 template.resetDateCreated(); 1002 924 1003 for (Item i : template.get Items()) {925 for (Item i : template.getSortedItems()) { 1004 926 if (ItemUtils.startsWithTag(i, ItemUtils.TAG_PARENT)) { 1005 927 i.setLink(null); … … 1009 931 // do auto shrinking of the title IF not in twin frames mode and the title is not centred 1010 932 Item titleItem = template.getTitleItem(); 1011 1012 if (!DisplayController.isTwinFramesOn() && !Justification.center.equals(((Text)titleItem).getJustification())) { 933 if (titleItem == null) { 934 return template; 935 } 936 937 boolean titleItemJustified = titleItem == null || !Justification.center.equals(((Text)titleItem).getJustification()); 938 if (!DisplayController.isTwinFramesOn() && titleItemJustified) { 1013 939 if ((titleItem.getX() + 1) < template.getNameItem().getX()) { 1014 940 int title_item_xr = titleItem.getX() + titleItem.getBoundsWidth(); // should really be '... -1' … … 1307 1233 EcosystemManager.getMiscManager().beep(); 1308 1234 } else if (checkBackup 1309 && ItemUtils.ContainsExactTag(toSave.get Items(),1235 && ItemUtils.ContainsExactTag(toSave.getSortedItems(), 1310 1236 ItemUtils.TAG_BACKUP)) { 1311 1237 SuspendCache(); … … 1338 1264 } 1339 1265 1340 Item i = ItemUtils.FindExactTag(toSave.get Items(),1266 Item i = ItemUtils.FindExactTag(toSave.getSortedItems(), 1341 1267 ItemUtils.TAG_BACKUP); 1342 1268 i.setLink(original.getName()); … … 1480 1406 } 1481 1407 1482 public static Frame CreateNewProfile(String username, Map<String, Setting> initialSettings, Map<String, Consumer<Frame>> toNotifyOnSet) throws InvalidFramesetNameException, ExistingFramesetException 1408 public static Frame CreateNewProfile(String username, Map<String, Setting> initialSettings, Map<String, Consumer<Frame>> toNotifyOnSet) throws InvalidFramesetNameException, ExistingFramesetException { 1483 1409 Frame profile = CreateFrameset(username, PROFILE_PATH, true); 1484 1410 if (profile != null) { … … 2110 2036 } 2111 2037 2038 public static boolean personalResourcesExist(String username) { 2039 Path personalResources = Paths.get(FrameIO.PARENT_FOLDER).resolve("resources-" + username); 2040 File personalResourcesFile = personalResources.toFile(); 2041 boolean directoryExists = personalResourcesFile.exists() && personalResourcesFile.isDirectory(); 2042 return directoryExists; 2043 } 2044 2112 2045 public static Path setupPersonalResources(String username) { 2113 2046 Path personalResources = Paths.get(FrameIO.PARENT_FOLDER).resolve("resources-" + username);
Note:
See TracChangeset
for help on using the changeset viewer.