~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/xcos/src/java/org/scilab/modules/xcos/preferences/XcosConfiguration.java

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3
 
 * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
 
3
 * Copyright (C) 2012 - Scilab Enterprises - Clement DAVID
4
4
 *
5
5
 * This file must be used under the terms of the CeCILL.
6
6
 * This source file is licensed as described in the file COPYING, which
30
30
     */
31
31
    @Override
32
32
    public void configurationChanged(XConfigurationEvent e) {
33
 
        Conf conf = new Conf(e.getModifiedPaths());
34
 
        if (conf.changed()) {
35
 
            XcosOptions.invalidate(conf);
36
 
            // Xcos.configurationChanged(conf);
 
33
        final Options options = new Options(e.getModifiedPaths());
 
34
        if (options.changed()) {
 
35
            XcosOptions.invalidate(options);
 
36
        }
 
37
 
 
38
        final KeyMap keymap = new KeyMap(e.getModifiedPaths());
 
39
        if (keymap.changed()) {
 
40
            XcosKeyMap.invalidate(keymap);
 
41
 
 
42
            XcosKeyMap.updateActionKeys();
37
43
        }
38
44
    }
39
45
 
40
 
    public static class Conf {
 
46
    protected static class Options {
41
47
        public boolean preferences;
42
48
        public boolean edition;
43
49
        public boolean simulation;
44
50
 
45
 
        public Conf(Set<String> path) {
 
51
        public Options(Set<String> path) {
46
52
            if (path.contains("ALL")) {
47
53
                preferences = true;
48
54
                edition = true;
58
64
            return preferences || edition || simulation;
59
65
        }
60
66
    }
 
67
 
 
68
    protected static class KeyMap {
 
69
        public boolean keymap;
 
70
 
 
71
        public KeyMap(Set<String> path) {
 
72
            if (path.contains("ALL")) {
 
73
                keymap = true;
 
74
            } else {
 
75
                keymap = path.contains(XcosKeyMap.KEYMAP_XPATH);
 
76
            }
 
77
        }
 
78
 
 
79
        public boolean changed() {
 
80
            return keymap;
 
81
        }
 
82
    }
61
83
}