source: trunk/src/org/expeditee/gui/ItemsList.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

File size: 1.9 KB
Line 
1package org.expeditee.gui;
2
3import java.util.ArrayList;
4import java.util.Collection;
5import java.util.Collections;
6import java.util.Iterator;
7import java.util.List;
8import java.util.function.Predicate;
9
10import org.expeditee.items.Item;
11
12/**
13 * Extends a ArrayList of Items through composition in order to keep it sorted.
14 */
15public class ItemsList implements Iterable<Item> {
16 private List<Item> items = new ArrayList<Item>();
17 private boolean sorted = true;
18
19 public ItemsList() { }
20
21 public ItemsList(ItemsList initialList) {
22 items.addAll(initialList.items);
23 }
24
25 public ItemsList(Collection<Item> unsorted) {
26 items.addAll(unsorted);
27 sort();
28 }
29
30 public void add(Item item) {
31 items.add(item);
32 sorted = false;
33 }
34
35 public void addAll(Collection<Item> toAdd) {
36 items.addAll(toAdd);
37 }
38
39 public void sort() {
40 if (!sorted) {
41 items.removeIf(item -> item == null);
42 }
43 Collections.sort(items);
44 sorted = true;
45 }
46
47 @Override
48 public Iterator<Item> iterator() {
49 //sort();
50 return items.iterator();
51 }
52
53 public boolean contains(Item item) {
54 return items.contains(item);
55 }
56
57 public int size() {
58 return items.size();
59 }
60
61 public void invalidateSorted() {
62 sorted = false;
63 }
64
65 public boolean remove(Item item) {
66 return items.remove(item);
67 }
68
69 public void removeAll(ItemsList newBody) {
70 items.removeAll(newBody.items);
71 }
72
73 public void retainAll(ItemsList historyItems) {
74 items.retainAll(historyItems.items);
75 }
76
77 public int indexOf(Item item) {
78 return items.indexOf(item);
79 }
80
81 public void set(int index, Item item) {
82 items.set(index, item);
83 }
84
85 public boolean removeIf(Predicate<Item> condition) {
86 return items.removeIf(condition);
87 }
88
89 public Collection<Item> underlying() {
90 return items;
91 }
92
93 public boolean isEmpty() {
94 return items.isEmpty();
95 }
96
97 public void clear() {
98 items.clear();
99 }
100}
Note: See TracBrowser for help on using the repository browser.