source: trunk/src/org/expeditee/setting/DirectoryListSetting.java@ 1434

Last change on this file since 1434 was 1434, checked in by bln4, 5 years ago

Implementation of ProfileManager. Refactor + additional content for how new profiles are created. The refactoring split out the creation of the default profile from user profiles. Refactoring revealed a long term bug that was causing user profiles to generate with incorrect information. The additional content fixed this bug by introducing the ${USER.NAME} variable, so that the default profile frameset can specify resource locations located in the users resource directory.

org.expeditee.auth.AuthenticatorBrowser
org.expeditee.auth.account.Create
org.expeditee.gui.Browser
org.expeditee.gui.management.ProfileManager
org.expeditee.setting.DirectoryListSetting
org.expeditee.setting.ListSetting
org.expeditee.settings.UserSettings

Implementation of ResourceManager as a core location to get resources from the file system. Also the additional variable ${CURRENT_FRAMESET} to represent the current frameset, so that images can be stored in the directory of the current frameset. This increases portability of framesets.

org.expeditee.gui.FrameIO
org.expeditee.gui.management.ResourceManager
org.expeditee.gui.management.ResourceUtil
Audio:

#NB: Audio used to only operate on a single directory. This has been updated to work in a same way as images. That is: when you ask for a specific resouce, it looks to the user settings to find a sequence of directories to look at in order until it manages to find the desired resource.


There is still need however for a single(ish) source of truth for the .banks and .mastermix file. Therefore these files are now always located in resource-<username>\audio.
org.apollo.agents.MelodySearch
org.apollo.audio.structure.AudioStructureModel
org.apollo.audio.util.MultiTrackPlaybackController
org.apollo.audio.util.SoundDesk
org.apollo.gui.FrameLayoutDaemon
org.apollo.io.AudioPathManager
org.apollo.util.AudioPurger
org.apollo.widgets.FramePlayer
org.apollo.widgets.SampledTrack

Images:

org.expeditee.items.ItemUtils

Frames:

org.expeditee.gui.FrameIO

Fixed a error in the FramePlayer class caused by an incorrect use of toArray().

org.apollo.widgets.FramePlayer


Added several short cut keys to allow for the Play/Pause (Ctrl + P), mute (Ctrl + M) and volume up/down (Ctrl + +/-) when hovering over SampledTrack widgets.

org.apollo.widgets.SampledTrack


Changed the way that Authenticate.login parses the new users profile to be more consistance with other similar places in code.

org.expeditee.auth.account.Authenticate


Encapsulated _body, _surrogateItemsBody and _primaryItemsBody in Frame class. Also changed getBody function to take a boolean flag as to if it should respect the current surrogate mode. If it should then it makes sure that labels have not changed since last time getBody was called.

org.expeditee.gui.Frame

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1package org.expeditee.setting;
2
3import java.io.File;
4import java.util.ArrayList;
5import java.util.HashMap;
6import java.util.LinkedList;
7import java.util.List;
8import java.util.Map;
9
10import org.expeditee.gui.DisplayController;
11import org.expeditee.gui.FrameIO;
12import org.expeditee.gui.FrameUtils;
13import org.expeditee.items.Text;
14
15public class DirectoryListSetting extends ListSetting<String> {
16
17 /*
18 public DirectoryListSetting(String tooltip, String name, List<String> value) {
19 super(tooltip, name, value);
20 }*/
21
22 public DirectoryListSetting(String tooltip, String name) {
23 super(tooltip, name, new LinkedList<String>());
24 }
25
26 @Override
27 public boolean setSetting(Text text) {
28 List<String> dirs = FrameUtils.getDirs(text);
29 if (!dirs.isEmpty()) {
30 _value.clear();
31 _value.addAll(dirs);
32 }
33 return true;
34 }
35
36 public List<String> getAbsoluteDirs() {
37 String parent_folder = FrameIO.PARENT_FOLDER;
38 boolean need_file_sep_replace = (!File.separator.equals("/"));
39
40 List<String> value_absolute_dir = new ArrayList<String>();
41
42 for (String rel : _value) {
43 if (need_file_sep_replace) {
44 rel = rel.replace("/",File.separator);
45 }
46
47 String abs = null;
48 File rel_file = new File(rel);
49 if (rel_file.isAbsolute()) {
50 // The directory being stored somehow wasn't relative to expeditee.home
51 // => use it 'as is'
52 abs = rel;
53 } else {
54 abs = parent_folder + rel;
55 }
56 value_absolute_dir.add(abs);
57 }
58
59 return value_absolute_dir;
60 }
61
62 public void addAbsoluteDir(String absolute_dir) {
63 boolean need_file_sep_replace = (!File.separator.equals("/"));
64
65 String rel = null;
66 if (absolute_dir.startsWith(FrameIO.PARENT_FOLDER)) {
67 // only remove parent_folder if it matches
68 rel = absolute_dir.substring(FrameIO.PARENT_FOLDER.length());
69 }
70 else {
71 rel = absolute_dir;
72 }
73
74 if (need_file_sep_replace) {
75 rel = rel.replace(File.separator,"/");
76 }
77
78 _value.add(rel);
79 }
80}
Note: See TracBrowser for help on using the repository browser.