Package com.tulskiy.musique.system.configuration

Examples of com.tulskiy.musique.system.configuration.Configuration


    private List<QueueTuple> queue = new ArrayList<QueueTuple>();
    private Track lastPlayed;
    private Expression albumFormat;

    public PlaybackOrder() {
        final Configuration config = Application.getInstance().getConfiguration();
        config.addPropertyChangeListener("playbackOrder.albumFormat", true, new PropertyChangeListener() {
            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                String format = config.getString(evt.getPropertyName(), "%album%");
                albumFormat = Parser.parse(format);
            }
        });
    }
View Full Code Here


    public static String getHotkeyKey() {
        return "hotkeys.hotkey";
    }
   
    public static Map<KeyStroke, HotKeyEvent> getHotkeys(Logger logger) {
        Configuration config = Application.getInstance().getConfiguration();
        List<String> hotkeysRaw = (List<String>) config.getList(getHotkeyKey());
        Map<KeyStroke, HotKeyEvent> hotkeys = new LinkedHashMap<KeyStroke, HotKeyEvent>();
        if (!CollectionUtils.isEmpty(hotkeysRaw)) {
            for (String hotkeyRaw : hotkeysRaw) {
                try {
                    String[] tokens = hotkeyRaw.split(": ");
View Full Code Here

    @Deprecated
    /*
     * Temporary method to convert old configuration values.
     */
    public static void setHotkeysRaw(List<String> values) {
        Configuration config = Application.getInstance().getConfiguration();
        config.setList(getHotkeyKey(), values);
    }
View Full Code Here

        Configuration config = Application.getInstance().getConfiguration();
        config.setList(getHotkeyKey(), values);
    }
   
    public static void setHotkeys(Vector<Vector> values) {
        Configuration config = Application.getInstance().getConfiguration();
        ArrayList<String> hotkeysRaw = new ArrayList<String>();
        for (Vector value : values) {
            hotkeysRaw.add(value.get(0) + ": " + value.get(1));
        }
        config.setList(getHotkeyKey(), hotkeysRaw);
    }
View Full Code Here

        toolBar.add(pathField);
        return toolBar;
    }

    public File[] showOpenDialog() {
        Configuration config = app.getConfiguration();
        String path = config.getString("playlists.lastDir", null);
        if (path != null) {
            File file = new File(path);
            if (file.exists())
                directoryChooser.setSelectedFile(file);
        }
        setVisible(true);
        dispose();
        File[] files = directoryChooser.getSelectedFiles();
        if (files.length > 0) {
            File dir = files[0];
            while (dir != null && !dir.isDirectory()) {
                dir = dir.getParentFile();
            }
            if (dir != null) {
                config.setString("playlists.lastDir", dir.getAbsolutePath());
            }
        }
        return selectedFiles;
    }
View Full Code Here

        CONFIG_HOME.mkdirs();
        configFile = new File(CONFIG_HOME, "config");
    }

    public void load() {
        configuration = new Configuration();
        try {
            configuration.load(new FileReader(configFile));
        } catch (FileNotFoundException ignored) {
        }
View Full Code Here

TOP

Related Classes of com.tulskiy.musique.system.configuration.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.