OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 147 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 147 Rev 181
Line 16... Line 16...
16
    public UserColor() {
16
    public UserColor() {
17
        final List<User> users = UserManager.getInstance().getAllActiveUsers();
17
        final List<User> users = UserManager.getInstance().getAllActiveUsers();
18
        final int size = users.size();
18
        final int size = users.size();
19
        for (int i = 0; i < size; i++) {
19
        for (int i = 0; i < size; i++) {
20
            final User u = users.get(i);
20
            final User u = users.get(i);
-
 
21
            if (u.getColor() == null) {
21
            map.put(u.getId(), Color.decode(COLORS[i % COLORS.length]));
22
                this.map.put(u.getId(), Color.decode(COLORS[i % COLORS.length]));
-
 
23
            } else {
-
 
24
                this.map.put(u.getId(), u.getColor());
-
 
25
            }
22
        }
26
        }
23
    }
27
    }
24
 
28
 
25
    public synchronized Color getColor(int id) {
29
    public synchronized Color getColor(int id) {
26
        return map.get(id);
30
        return this.map.get(id);
27
    }
31
    }
28
 
32
 
29
    public static final synchronized UserColor getInstance() {
33
    public static final synchronized UserColor getInstance() {
30
        if (instance == null) {
34
        if (instance == null) {
31
            instance = new UserColor();
35
            instance = new UserColor();